From 658080deeda79d20ea40643569fbcb072573e7cf Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 28 Jan 2012 01:15:49 +0100 Subject: ALL: Avoid using is* macros from ctype.h On some systems, passing signed chars to macros like isspace() etc. lead to a runtime error. Hence, mark these macros as forbidden by default, and introduce otherwise equivalent alternatives for them. --- engines/mohawk/livingbooks_code.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/mohawk/livingbooks_code.cpp') diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 41acea19c4..b961e20f78 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -1766,7 +1766,7 @@ uint LBCode::parseCode(const Common::String &source) { { Common::String tempString; while (pos < source.size()) { - if (!isalpha(source[pos]) && !isdigit(source[pos])) + if (!isAlpha(source[pos]) && !isDigit(source[pos])) break; tempString += source[pos++]; } @@ -1777,7 +1777,7 @@ uint LBCode::parseCode(const Common::String &source) { } break; default: - if (isdigit(token)) { + if (isDigit(token)) { const char *in = source.c_str() + pos - 1; // FIXME: handle floats? char *endptr; @@ -1792,11 +1792,11 @@ uint LBCode::parseCode(const Common::String &source) { WRITE_BE_UINT16(tmp, (int16)intValue); code.push_back(tmp[0]); code.push_back(tmp[1]); - } else if (isalpha(token)) { + } else if (isAlpha(token)) { Common::String tempString; tempString += token; while (pos < source.size()) { - if (!isalpha(source[pos]) && !isdigit(source[pos])) + if (!isAlpha(source[pos]) && !isDigit(source[pos])) break; tempString += source[pos++]; } -- cgit v1.2.3