diff options
author | Willem Jan Palenstijn | 2012-02-21 11:33:32 -0800 |
---|---|---|
committer | Willem Jan Palenstijn | 2012-02-21 11:33:32 -0800 |
commit | 9ffe3e11d905b5af194dd3265e2fe11545bf5020 (patch) | |
tree | f9fb97d7eb2368d0123aa3bd9d91c560cded3315 /engines/sci | |
parent | 80b34398174973b6d70673fce94a8a1f670c3f4d (diff) | |
parent | 02ebd552141173775b9462f4414083d3b8d49a80 (diff) | |
download | scummvm-rg350-9ffe3e11d905b5af194dd3265e2fe11545bf5020.tar.gz scummvm-rg350-9ffe3e11d905b5af194dd3265e2fe11545bf5020.tar.bz2 scummvm-rg350-9ffe3e11d905b5af194dd3265e2fe11545bf5020.zip |
Merge pull request #182 from fingolfin/forbid-ctype
ALL: Avoid using is* macros from ctype.h
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/text16.cpp | 2 | ||||
-rw-r--r-- | engines/sci/parser/vocabulary.cpp | 2 | ||||
-rw-r--r-- | engines/sci/resource.cpp | 4 | ||||
-rw-r--r-- | engines/sci/resource_audio.cpp | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index a1cd571e89..fe8d631497 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -147,7 +147,7 @@ reg_t kReadNumber(EngineState *s, int argc, reg_t *argv) { Common::String source_str = s->_segMan->getString(argv[0]); const char *source = source_str.c_str(); - while (isspace((unsigned char)*source)) + while (Common::isSpace(*source)) source++; /* Skip whitespace */ int16 result = 0; @@ -246,14 +246,14 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { /* int writelength; -- unused atm */ - if (xfer && (isdigit(static_cast<unsigned char>(xfer)) || xfer == '-' || xfer == '=')) { + if (xfer && (Common::isDigit(xfer) || xfer == '-' || xfer == '=')) { char *destp; if (xfer == '0') fillchar = '0'; else if (xfer == '=') align = ALIGN_CENTER; - else if (isdigit(static_cast<unsigned char>(xfer)) || (xfer == '-')) + else if (Common::isDigit(xfer) || (xfer == '-')) source--; // Go to start of length argument strLength = strtol(source, &destp, 10); diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 84547d9828..7eaa0168b8 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -100,7 +100,7 @@ int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int1 // cX -> sets textColor to _textColors[X-1] curCode = textCode[0]; curCodeParm = textCode[1]; - if (isdigit(static_cast<unsigned char>(curCodeParm))) { + if (Common::isDigit(curCodeParm)) { curCodeParm -= '0'; } else { curCodeParm = -1; diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index a5c4686b3b..e56158ecc1 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -534,7 +534,7 @@ bool Vocabulary::tokenizeString(ResultWordListList &retval, const char *sentence do { c = sentence[pos_in_sentence++]; - if (isalnum(c) || (c == '-' && wordLen) || (c >= 0x80)) { + if (Common::isAlnum(c) || (c == '-' && wordLen) || (c >= 0x80)) { currentWord[wordLen] = lowerCaseMap[c]; ++wordLen; } diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 41062eb19b..50b3387159 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1558,7 +1558,7 @@ void ResourceManager::readResourcePatches() { name = (*x)->getName(); // SCI1 scheme - if (isdigit(static_cast<unsigned char>(name[0]))) { + if (Common::isDigit(name[0])) { char *end = 0; resourceNr = strtol(name.c_str(), &end, 10); bAdd = (*end == '.'); // Ensure the next character is the period @@ -1566,7 +1566,7 @@ void ResourceManager::readResourcePatches() { // SCI0 scheme int resname_len = strlen(szResType); if (scumm_strnicmp(name.c_str(), szResType, resname_len) == 0 - && !isalpha(static_cast<unsigned char>(name[resname_len + 1]))) { + && !Common::isAlpha(name[resname_len + 1])) { resourceNr = atoi(name.c_str() + resname_len + 1); bAdd = true; } diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 764f4785b7..684e1a1d0d 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -198,7 +198,7 @@ void ResourceManager::readWaveAudioPatches() { for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) { Common::String name = (*x)->getName(); - if (isdigit(static_cast<unsigned char>(name[0]))) + if (Common::isDigit(name[0])) processWavePatch(ResourceId(kResourceTypeAudio, atoi(name.c_str())), name); } } |