diff options
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/agi.cpp | 14 | ||||
-rw-r--r-- | engines/agi/wagparser.cpp | 4 |
2 files changed, 3 insertions, 15 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 4ed606c3ba..e9c9645768 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -250,19 +250,7 @@ void AgiEngine::processEvents() { // Not a special key, so get the ASCII code for it key = event.kbd.ascii; - // Function isalpha is defined in <ctype.h> so the following applies to it: - // - // The C Programming Language Standard states: - // The header <ctype.h> declares several functions useful for classifying - // and mapping characters. In all cases the argument is an int, the value - // of which shall be representable as an unsigned char or shall equal the - // value of the macro EOF. If the argument has any other value, the - // behavior is undefined. - // - // For a concrete example (e.g. in Microsoft Visual Studio 2003): - // When used with a debug CRT library, isalpha will display a CRT assert - // if passed a parameter that isn't EOF or in the range of 0 through 0xFF. - if (key >= 0 && key <= 0xFF && isalpha(key)) { + if (Common::isAlpha(key)) { // Key is A-Z. // Map Ctrl-A to 1, Ctrl-B to 2, etc. if (event.kbd.flags & Common::KBD_CTRL) { diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index 39f9e0dd92..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(static_cast<unsigned char>(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(static_cast<unsigned char>(version.getData()[i]))) + if (!Common::isDigit(version.getData()[i])) return false; // Bail out if found a non-digit after the decimal point return true; |