From d098b62975e8573e99746f1b8f70ae84420c2a18 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 1 Mar 2009 19:30:51 +0000 Subject: [PATCH] Use reference instead of string copy (fixes some --style warnings from our code) --- src/errorlogger.cpp | 6 +++--- src/errorlogger.h | 6 +++--- tools/errmsg.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/errorlogger.cpp b/src/errorlogger.cpp index d96700b1d..172dfeac9 100644 --- a/src/errorlogger.cpp +++ b/src/errorlogger.cpp @@ -128,14 +128,14 @@ std::string ErrorLogger::ErrorMessage::toText() const return text.str(); } -void ErrorLogger::_writemsg(const Tokenizer *tokenizer, const Token *tok, const char severity[], const std::string msg, const std::string &id) +void ErrorLogger::_writemsg(const Tokenizer *tokenizer, const Token *tok, const char severity[], const std::string &msg, const std::string &id) { std::list callstack; callstack.push_back(tok); _writemsg(tokenizer, callstack, severity, msg, id); } -void ErrorLogger::_writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string msg, const std::string &id) +void ErrorLogger::_writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string &msg, const std::string &id) { std::list locationList; for (std::list::const_iterator tok = callstack.begin(); tok != callstack.end(); ++tok) @@ -150,7 +150,7 @@ void ErrorLogger::_writemsg(const Tokenizer *tokenizer, const std::list &callStack); private: - void _writemsg(const Tokenizer *tokenizer, const Token *tok, const char severity[], const std::string msg, const std::string &id); - void _writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string msg, const std::string &id); - void _writemsg(const std::string msg, const std::string &id); + void _writemsg(const Tokenizer *tokenizer, const Token *tok, const char severity[], const std::string &msg, const std::string &id); + void _writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string &msg, const std::string &id); + void _writemsg(const std::string &msg, const std::string &id); }; #endif diff --git a/tools/errmsg.cpp b/tools/errmsg.cpp index e4b101cf6..f52a10be3 100644 --- a/tools/errmsg.cpp +++ b/tools/errmsg.cpp @@ -225,9 +225,9 @@ int main() fout << " static std::string callStackToString(const std::list &callStack);\n"; fout << "\n"; fout << "private:\n"; - fout << " void _writemsg(const Tokenizer *tokenizer, const Token *tok, const char severity[], const std::string msg, const std::string &id);\n"; - fout << " void _writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string msg, const std::string &id);\n"; - fout << " void _writemsg(const std::string msg, const std::string &id);\n"; + fout << " void _writemsg(const Tokenizer *tokenizer, const Token *tok, const char severity[], const std::string &msg, const std::string &id);\n"; + fout << " void _writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string &msg, const std::string &id);\n"; + fout << " void _writemsg(const std::string &msg, const std::string &id);\n"; fout << "};\n"; fout << "#endif\n"; std::cout << std::endl;