aboutsummaryrefslogtreecommitdiff
path: root/common/config-manager.cpp
diff options
context:
space:
mode:
authorMax Horn2012-01-28 01:15:49 +0100
committerMax Horn2012-02-15 16:51:37 +0100
commit658080deeda79d20ea40643569fbcb072573e7cf (patch)
treed604bf668909a6db44a1ec83e7c51088a5d85592 /common/config-manager.cpp
parent37e5b209a71af725456a42be2605dea28ffceb84 (diff)
downloadscummvm-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 'common/config-manager.cpp')
-rw-r--r--common/config-manager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index c62dee8bea..d4035e8b92 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -29,7 +29,7 @@
static bool isValidDomainName(const Common::String &domName) {
const char *p = domName.c_str();
- while (*p && (isalnum(static_cast<unsigned char>(*p)) || *p == '-' || *p == '_'))
+ while (*p && (isAlnum(*p) || *p == '-' || *p == '_'))
p++;
return *p == 0;
}
@@ -187,7 +187,7 @@ void ConfigManager::loadFromStream(SeekableReadStream &stream) {
// Get the domain name, and check whether it's valid (that
// is, verify that it only consists of alphanumerics,
// dashes and underscores).
- while (*p && (isalnum(static_cast<unsigned char>(*p)) || *p == '-' || *p == '_'))
+ while (*p && (isAlnum(*p) || *p == '-' || *p == '_'))
p++;
if (*p == '\0')
@@ -205,7 +205,7 @@ void ConfigManager::loadFromStream(SeekableReadStream &stream) {
// Skip leading whitespaces
const char *t = line.c_str();
- while (isspace(static_cast<unsigned char>(*t)))
+ while (isSpace(*t))
t++;
// Skip empty lines / lines with only whitespace