Use tolowerWrapper wherever appropriate

This commit is contained in:
Greg Hewgill 2011-04-27 21:13:05 +12:00
parent f0468952f8
commit d8a4383f5f
1 changed files with 9 additions and 9 deletions

View File

@ -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<unsigned char>(*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<std::string> &includePaths)
{
std::list<std::string> paths;