From 47d7ff983f23c7b54a3174bf47d17dea0c3657c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 19 Mar 2009 18:39:20 +0100 Subject: [PATCH] refactoring: removed the changes to the error handling --- src/checkstl.cpp | 12 ++---------- src/checkstl.h | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/checkstl.cpp b/src/checkstl.cpp index b761fd9db..4d1fc5c20 100644 --- a/src/checkstl.cpp +++ b/src/checkstl.cpp @@ -35,7 +35,7 @@ void CheckStl::iterators() // Same container.. if (tok->tokAt(2)->str() == tok->tokAt(10)->str()) continue; - errorIteratorUsage(tok, tok->strAt(2), tok->strAt(10)); + _errorLogger->iteratorUsage(_tokenizer, tok, tok->strAt(2), tok->strAt(10)); } // it = foo.begin(); @@ -48,7 +48,7 @@ void CheckStl::iterators() // Same container.. if (tok->tokAt(2)->str() == tok->tokAt(12)->str()) continue; - errorIteratorUsage(tok, tok->strAt(2), tok->strAt(12)); + _errorLogger->iteratorUsage(_tokenizer, tok, tok->strAt(2), tok->strAt(12)); } } } @@ -250,12 +250,4 @@ void CheckStl::pushback() } -void CheckStl::errorIteratorUsage(const Token * const tok, const char container1[], const char container2[]) -{ - ErrorLogger::ErrorMessage errmsg; - errmsg._severity = "error"; - errmsg._msg = std::string("Same iterator is used with both ") + container1 + " and " + container2; - errmsg._id = "iteratorUsage"; - _errorLogger->reportErr(errmsg); -} diff --git a/src/checkstl.h b/src/checkstl.h index ec3077e4a..c8c619a9a 100644 --- a/src/checkstl.h +++ b/src/checkstl.h @@ -76,8 +76,6 @@ private: * @param it iterator token */ void eraseCheckLoop(const Token *it); - - void errorIteratorUsage(const Token * const tok, const char container1[], const char container2[]); }; //---------------------------------------------------------------------------