From d8a4383f5fea56e964d9c54fa5b3f3c834b36397 Mon Sep 17 00:00:00 2001 From: Greg Hewgill Date: Wed, 27 Apr 2011 21:13:05 +1200 Subject: [PATCH] Use tolowerWrapper wherever appropriate --- lib/preprocessor.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 949b0691d..de87dd825 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -304,10 +304,18 @@ static bool hasbom(const std::string &str) } +// This wrapper exists because Sun's CC does not allow a static_cast +// from extern "C" int(*)(int) to int(*)(int). +static int tolowerWrapper(int c) +{ + return std::tolower(c); +} + + static bool isFallThroughComment(std::string comment) { // convert comment to lower case without whitespace - std::transform(comment.begin(), comment.end(), comment.begin(), ::tolower); + std::transform(comment.begin(), comment.end(), comment.begin(), tolowerWrapper); for (std::string::iterator i = comment.begin(); i != comment.end();) { if (::isspace(static_cast(*i))) @@ -1821,14 +1829,6 @@ Preprocessor::HeaderTypes Preprocessor::getHeaderFileName(std::string &str) } -// This wrapper exists because Sun's CC does not allow a static_cast -// from extern "C" int(*)(int) to int(*)(int). -static int tolowerWrapper(int c) -{ - return std::tolower(c); -} - - void Preprocessor::handleIncludes(std::string &code, const std::string &filePath, const std::list &includePaths) { std::list paths;