aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-02-26 22:45:03 +0100
committerWillem Jan Palenstijn2017-02-26 22:45:03 +0100
commita8cbc03acced1c382113825b1708c93edb61d28f (patch)
treed2b15b7c2c40f1ab0bcc4270044744c4434dcb9c
parent2168ac1ef067ca1107d65b3137948ac2365d2014 (diff)
downloadscummvm-rg350-a8cbc03acced1c382113825b1708c93edb61d28f.tar.gz
scummvm-rg350-a8cbc03acced1c382113825b1708c93edb61d28f.tar.bz2
scummvm-rg350-a8cbc03acced1c382113825b1708c93edb61d28f.zip
CRYO: Improve macro safety
-rw-r--r--engines/cryo/eden.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index ead31315fd..84b976a7aa 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -6544,8 +6544,8 @@ void EdenGame::loadgame(char *name) {
}
#define NULLPTR 0xFFFFFF
-#define IDXOUT(val, base, typ, idx) if (val) (idx) = ((byte*)val - (byte*)base) / sizeof(typ); else (idx) = NULLPTR;
-#define OFSIN(val, base, typ) if ((void*)(val) != NULLPTR) (val) = (typ*)((char*)(val) + (size_t)(base)); else (val) = 0;
+#define IDXOUT(val, base, typ, idx) do { if (val) (idx) = ((byte*)val - (byte*)base) / sizeof(typ); else (idx) = NULLPTR; } while (false)
+#define OFSIN(val, base, typ) do { if ((void*)(val) != NULLPTR) (val) = (typ*)((char*)(val) + (size_t)(base)); else (val) = 0; } while (false)
void EdenGame::syncGlobalPointers(Common::Serializer s) {
uint32 dialogIdx, nextDialogIdx, narratorDialogIdx, lastDialogIdx, tapeIdx, nextRoomIconIdx, roomIdx;