diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 834908982..8e880c255 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,12 +1,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_compile_options(-Werror=switch) -# Uncomment to compile with more warnings -#add_compile_options(-Wall) -# Uncomment to compile with even more warnings -#add_compile_options(-Wextra) -# TODO: currently there are too many unused parameters which overwhelms the -# warning output with `-Wall`. So let's leave fixing these for later. +# Uncomment to compile with more warnings add_compile_options(-Wall) Uncomment +# to compile with even more warnings add_compile_options(-Wextra) TODO: +# currently there are too many unused parameters which overwhelms the warning +# output with `-Wall`. So let's leave fixing these for later. add_compile_options(-Wno-unused-parameter) add_subdirectory(util) diff --git a/src/app/CustomTheme.cpp b/src/app/CustomTheme.cpp index e6b243818..b23138d51 100644 --- a/src/app/CustomTheme.cpp +++ b/src/app/CustomTheme.cpp @@ -481,7 +481,7 @@ QColor CustomTheme::heatMap(HeatMap color) { return QColor(heatmap.value("cold").toString()); } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(color))); + std::to_string(static_cast(color))); } QColor CustomTheme::remoteComment(Comment color) { @@ -498,7 +498,7 @@ QColor CustomTheme::remoteComment(Comment color) { return QColor(comment.value("timestamp").toString()); } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(color))); + std::to_string(static_cast(color))); } QColor CustomTheme::star() { diff --git a/src/conf/Settings.cpp b/src/conf/Settings.cpp index 7a5b03ce3..6c2de3c36 100644 --- a/src/conf/Settings.cpp +++ b/src/conf/Settings.cpp @@ -173,7 +173,7 @@ QString Settings::promptDescription(Prompt::Kind kind) const { return tr("Prompt to stage large files"); } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(kind))); + std::to_string(static_cast(kind))); } void Settings::setHotkey(const QString &action, const QString &hotkey) { diff --git a/src/git/Diff.cpp b/src/git/Diff.cpp index 1c5051963..a85ae545d 100644 --- a/src/git/Diff.cpp +++ b/src/git/Diff.cpp @@ -199,7 +199,7 @@ void Diff::sort(SortRole role, Qt::SortOrder order) { } } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(role))); + std::to_string(static_cast(role))); }); } diff --git a/src/git/Patch.cpp b/src/git/Patch.cpp index 604712f10..913104e4c 100644 --- a/src/git/Patch.cpp +++ b/src/git/Patch.cpp @@ -265,7 +265,8 @@ QByteArray Patch::lineContent(int hidx, int ln) const { const git_diff_line *line = nullptr; int result = git_patch_get_line_in_hunk(&line, d.data(), hidx, ln); - return (GIT_OK == result) ? QByteArray(line->content, line->content_len) : QByteArray(); + return (GIT_OK == result) ? QByteArray(line->content, line->content_len) + : QByteArray(); } Patch::ConflictResolution Patch::conflictResolution(int hidx) { diff --git a/src/host/Account.cpp b/src/host/Account.cpp index 6dc5b80f5..0e2af7030 100644 --- a/src/host/Account.cpp +++ b/src/host/Account.cpp @@ -30,10 +30,8 @@ const QString kThemeIconFmt = ":/%1_%2.png"; } // namespace Account::Account(const QString &username) - : mUsername(username), - mError(new AccountError(this)), - mProgress(new AccountProgress(this)), - mMgr(new QNetworkAccessManager()) { + : mUsername(username), mError(new AccountError(this)), + mProgress(new AccountProgress(this)), mMgr(new QNetworkAccessManager()) { QObject::connect( mMgr, &QNetworkAccessManager::sslErrors, [this](QNetworkReply *reply, const QList &errors) { @@ -207,7 +205,7 @@ QString Account::helpText(Kind kind) { return QString(); } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(kind))); + std::to_string(static_cast(kind))); } QString Account::defaultUrl(Kind kind) { @@ -224,7 +222,7 @@ QString Account::defaultUrl(Kind kind) { return GitLab::defaultUrl(); } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(kind))); + std::to_string(static_cast(kind))); } Account::Kind Account::kindFromString(const QString &kind, bool *ok) { @@ -265,7 +263,7 @@ QString Account::kindToString(Kind kind) { return "gitlab"; } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(kind))); + std::to_string(static_cast(kind))); } void Account::startProgress() { diff --git a/src/plugins/Plugin.cpp b/src/plugins/Plugin.cpp index 842c852bf..54190c1f3 100644 --- a/src/plugins/Plugin.cpp +++ b/src/plugins/Plugin.cpp @@ -615,7 +615,7 @@ QVariant Plugin::optionValue(const QString &key) const { return config().value(kKeyFmt.arg(mName, key), value.toString()); } throw std::runtime_error("unreachable; value=" + - std::to_string(static_cast(optionKind(key)))); + std::to_string(static_cast(optionKind(key)))); } Plugin::OptionKind Plugin::optionKind(const QString &key) const {