fixed vstudio analyzer warnings

This commit is contained in:
silverqx
2022-07-16 19:39:14 +02:00
parent b4332775c2
commit a6b52ed151
7 changed files with 18 additions and 12 deletions
@@ -47,7 +47,7 @@ PostgresSchemaGrammar::compileGetAllTables(const QVector<QString> &databases) co
{
return QStringLiteral("select tablename from pg_catalog.pg_tables "
"where schemaname in (%1)")
.arg(quoteString(std::move(databases)));
.arg(quoteString(databases));
}
QString
@@ -55,7 +55,7 @@ PostgresSchemaGrammar::compileGetAllViews(const QVector<QString> &databases) con
{
return QStringLiteral("select viewname from pg_catalog.pg_views "
"where schemaname in (%1)")
.arg(quoteString(std::move(databases)));
.arg(quoteString(databases));
}
QString PostgresSchemaGrammar::compileEnableForeignKeyConstraints() const
+1 -1
View File
@@ -46,7 +46,7 @@ QString String::snake(QString string, const QChar delimiter)
std::vector<int> positions;
positions.reserve(static_cast<std::size_t>(string.size() / 2) + 2);
for (auto i = 0; i < string.size(); ++i) {
for (QString::size_type i = 0; i < string.size(); ++i) {
const auto ch = string.at(i);
if (i > 0 && ch >= QChar('A') && ch <= QChar('Z')) {
+1 -1
View File
@@ -56,7 +56,7 @@ namespace Concerns
int CallsCommands::call(const QString &command, QStringList &&arguments) const
{
return runCommand(std::move(command), std::move(arguments));
return runCommand(command, std::move(arguments));
}
} // namespace Concerns
@@ -205,6 +205,10 @@ namespace Concerns
return m_verbosity;
}
#if defined(_MSC_VER) && !defined(__clang__)
#pragma warning(push)
#pragma warning(disable : C26813)
#endif
bool InteractsWithIO::isQuietVerbosity() const noexcept
{
return m_verbosity == Quiet;
@@ -229,6 +233,9 @@ namespace Concerns
{
return m_verbosity == Debug;
}
#if defined(_MSC_VER) && !defined(__clang__)
#pragma warning(pop)
#endif
} // namespace Concerns
} // namespace Tom
+2 -3
View File
@@ -367,9 +367,8 @@ int CompleteCommand::printEnvironmentNames(const QString &environmentName) const
if (environment.startsWith(environmentName))
environmentNames
<< QStringLiteral("%1;%2").arg(
NOSPACE.arg(LongOption.arg(Env).append(EQ_C),
environment),
std::move(environment));
NOSPACE.arg(LongOption.arg(Env).append(EQ_C), environment),
environment);
// Print
note(environmentNames.join(NEWLINE));
+4 -4
View File
@@ -116,8 +116,8 @@ namespace
if (!pwshProfileFile.open(openMode))
throw Exceptions::RuntimeError(
QStringLiteral("Can not open '%1' file in openPwshProfileFile().")
.arg(QStringLiteral("%1/%2").arg(std::move(pwshProfileFolder),
std::move(profileFileRelative))));
.arg(QStringLiteral("%1/%2").arg(pwshProfileFolder,
profileFileRelative)));
}
/*! Detect whether PowerShell profile folder already exists and create it
@@ -137,8 +137,8 @@ namespace
throw Exceptions::RuntimeError(
QStringLiteral("Can not create '%1' directory "
"in preparePowerShellFolder().")
.arg(QStringLiteral("%1/%2").arg(std::move(documentsFolder),
std::move(powershellFolder))));
.arg(QStringLiteral("%1/%2").arg(documentsFolder,
powershellFolder)));
}
/*! Template string for tab-completion installed successfully. */
+1 -1
View File
@@ -232,7 +232,7 @@ void Terminal::enableUtf8ConsoleEncoding()
unicode to utf8, eg. by QString::fromStdWString(), WideCharToMultiByte(), or
std::codecvt(). It also works with msys2 ucrt64 gcc/clang. */
SetConsoleCP(CP_UTF8);
_setmode(_fileno(stdin), _O_WTEXT);
std::ignore = _setmode(_fileno(stdin), _O_WTEXT); // std::ignore to suppress C6031
}
#endif