diff options
| author | Max Horn | 2012-01-28 01:15:49 +0100 |
|---|---|---|
| committer | Max Horn | 2012-02-15 16:51:37 +0100 |
| commit | 658080deeda79d20ea40643569fbcb072573e7cf (patch) | |
| tree | d604bf668909a6db44a1ec83e7c51088a5d85592 /engines/scumm | |
| parent | 37e5b209a71af725456a42be2605dea28ffceb84 (diff) | |
| download | scummvm-rg350-658080deeda79d20ea40643569fbcb072573e7cf.tar.gz scummvm-rg350-658080deeda79d20ea40643569fbcb072573e7cf.tar.bz2 scummvm-rg350-658080deeda79d20ea40643569fbcb072573e7cf.zip | |
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.
Diffstat (limited to 'engines/scumm')
| -rw-r--r-- | engines/scumm/smush/smush_player.cpp | 4 | ||||
| -rw-r--r-- | engines/scumm/string.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 2f4e86bf61..36de5e470b 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -90,13 +90,13 @@ public: assert(def_end != NULL); char *id_end = def_end; - while (id_end >= def_start && !isdigit(static_cast<unsigned char>(*(id_end-1)))) { + while (id_end >= def_start && !isDigit(*(id_end-1))) { id_end--; } assert(id_end > def_start); char *id_start = id_end; - while (isdigit(static_cast<unsigned char>(*(id_start - 1)))) { + while (isDigit(*(id_start - 1))) { id_start--; } 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<unsigned char>(*ptr))) { + } else if (isDigit(*ptr)) { int idx = 0; // A number (up to three digits)... - while (isdigit(static_cast<unsigned char>(*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<unsigned char>(*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<unsigned char>(*ptr))); + assert(isSpace(*ptr)); ptr++; // Then comes the translated string: we record an offset to that. |
