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/agi/wagparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/agi/wagparser.cpp') diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index 39f9e0dd92..00602420e2 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -112,11 +112,11 @@ WagFileParser::~WagFileParser() { bool WagFileParser::checkAgiVersionProperty(const WagProperty &version) const { if (version.getCode() == WagProperty::PC_INTVERSION && // Must be AGI interpreter version property version.getSize() >= 3 && // Need at least three characters for a version number like "X.Y" - isdigit(static_cast(version.getData()[0])) && // And the first character must be a digit + isDigit(version.getData()[0]) && // And the first character must be a digit (version.getData()[1] == ',' || version.getData()[1] == '.')) { // And the second a comma or a period for (int i = 2; i < version.getSize(); i++) // And the rest must all be digits - if (!isdigit(static_cast(version.getData()[i]))) + if (!isDigit(version.getData()[i])) return false; // Bail out if found a non-digit after the decimal point return true; -- 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/agi/wagparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/agi/wagparser.cpp') diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index 00602420e2..61feac5d17 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -112,11 +112,11 @@ WagFileParser::~WagFileParser() { bool WagFileParser::checkAgiVersionProperty(const WagProperty &version) const { if (version.getCode() == WagProperty::PC_INTVERSION && // Must be AGI interpreter version property version.getSize() >= 3 && // Need at least three characters for a version number like "X.Y" - isDigit(version.getData()[0]) && // And the first character must be a digit + Common::isDigit(version.getData()[0]) && // And the first character must be a digit (version.getData()[1] == ',' || version.getData()[1] == '.')) { // And the second a comma or a period for (int i = 2; i < version.getSize(); i++) // And the rest must all be digits - if (!isDigit(version.getData()[i])) + if (!Common::isDigit(version.getData()[i])) return false; // Bail out if found a non-digit after the decimal point return true; -- cgit v1.2.3