From 85b7c1cef73a5a64e99c8e6405c8ccbd7630cf41 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Jan 2012 08:25:00 +1100 Subject: MORTEVIELLE: Add extra parenthesis to defines for operation safety --- engines/mortevielle/var_mor.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/mortevielle/var_mor.h') diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index a96329f477..89f05f121e 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -61,14 +61,14 @@ namespace Mortevielle { /*------------------------- DEFINES ----------------------------------*/ /*---------------------------------------------------------------------------*/ -#define pred(type, v) (v - 1) -#define succ(type, v) (v + 1) +#define pred(type, v) ((v) - 1) +#define succ(type, v) ((v) + 1) #define ord(v) ((int) v) #define chr(v) ((char) v) -#define lo(v) (v & 0xff) -#define hi(v) ((v >> 8) & 0xff) +#define lo(v) ((v) & 0xff) +#define hi(v) (((v) >> 8) & 0xff) #define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) -#define odd(v) ((v % 2) == 1) +#define odd(v) (((v) % 2) == 1) /*---------------------------------------------------------------------------*/ /*------------------------- CONSTANTS ----------------------------------*/ -- cgit v1.2.3