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/sky/control.cpp | 2 +- engines/sky/detection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sky') diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index a40e77d1cb..6363789d3a 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -974,7 +974,7 @@ void Control::handleKeyPress(Common::KeyState kbd, Common::String &textBuf) { // Allow the key only if is a letter, a digit, or one of a selected // list of extra characters - if (isalnum(kbd.ascii) || strchr(" ,().='-&+!?\"", kbd.ascii) != 0) { + if (isAlnum(kbd.ascii) || strchr(" ,().='-&+!?\"", kbd.ascii) != 0) { textBuf += kbd.ascii; } } diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index a078200edd..51f7330f09 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -206,7 +206,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const { // Extract the extension Common::String ext = file->c_str() + file->size() - 3; ext.toUppercase(); - if (isdigit(static_cast(ext[0])) && isdigit(static_cast(ext[1])) && isdigit(static_cast(ext[2]))){ + if (isDigit(ext[0]) && isDigit(ext[1]) && isDigit(ext[2])) { int slotNum = atoi(ext.c_str()); Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { -- 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/sky/control.cpp | 2 +- engines/sky/detection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sky') diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index 6363789d3a..036659a677 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -974,7 +974,7 @@ void Control::handleKeyPress(Common::KeyState kbd, Common::String &textBuf) { // Allow the key only if is a letter, a digit, or one of a selected // list of extra characters - if (isAlnum(kbd.ascii) || strchr(" ,().='-&+!?\"", kbd.ascii) != 0) { + if (Common::isAlnum(kbd.ascii) || strchr(" ,().='-&+!?\"", kbd.ascii) != 0) { textBuf += kbd.ascii; } } diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index 51f7330f09..2b702e99ea 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -206,7 +206,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const { // Extract the extension Common::String ext = file->c_str() + file->size() - 3; ext.toUppercase(); - if (isDigit(ext[0]) && isDigit(ext[1]) && isDigit(ext[2])) { + if (Common::isDigit(ext[0]) && Common::isDigit(ext[1]) && Common::isDigit(ext[2])) { int slotNum = atoi(ext.c_str()); Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { -- cgit v1.2.3