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/saga/interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/saga') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 994b35cbf8..dd99f5854a 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1151,7 +1151,7 @@ void Interface::processStatusTextInput(Common::KeyState keystate) { if (_statusTextInputPos >= STATUS_TEXT_INPUT_MAX) { break; } - if (isalnum(keystate.ascii) || (keystate.ascii == ' ')) { + if (isAlnum(keystate.ascii) || (keystate.ascii == ' ')) { _statusTextInputString[_statusTextInputPos++] = keystate.ascii; _statusTextInputString[_statusTextInputPos] = 0; } @@ -1209,7 +1209,7 @@ bool Interface::processTextInput(Common::KeyState keystate) { _textInputPos = _textInputStringLength + 1; break; default: - if (((keystate.ascii <= 255) && (isalnum(keystate.ascii))) || (keystate.ascii == ' ') || + if (((keystate.ascii <= 255) && (isAlnum(keystate.ascii))) || (keystate.ascii == ' ') || (keystate.ascii == '-') || (keystate.ascii == '_')) { if (_textInputStringLength < save_title_size - 1) { ch[0] = keystate.ascii; -- 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/saga/interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/saga') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index dd99f5854a..a7bd7edbe5 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1151,7 +1151,7 @@ void Interface::processStatusTextInput(Common::KeyState keystate) { if (_statusTextInputPos >= STATUS_TEXT_INPUT_MAX) { break; } - if (isAlnum(keystate.ascii) || (keystate.ascii == ' ')) { + if (Common::isAlnum(keystate.ascii) || (keystate.ascii == ' ')) { _statusTextInputString[_statusTextInputPos++] = keystate.ascii; _statusTextInputString[_statusTextInputPos] = 0; } @@ -1209,7 +1209,7 @@ bool Interface::processTextInput(Common::KeyState keystate) { _textInputPos = _textInputStringLength + 1; break; default: - if (((keystate.ascii <= 255) && (isAlnum(keystate.ascii))) || (keystate.ascii == ' ') || + if (((keystate.ascii <= 255) && (Common::isAlnum(keystate.ascii))) || (keystate.ascii == ' ') || (keystate.ascii == '-') || (keystate.ascii == '_')) { if (_textInputStringLength < save_title_size - 1) { ch[0] = keystate.ascii; -- cgit v1.2.3