Merge pull request #1992 from Xaymar/patch-tidy-up-1

Fix various clang-tidy and CppCheck warnings.
This commit is contained in:
Jim
2019-08-17 08:16:46 -07:00
committed by GitHub
13 changed files with 51 additions and 40 deletions

View File

@@ -259,7 +259,7 @@ try {
return true;
} catch (ErrorInfo info) {
} catch (ErrorInfo &info) {
if (!retry) {
QString title = QTStr("Auth.AuthFailure.Title");
QString text = QTStr("Auth.AuthFailure.Text")

View File

@@ -6,7 +6,7 @@
#include <QResizeEvent>
#include <QShowEvent>
static inline long long color_to_int(QColor color)
static inline long long color_to_int(const QColor &color)
{
auto shift = [&](unsigned val, int shift) {
return ((val & 0xff) << shift);

View File

@@ -146,7 +146,7 @@ try {
return true;
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
return false;
}
@@ -174,7 +174,7 @@ try {
return true;
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
return false;
}
@@ -229,7 +229,7 @@ try {
return true;
} catch (string text) {
} catch (string &text) {
blog(LOG_DEBUG, "%s: %s", __FUNCTION__, text.c_str());
return false;
}
@@ -332,7 +332,7 @@ try {
return true;
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
return false;
}
@@ -384,7 +384,7 @@ try {
return true;
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
return false;
}
@@ -430,7 +430,7 @@ try {
return true;
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
return false;
}
@@ -750,7 +750,7 @@ try {
QMetaObject::invokeMethod(App()->GetMainWindow(), "close");
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
}
@@ -845,6 +845,6 @@ try {
emit Result(QString::fromUtf8(text.c_str()));
} catch (string text) {
} catch (string &text) {
blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
}