diff --git a/Makefile b/Makefile index 8208c89fa..327b1bea6 100644 --- a/Makefile +++ b/Makefile @@ -385,7 +385,7 @@ $(SRCDIR)/path.o: lib/path.cpp lib/cxx11emu.h lib/path.h lib/config.h $(SRCDIR)/preprocessor.o: lib/preprocessor.cpp lib/cxx11emu.h lib/preprocessor.h lib/config.h lib/tokenize.h lib/errorlogger.h lib/suppressions.h lib/tokenlist.h lib/token.h lib/valueflow.h lib/mathlib.h lib/path.h lib/settings.h lib/library.h lib/standards.h lib/timer.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CFG) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -std=c++0x -c -o $(SRCDIR)/preprocessor.o $(SRCDIR)/preprocessor.cpp -$(SRCDIR)/settings.o: lib/settings.cpp lib/cxx11emu.h lib/settings.h lib/config.h lib/library.h lib/mathlib.h lib/token.h lib/valueflow.h lib/suppressions.h lib/standards.h lib/timer.h lib/path.h lib/preprocessor.h +$(SRCDIR)/settings.o: lib/settings.cpp lib/cxx11emu.h lib/settings.h lib/config.h lib/library.h lib/mathlib.h lib/token.h lib/valueflow.h lib/suppressions.h lib/standards.h lib/timer.h lib/path.h lib/preprocessor.h lib/utils.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CFG) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -std=c++0x -c -o $(SRCDIR)/settings.o $(SRCDIR)/settings.cpp $(SRCDIR)/suppressions.o: lib/suppressions.cpp lib/cxx11emu.h lib/suppressions.h lib/config.h lib/settings.h lib/library.h lib/mathlib.h lib/token.h lib/valueflow.h lib/standards.h lib/timer.h lib/path.h diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 10d90e65b..7e6b571c2 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -1206,7 +1206,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::listisCPP() && Token::Match(tok, "try|throw|catch")) { addtoken(&rettail, tok, tok->str()); if (tok->strAt(1) == "(") tok = tok->next()->link(); diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 2136cfc42..cb6813c86 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -700,7 +700,7 @@ void CheckOther::checkRedundantAssignment() else if (memAssignments.find(param1->varId()) == memAssignments.end()) memAssignments[param1->varId()] = tok; else { - const std::map::iterator it = memAssignments.find(param1->varId()); + const std::map::const_iterator it = memAssignments.find(param1->varId()); if (printWarning && scope->type == Scope::eSwitch && Token::findmatch(it->second, "default|case", tok)) redundantCopyInSwitchError(it->second, tok, param1->str()); else if (printPerformance) @@ -843,7 +843,7 @@ void CheckOther::checkRedundantAssignmentInSwitch() else if (Token::Match(tok2->previous(), ";|{|}|: %var% = %name% %or%|& %num% ;") && tok2->varId() == tok2->tokAt(2)->varId()) { std::string bitOp = tok2->strAt(3) + tok2->strAt(4); - std::map::iterator i2 = varsWithBitsSet.find(tok2->varId()); + std::map::const_iterator i2 = varsWithBitsSet.find(tok2->varId()); // This variable has not had a bit operation performed on it yet, so just make a note of it if (i2 == varsWithBitsSet.end()) { @@ -2116,8 +2116,8 @@ void CheckOther::checkInvalidFree() tok->strAt(3) == "(" ? 4 : 1; const unsigned int var1 = tok->tokAt(varIndex)->varId(); const unsigned int var2 = tok->tokAt(varIndex + 2)->varId(); - const std::map::iterator alloc1 = allocatedVariables.find(var1); - const std::map::iterator alloc2 = allocatedVariables.find(var2); + const std::map::const_iterator alloc1 = allocatedVariables.find(var1); + const std::map::const_iterator alloc2 = allocatedVariables.find(var2); if (alloc1 != allocatedVariables.end()) { invalidFreeError(tok, alloc1->second); } else if (alloc2 != allocatedVariables.end()) {