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/scumm/string.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/scumm/string.cpp') diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 61bb89328d..8a689fffa9 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1389,10 +1389,10 @@ void ScummEngine_v7::loadLanguageBundle() { } else if (*ptr == '#') { // Number of subtags following a given basetag. We don't need that // information so we just skip it - } else if (isdigit(static_cast(*ptr))) { + } else if (isDigit(*ptr)) { int idx = 0; // A number (up to three digits)... - while (isdigit(static_cast(*ptr))) { + while (isDigit(*ptr)) { idx = idx * 10 + (*ptr - '0'); ptr++; } @@ -1430,12 +1430,12 @@ void ScummEngine_v7::loadLanguageBundle() { for (i = 0; i < _languageIndexSize; i++) { // First 8 chars in the line give the string ID / 'tag' int j; - for (j = 0; j < 8 && !isspace(static_cast(*ptr)); j++, ptr++) + for (j = 0; j < 8 && !isSpace(*ptr); j++, ptr++) _languageIndex[i].tag[j] = toupper(*ptr); _languageIndex[i].tag[j] = 0; // After that follows a single space which we skip - assert(isspace(static_cast(*ptr))); + assert(isSpace(*ptr)); ptr++; // Then comes the translated string: we record an offset to that. -- cgit v1.2.3 From 4f8665fc836898ebf54fc73b1061125b748183bc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 20 Feb 2012 16:03:39 +0100 Subject: COMMON: Move isFoo functions to namespace Common, add doxygen comments --- engines/scumm/string.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/scumm/string.cpp') diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 8a689fffa9..bcb45e2e92 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1389,10 +1389,10 @@ void ScummEngine_v7::loadLanguageBundle() { } else if (*ptr == '#') { // Number of subtags following a given basetag. We don't need that // information so we just skip it - } else if (isDigit(*ptr)) { + } else if (Common::isDigit(*ptr)) { int idx = 0; // A number (up to three digits)... - while (isDigit(*ptr)) { + while (Common::isDigit(*ptr)) { idx = idx * 10 + (*ptr - '0'); ptr++; } @@ -1430,12 +1430,12 @@ void ScummEngine_v7::loadLanguageBundle() { for (i = 0; i < _languageIndexSize; i++) { // First 8 chars in the line give the string ID / 'tag' int j; - for (j = 0; j < 8 && !isSpace(*ptr); j++, ptr++) + for (j = 0; j < 8 && !Common::isSpace(*ptr); j++, ptr++) _languageIndex[i].tag[j] = toupper(*ptr); _languageIndex[i].tag[j] = 0; // After that follows a single space which we skip - assert(isSpace(*ptr)); + assert(Common::isSpace(*ptr)); ptr++; // Then comes the translated string: we record an offset to that. -- cgit v1.2.3