mitigated and enabled more clang-tidy warnings (#4470)
* fixed some `performance-inefficient-string-concatenation` clang-tidy warnings * fixed and enabled `modernize-replace-random-shuffle` clang-tidy warning * fixed and enabled `bugprone-suspicious-string-compare` clang-tidy warning * mitigated and enabled `readability-non-const-parameter` clang-tidy warnings * clang-tidy.md: documented some disabled checks * mitigated and enabled `performance-unnecessary-value-param` clang-tidy warnings
This commit is contained in:
parent
45ccc9ba1e
commit
339484d2a1
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-named-parameter,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-performance-unnecessary-value-param,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-readability-non-const-parameter,-misc-non-private-member-variables-in-classes,-bugprone-suspicious-string-compare,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-bugprone-suspicious-include,-modernize-replace-random-shuffle,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics'
|
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-named-parameter,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-bugprone-suspicious-include,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics'
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
|
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
|
||||||
|
|
|
@ -110,24 +110,29 @@ Work in progress.
|
||||||
|
|
||||||
Is reported for valid patterns we are using.
|
Is reported for valid patterns we are using.
|
||||||
|
|
||||||
|
`readability-suspicious-call-argument`<br>
|
||||||
|
|
||||||
|
Produces a lot of false positives since it is too vague in its analysis.
|
||||||
|
|
||||||
|
`performance-inefficient-string-concatenation`<br>
|
||||||
|
|
||||||
|
Produces many warnings which very much look like false ppsitives (needs to be reported upstream).
|
||||||
|
|
||||||
|
`bugprone-suspicious-include`<br>
|
||||||
|
|
||||||
|
Causes warnings with `*.cpp` includes in Qt generated files.
|
||||||
|
|
||||||
`modernize-avoid-c-arrays`<br>
|
`modernize-avoid-c-arrays`<br>
|
||||||
`readability-container-size-empty`<br>
|
`readability-container-size-empty`<br>
|
||||||
`bugprone-branch-clone`<br>
|
`bugprone-branch-clone`<br>
|
||||||
`readability-const-return-type`<br>
|
`readability-const-return-type`<br>
|
||||||
`performance-unnecessary-value-param`<br>
|
|
||||||
`modernize-return-braced-init-list`<br>
|
`modernize-return-braced-init-list`<br>
|
||||||
`performance-inefficient-string-concatenation`<br>
|
|
||||||
`misc-throw-by-value-catch-by-reference`<br>
|
`misc-throw-by-value-catch-by-reference`<br>
|
||||||
`readability-avoid-const-params-in-decls`<br>
|
`readability-avoid-const-params-in-decls`<br>
|
||||||
`readability-non-const-parameter`<br>
|
|
||||||
`bugprone-suspicious-string-compare`<br>
|
|
||||||
`bugprone-signed-char-misuse`<br>
|
`bugprone-signed-char-misuse`<br>
|
||||||
`bugprone-suspicious-include`<br>
|
|
||||||
`modernize-replace-random-shuffle`<br>
|
|
||||||
`readability-redundant-access-specifiers`<br>
|
`readability-redundant-access-specifiers`<br>
|
||||||
`performance-noexcept-move-constructor`<br>
|
`performance-noexcept-move-constructor`<br>
|
||||||
`concurrency-mt-unsafe`<br>
|
`concurrency-mt-unsafe`<br>
|
||||||
`readability-suspicious-call-argument`<br>
|
|
||||||
|
|
||||||
To be evaluated.
|
To be evaluated.
|
||||||
|
|
||||||
|
|
|
@ -575,8 +575,9 @@ bool CppCheckExecutor::tryLoadLibrary(Library& destination, const std::string& b
|
||||||
/**
|
/**
|
||||||
* Execute a shell command and read the output from it. Returns true if command terminated successfully.
|
* Execute a shell command and read the output from it. Returns true if command terminated successfully.
|
||||||
*/
|
*/
|
||||||
// cppcheck-suppress passedByValue - "exe" copy needed in _WIN32 code
|
// cppcheck-suppress passedByValue - used as callback so we need to preserve the signature
|
||||||
bool CppCheckExecutor::executeCommand(std::string exe, std::vector<std::string> args, const std::string &redirect, std::string *output_)
|
// NOLINTNEXTLINE(performance-unnecessary-value-param) - used as callback so we need to preserve the signature
|
||||||
|
bool CppCheckExecutor::executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string *output_)
|
||||||
{
|
{
|
||||||
output_->clear();
|
output_->clear();
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Execute a shell command and read the output from it. Returns true if command terminated successfully.
|
* Execute a shell command and read the output from it. Returns true if command terminated successfully.
|
||||||
*/
|
*/
|
||||||
static bool executeCommand(std::string exe, std::vector<std::string> args, const std::string &redirect, std::string *output_);
|
static bool executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string *output_);
|
||||||
|
|
||||||
static bool reportSuppressions(const Settings &settings, bool unusedFunctionCheckEnabled, const std::map<std::string, std::size_t> &files, ErrorLogger& errorLogger);
|
static bool reportSuppressions(const Settings &settings, bool unusedFunctionCheckEnabled, const std::map<std::string, std::size_t> &files, ErrorLogger& errorLogger);
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
// NOLINTNEXTLINE(performance-unnecessary-value-param) - used as callback so we need to preserve the signature
|
||||||
static bool executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string *output)
|
static bool executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string *output)
|
||||||
{
|
{
|
||||||
output->clear();
|
output->clear();
|
||||||
|
|
|
@ -589,7 +589,7 @@ void TestCppcheckLibraryData::containerValid()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCppcheckLibraryData::loadCfgFile(QString filename, CppcheckLibraryData &data, QString &res, bool removeFile)
|
void TestCppcheckLibraryData::loadCfgFile(const QString &filename, CppcheckLibraryData &data, QString &res, bool removeFile)
|
||||||
{
|
{
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
|
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
|
||||||
|
@ -600,7 +600,7 @@ void TestCppcheckLibraryData::loadCfgFile(QString filename, CppcheckLibraryData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCppcheckLibraryData::saveCfgFile(QString filename, CppcheckLibraryData &data)
|
void TestCppcheckLibraryData::saveCfgFile(const QString &filename, CppcheckLibraryData &data)
|
||||||
{
|
{
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text));
|
QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text));
|
||||||
|
|
|
@ -42,8 +42,8 @@ private slots:
|
||||||
void containerValid();
|
void containerValid();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void loadCfgFile(QString filename, CppcheckLibraryData &data, QString &res, bool removeFile = false);
|
static void loadCfgFile(const QString &filename, CppcheckLibraryData &data, QString &res, bool removeFile = false);
|
||||||
static void saveCfgFile(QString filename, CppcheckLibraryData &data);
|
static void saveCfgFile(const QString &filename, CppcheckLibraryData &data);
|
||||||
|
|
||||||
CppcheckLibraryData libraryData;
|
CppcheckLibraryData libraryData;
|
||||||
CppcheckLibraryData fileLibraryData;
|
CppcheckLibraryData fileLibraryData;
|
||||||
|
|
|
@ -1260,7 +1260,7 @@ static bool isSameLifetime(const Token * const tok1, const Token * const tok2)
|
||||||
return v1.tokvalue == v2.tokvalue;
|
return v1.tokvalue == v2.tokvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool compareKnownValue(const Token * const tok1, const Token * const tok2, std::function<bool(const ValueFlow::Value&, const ValueFlow::Value&, bool)> compare)
|
static bool compareKnownValue(const Token * const tok1, const Token * const tok2, const std::function<bool(const ValueFlow::Value&, const ValueFlow::Value&, bool)> &compare)
|
||||||
{
|
{
|
||||||
static const auto isKnownFn = std::mem_fn(&ValueFlow::Value::isKnown);
|
static const auto isKnownFn = std::mem_fn(&ValueFlow::Value::isKnown);
|
||||||
|
|
||||||
|
|
|
@ -551,6 +551,7 @@ std::string CheckNullPointer::MyFileInfo::toString() const
|
||||||
return CTU::toString(unsafeUsage);
|
return CTU::toString(unsafeUsage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOLINTNEXTLINE(readability-non-const-parameter) - used as callback so we need to preserve the signature
|
||||||
static bool isUnsafeUsage(const Check *check, const Token *vartok, MathLib::bigint *value)
|
static bool isUnsafeUsage(const Check *check, const Token *vartok, MathLib::bigint *value)
|
||||||
{
|
{
|
||||||
(void)value;
|
(void)value;
|
||||||
|
|
|
@ -1659,6 +1659,7 @@ Check::FileInfo *CheckUninitVar::getFileInfo(const Tokenizer *tokenizer, const S
|
||||||
return checker.getFileInfo();
|
return checker.getFileInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOLINTNEXTLINE(readability-non-const-parameter) - used as callback so we need to preserve the signature
|
||||||
static bool isVariableUsage(const Check *check, const Token *vartok, MathLib::bigint *value)
|
static bool isVariableUsage(const Check *check, const Token *vartok, MathLib::bigint *value)
|
||||||
{
|
{
|
||||||
(void)value;
|
(void)value;
|
||||||
|
|
|
@ -638,7 +638,7 @@ void clangimport::AstNode::setValueType(Token *tok)
|
||||||
|
|
||||||
Scope *clangimport::AstNode::createScope(TokenList *tokenList, Scope::ScopeType scopeType, AstNodePtr astNode, const Token *def)
|
Scope *clangimport::AstNode::createScope(TokenList *tokenList, Scope::ScopeType scopeType, AstNodePtr astNode, const Token *def)
|
||||||
{
|
{
|
||||||
std::vector<AstNodePtr> children2{astNode};
|
std::vector<AstNodePtr> children2{std::move(astNode)};
|
||||||
return createScope(tokenList, scopeType, children2, def);
|
return createScope(tokenList, scopeType, children2, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,7 @@ static std::string executeAddon(const AddonInfo &addonInfo,
|
||||||
const std::string &defaultPythonExe,
|
const std::string &defaultPythonExe,
|
||||||
const std::string &file,
|
const std::string &file,
|
||||||
const std::string &premiumArgs,
|
const std::string &premiumArgs,
|
||||||
std::function<bool(std::string,std::vector<std::string>,std::string,std::string*)> executeCommand)
|
const std::function<bool(std::string,std::vector<std::string>,std::string,std::string*)> &executeCommand)
|
||||||
{
|
{
|
||||||
const std::string redirect = "2>&1";
|
const std::string redirect = "2>&1";
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ const char * CppCheck::extraVersion()
|
||||||
return ExtraVersion;
|
return ExtraVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool reportClangErrors(std::istream &is, std::function<void(const ErrorMessage&)> reportErr, std::vector<ErrorMessage> *warnings)
|
static bool reportClangErrors(std::istream &is, const std::function<void(const ErrorMessage&)>& reportErr, std::vector<ErrorMessage> *warnings)
|
||||||
{
|
{
|
||||||
std::string line;
|
std::string line;
|
||||||
while (std::getline(is, line)) {
|
while (std::getline(is, line)) {
|
||||||
|
|
|
@ -627,7 +627,7 @@ bool Token::simpleMatch(const Token *tok, const char pattern[], size_t pattern_l
|
||||||
while (*current) {
|
while (*current) {
|
||||||
const std::size_t length = next - current;
|
const std::size_t length = next - current;
|
||||||
|
|
||||||
if (!tok || length != tok->mStr.length() || std::strncmp(current, tok->mStr.c_str(), length))
|
if (!tok || length != tok->mStr.length() || std::strncmp(current, tok->mStr.c_str(), length) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
current = next;
|
current = next;
|
||||||
|
@ -2307,7 +2307,7 @@ std::string Token::typeStr(const Token* tok)
|
||||||
|
|
||||||
void Token::scopeInfo(std::shared_ptr<ScopeInfo2> newScopeInfo)
|
void Token::scopeInfo(std::shared_ptr<ScopeInfo2> newScopeInfo)
|
||||||
{
|
{
|
||||||
mImpl->mScopeInfo = newScopeInfo;
|
mImpl->mScopeInfo = std::move(newScopeInfo);
|
||||||
}
|
}
|
||||||
std::shared_ptr<ScopeInfo2> Token::scopeInfo() const
|
std::shared_ptr<ScopeInfo2> Token::scopeInfo() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -5471,7 +5471,7 @@ static std::string getExpression(const Token *tok)
|
||||||
line = prev->str() + " " + line;
|
line = prev->str() + " " + line;
|
||||||
line += "!!!" + tok->str() + "!!!";
|
line += "!!!" + tok->str() + "!!!";
|
||||||
for (const Token *next = tok->next(); next && !Token::Match(next, "[;{}]"); next = next->next())
|
for (const Token *next = tok->next(); next && !Token::Match(next, "[;{}]"); next = next->next())
|
||||||
line = line + " " + next->str();
|
line += " " + next->str();
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1990,7 +1990,7 @@ static void valueFlowReverse(TokenList* tokenlist,
|
||||||
const Settings* = nullptr,
|
const Settings* = nullptr,
|
||||||
SourceLocation loc = SourceLocation::current())
|
SourceLocation loc = SourceLocation::current())
|
||||||
{
|
{
|
||||||
std::list<ValueFlow::Value> values = {val};
|
std::list<ValueFlow::Value> values = {std::move(val)};
|
||||||
if (val2.varId != 0)
|
if (val2.varId != 0)
|
||||||
values.push_back(val2);
|
values.push_back(val2);
|
||||||
valueFlowReverse(tok, nullptr, varToken, values, tokenlist, loc);
|
valueFlowReverse(tok, nullptr, varToken, values, tokenlist, loc);
|
||||||
|
@ -4504,7 +4504,7 @@ static void valueFlowLifetime(TokenList *tokenlist, SymbolDatabase*, ErrorLogger
|
||||||
};
|
};
|
||||||
|
|
||||||
bool update = false;
|
bool update = false;
|
||||||
auto captureVariable = [&](const Token* tok2, LifetimeCapture c, std::function<bool(const Token*)> pred) {
|
auto captureVariable = [&](const Token* tok2, LifetimeCapture c, const std::function<bool(const Token*)> &pred) {
|
||||||
if (varids.count(tok->varId()) > 0)
|
if (varids.count(tok->varId()) > 0)
|
||||||
return;
|
return;
|
||||||
if (c == LifetimeCapture::ByReference) {
|
if (c == LifetimeCapture::ByReference) {
|
||||||
|
@ -6405,7 +6405,7 @@ ValueFlow::Value inferCondition(const std::string& op, const Token* varTok, Math
|
||||||
return ValueFlow::Value{};
|
return ValueFlow::Value{};
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueFlow::Value inferCondition(std::string op, MathLib::bigint val, const Token* varTok)
|
ValueFlow::Value inferCondition(const std::string &op, MathLib::bigint val, const Token* varTok)
|
||||||
{
|
{
|
||||||
if (!varTok)
|
if (!varTok)
|
||||||
return ValueFlow::Value{};
|
return ValueFlow::Value{};
|
||||||
|
@ -8928,7 +8928,7 @@ std::string ValueFlow::eitherTheConditionIsRedundant(const Token *condition)
|
||||||
|
|
||||||
const ValueFlow::Value* ValueFlow::findValue(const std::list<ValueFlow::Value>& values,
|
const ValueFlow::Value* ValueFlow::findValue(const std::list<ValueFlow::Value>& values,
|
||||||
const Settings* settings,
|
const Settings* settings,
|
||||||
std::function<bool(const ValueFlow::Value&)> pred)
|
const std::function<bool(const ValueFlow::Value&)> &pred)
|
||||||
{
|
{
|
||||||
const ValueFlow::Value* ret = nullptr;
|
const ValueFlow::Value* ret = nullptr;
|
||||||
for (const ValueFlow::Value& v : values) {
|
for (const ValueFlow::Value& v : values) {
|
||||||
|
|
|
@ -461,7 +461,7 @@ namespace ValueFlow {
|
||||||
|
|
||||||
const ValueFlow::Value* findValue(const std::list<ValueFlow::Value>& values,
|
const ValueFlow::Value* findValue(const std::list<ValueFlow::Value>& values,
|
||||||
const Settings* settings,
|
const Settings* settings,
|
||||||
std::function<bool(const ValueFlow::Value&)> pred);
|
const std::function<bool(const ValueFlow::Value&)> &pred);
|
||||||
|
|
||||||
std::vector<ValueFlow::Value> isOutOfBounds(const Value& size, const Token* indexTok, bool possible = true);
|
std::vector<ValueFlow::Value> isOutOfBounds(const Value& size, const Token* indexTok, bool possible = true);
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,7 @@ struct LifetimeToken {
|
||||||
const Token *parseCompareInt(const Token *tok, ValueFlow::Value &true_value, ValueFlow::Value &false_value, const std::function<std::vector<MathLib::bigint>(const Token*)>& evaluate);
|
const Token *parseCompareInt(const Token *tok, ValueFlow::Value &true_value, ValueFlow::Value &false_value, const std::function<std::vector<MathLib::bigint>(const Token*)>& evaluate);
|
||||||
const Token *parseCompareInt(const Token *tok, ValueFlow::Value &true_value, ValueFlow::Value &false_value);
|
const Token *parseCompareInt(const Token *tok, ValueFlow::Value &true_value, ValueFlow::Value &false_value);
|
||||||
|
|
||||||
ValueFlow::Value inferCondition(std::string op, MathLib::bigint val, const Token* varTok);
|
ValueFlow::Value inferCondition(const std::string& op, MathLib::bigint val, const Token* varTok);
|
||||||
ValueFlow::Value inferCondition(const std::string& op, const Token* varTok, MathLib::bigint val);
|
ValueFlow::Value inferCondition(const std::string& op, const Token* varTok, MathLib::bigint val);
|
||||||
|
|
||||||
CPPCHECKLIB ValuePtr<InferModel> makeIntegralInferModel();
|
CPPCHECKLIB ValuePtr<InferModel> makeIntegralInferModel();
|
||||||
|
|
|
@ -5856,7 +5856,7 @@ private:
|
||||||
if (tok->astOperand1() && astTop.find(tok->astTop()) == astTop.end()) {
|
if (tok->astOperand1() && astTop.find(tok->astTop()) == astTop.end()) {
|
||||||
astTop.insert(tok->astTop());
|
astTop.insert(tok->astTop());
|
||||||
if (!ret.empty())
|
if (!ret.empty())
|
||||||
ret = ret + " ";
|
ret += " ";
|
||||||
ret += tok->astTop()->astString();
|
ret += tok->astTop()->astString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@ -173,7 +174,7 @@ void MainWindow::filter(const QString& filter)
|
||||||
if (allErrors[i].indexOf("test") > 0)
|
if (allErrors[i].indexOf("test") > 0)
|
||||||
allErrors.removeAt(i);
|
allErrors.removeAt(i);
|
||||||
}
|
}
|
||||||
std::random_shuffle(allErrors.begin(), allErrors.end());
|
std::shuffle(allErrors.begin(), allErrors.end(), std::mt19937(std::random_device()()));
|
||||||
ui->results->addItems(allErrors.mid(0, MAX_ERRORS));
|
ui->results->addItems(allErrors.mid(0, MAX_ERRORS));
|
||||||
ui->results->sortItems();
|
ui->results->sortItems();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue