diff --git a/Makefile b/Makefile index e4b8ffa2e..62f2a955d 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,10 @@ ifdef COMSPEC ifndef CPPCHK_GLIBCXX_DEBUG CPPCHK_GLIBCXX_DEBUG= endif # !CPPCHK_GLIBCXX_DEBUG + + ifeq ($(MSYSTEM),MINGW32) + LDFLAGS=-lshlwapi + endif else # !COMSPEC uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 3fb2b226c..3b9580446 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2945,11 +2945,9 @@ namespace { class Expressions { public: - Expressions(const SymbolDatabase *symbolDatabase, const - std::list &constFunctions) + Expressions(const std::list &constFunctions) : _start(0), _lastTokens(0), - _symbolDatabase(symbolDatabase), _constFunctions(constFunctions) { } void endExpr(const Token *end) { @@ -2989,7 +2987,6 @@ namespace { std::ostringstream _expression; const Token *_start; ExpressionTokens *_lastTokens; - const SymbolDatabase *_symbolDatabase; const std::list &_constFunctions; }; @@ -3030,7 +3027,7 @@ void CheckOther::checkExpressionRange(const std::list &constFun { if (!start || !end) return; - Expressions expressions(_tokenizer->getSymbolDatabase(), constFunctions); + Expressions expressions(constFunctions); std::string opName; int level = 0; for (const Token *tok = start->next(); tok && tok != end; tok = tok->next()) { diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index dee14bf07..c422b84a1 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1959,7 +1959,8 @@ bool Tokenizer::tokenize(std::istream &code, // Remove redundant parentheses simplifyRedundantParentheses(); for (Token *tok = list.front(); tok; tok = tok->next()) - while (TemplateSimplifier::simplifyNumericCalculations(tok)); + while (TemplateSimplifier::simplifyNumericCalculations(tok)) + ; // Handle templates.. simplifyTemplates(); @@ -2171,7 +2172,8 @@ bool Tokenizer::tokenizeCondition(const std::string &code) for (Token *tok = list.front(); tok; tok = tok->next()) - while (TemplateSimplifier::simplifyNumericCalculations(tok)); + while (TemplateSimplifier::simplifyNumericCalculations(tok)) + ; while (simplifyLogicalOperators()) { } diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 1d9d35d02..dbf2a4647 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -253,6 +253,10 @@ int main(int argc, char **argv) << " ifndef CPPCHK_GLIBCXX_DEBUG\n" << " CPPCHK_GLIBCXX_DEBUG=\n" << " endif # !CPPCHK_GLIBCXX_DEBUG\n" + << "\n" + << " ifeq ($(MSYSTEM),MINGW32)\n" + << " LDFLAGS=-lshlwapi\n" + << " endif\n" << "else # !COMSPEC\n" << " uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n" << "\n" @@ -351,7 +355,7 @@ int main(int argc, char **argv) fout << "check:\tall\n"; fout << "\t./testrunner -g -q\n\n"; fout << "dmake:\ttools/dmake.cpp\n"; - fout << "\t$(CXX) -o dmake tools/dmake.cpp cli/filelister.cpp lib/path.cpp -Ilib\n\n"; + fout << "\t$(CXX) -o dmake tools/dmake.cpp cli/filelister.cpp lib/path.cpp -Ilib $(LDFLAGS)\n\n"; fout << "reduce:\ttools/reduce.cpp\n"; fout << "\t$(CXX) -g -o reduce tools/reduce.cpp -Ilib lib/*.cpp\n\n"; fout << "clean:\n";