From 1637e867dedd3bfabc8e87055fb36968741e37cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 8 Feb 2009 18:34:04 +0000 Subject: [PATCH] mismatching allocation size: moved to error suite --- src/errormessage.h | 6 +++--- test/testmemleak.cpp | 2 +- tools/errmsg.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/errormessage.h b/src/errormessage.h index 9d4720590..4fae30132 100644 --- a/src/errormessage.h +++ b/src/errormessage.h @@ -190,11 +190,11 @@ public: static void mismatchSize(ErrorLogger *logger, const Tokenizer *tokenizer, const Token *Location, const std::string &sz) { - _writemsg(logger, tokenizer, Location, "all", "The given size " + sz + " is mismatching", "mismatchSize"); + _writemsg(logger, tokenizer, Location, "error", "The given size " + sz + " is mismatching", "mismatchSize"); } - static bool mismatchSize(const Settings &s) + static bool mismatchSize() { - return s._showAll; + return true; } static void cstyleCast(ErrorLogger *logger, const Tokenizer *tokenizer, const Token *Location) diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index aab169db0..d4a21cd81 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -1823,7 +1823,7 @@ private: " int *p = malloc(3);\n" " free(p);\n" "}\n", false); - ASSERT_EQUALS(std::string("[test.cpp:3]: (all) The given size 3 is mismatching\n"), errout.str()); + ASSERT_EQUALS(std::string("[test.cpp:3]: (error) The given size 3 is mismatching\n"), errout.str()); } diff --git a/tools/errmsg.cpp b/tools/errmsg.cpp index dbc96598b..6f22aad09 100644 --- a/tools/errmsg.cpp +++ b/tools/errmsg.cpp @@ -81,7 +81,7 @@ int main() err.push_back(Message("resourceLeak", Message::error, "Resource leak: %1", "varname")); err.push_back(Message("deallocDealloc", Message::error, "Deallocating a deallocated pointer: %1", "varname")); err.push_back(Message("deallocuse", Message::error, "Using '%1' after it is deallocated / released", "varname")); - err.push_back(Message("mismatchSize", Message::all, "The given size %1 is mismatching", "sz")); + err.push_back(Message("mismatchSize", Message::error, "The given size %1 is mismatching", "sz")); // checkother.cpp.. err.push_back(Message("cstyleCast", Message::style, "C-style pointer casting"));