diff options
author | Willem Jan Palenstijn | 2017-02-26 22:45:03 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2017-02-26 22:45:03 +0100 |
commit | a8cbc03acced1c382113825b1708c93edb61d28f (patch) | |
tree | d2b15b7c2c40f1ab0bcc4270044744c4434dcb9c /engines/cryo | |
parent | 2168ac1ef067ca1107d65b3137948ac2365d2014 (diff) | |
download | scummvm-rg350-a8cbc03acced1c382113825b1708c93edb61d28f.tar.gz scummvm-rg350-a8cbc03acced1c382113825b1708c93edb61d28f.tar.bz2 scummvm-rg350-a8cbc03acced1c382113825b1708c93edb61d28f.zip |
CRYO: Improve macro safety
Diffstat (limited to 'engines/cryo')
-rw-r--r-- | engines/cryo/eden.cpp | 4 |
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; |