From 99db1f3f227caef8a7ca32df83775e5902992d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 13 Oct 2021 12:10:26 +0200 Subject: [PATCH] fixed some compiler warnings (#3502) --- lib/clangimport.cpp | 4 ---- lib/tokenize.cpp | 1 - lib/valueflow.cpp | 10 +--------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index 0a92fe03d..d4b2ee2df 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -187,10 +187,6 @@ static std::vector splitString(const std::string &line) return ret; } -static bool contains(const std::vector &haystack, const std::string &needle) -{ - return std::find(haystack.begin(), haystack.end(), needle) != haystack.end(); -} namespace clangimport { struct Data { diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 6cfcaf93c..80618dc9b 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4479,7 +4479,6 @@ void Tokenizer::createLinks2() if (isC()) return; - const Token * templateToken = nullptr; bool isStruct = false; std::stack type; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index b847ee685..80f038482 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -5965,14 +5965,6 @@ static void valueFlowSwitchVariable(TokenList *tokenlist, SymbolDatabase* symbol } } -static void setTokenValues(Token *tok, const std::list &values, const Settings *settings) -{ - for (const ValueFlow::Value &value : values) { - if (value.isIntValue()) - setTokenValue(tok, value, settings); - } -} - static std::list getFunctionArgumentValues(const Token *argtok) { std::list argvalues(argtok->values()); @@ -6517,7 +6509,7 @@ static bool isContainerSizeChanged(nonneg int varId, return false; } -std::vector getVariables(const Token* tok) +static std::vector getVariables(const Token* tok) { std::vector result; visitAstNodes(tok, [&](const Token* child) {