From 6697f469224a00bda5d6f6e383d71ad4a6faedbb Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 1 Oct 2009 15:33:38 +0000 Subject: Rewrote weird-looking code, which might lead to undefined behavior, according to GNU svn-id: r44523 --- engines/sci/engine/kmenu.cpp | 7 +++---- engines/sci/engine/kstring.cpp | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 18c357162c..92eefd542f 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -163,13 +163,12 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) { && item->matchKey(message, modifiers)) || ((type == SCI_EVT_SAID) /* Said event */ && (item->_flags & MENU_ATTRIBUTE_FLAGS_SAID) - && (said(s, item->_said, #ifdef DEBUG_PARSER - 1 + && (said(s, item->_said, 1) #else - 0 + && (said(s, item->_said, 0) #endif - ) != SAID_NO_MATCH) + != SAID_NO_MATCH) ) ) ) { diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 740e70ffb4..2fd0d1c715 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -103,13 +103,11 @@ reg_t kSaid(EngineState *s, int argc, reg_t *argv) { return NULL_REG; } - new_lastmatch = said(s, said_block, #ifdef DEBUG_PARSER - 1 + new_lastmatch = said(s, said_block, 1); #else - 0 + new_lastmatch = said(s, said_block, 0); #endif - ); if (new_lastmatch != SAID_NO_MATCH) { /* Build and possibly display a parse tree */ #ifdef DEBUG_PARSER -- cgit v1.2.3