From a8db00b4bff5d7523df025f1ab1c7818b2739f80 Mon Sep 17 00:00:00 2001 From: amai2012 Date: Tue, 16 Jun 2015 22:45:33 +0200 Subject: [PATCH] Repair test which had to be adjusted after previous changeset. Refactoring: Add some const --- lib/checkunusedvar.cpp | 14 +++++++------- test/testtokenize.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index 3abdf299e..7f4745a2e 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -162,7 +162,7 @@ void Variables::alias(unsigned int varid1, unsigned int varid2, bool replace) if (replace) { // remove var1 from all aliases - for (std::set::iterator i = var1->_aliases.begin(); i != var1->_aliases.end(); ++i) { + for (std::set::const_iterator i = var1->_aliases.begin(); i != var1->_aliases.end(); ++i) { VariableUsage *temp = find(*i); if (temp) @@ -174,7 +174,7 @@ void Variables::alias(unsigned int varid1, unsigned int varid2, bool replace) } // var1 gets all var2s aliases - for (std::set::iterator i = var2->_aliases.begin(); i != var2->_aliases.end(); ++i) { + for (std::set::const_iterator i = var2->_aliases.begin(); i != var2->_aliases.end(); ++i) { if (*i != varid1) var1->_aliases.insert(*i); } @@ -195,7 +195,7 @@ void Variables::clearAliases(unsigned int varid) if (usage) { // remove usage from all aliases - std::set::iterator i; + std::set::const_iterator i; for (i = usage->_aliases.begin(); i != usage->_aliases.end(); ++i) { VariableUsage *temp = find(*i); @@ -214,7 +214,7 @@ void Variables::eraseAliases(unsigned int varid) VariableUsage *usage = find(varid); if (usage) { - std::set::iterator aliases; + std::set::const_iterator aliases; for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) erase(*aliases); @@ -301,7 +301,7 @@ void Variables::writeAliases(unsigned int varid, const Token* tok) VariableUsage *usage = find(varid); if (usage) { - std::set::iterator aliases; + std::set::const_iterator aliases; for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) { VariableUsage *aliased = find(*aliases); @@ -328,7 +328,7 @@ void Variables::use(unsigned int varid, const Token* tok) usage->use(_varReadInScope); usage->_lastAccess = tok; - std::set::iterator aliases; + std::set::const_iterator aliases; for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) { VariableUsage *aliased = find(*aliases); @@ -349,7 +349,7 @@ void Variables::modified(unsigned int varid, const Token* tok) usage->_modified = true; usage->_lastAccess = tok; - std::set::iterator aliases; + std::set::const_iterator aliases; for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) { VariableUsage *aliased = find(*aliases); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 6069880b6..8c624a617 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -5868,11 +5868,11 @@ private: void borland() { // __closure ASSERT_EQUALS("int * a ;", - tokenizeAndStringify("int (__closure *a)();", false)); + tokenizeAndStringify("int (__closure *a)();", false, true, Settings::Win32A)); // __property ASSERT_EQUALS("class Fred { ; __property ; } ;", - tokenizeAndStringify("class Fred { __property int x = { } };", false)); + tokenizeAndStringify("class Fred { __property int x = { } };", false, true, Settings::Win32A)); } void Qt() {