From 8445c48bada498a17c8b746ce6044f40896a89ef Mon Sep 17 00:00:00 2001 From: riccardom Date: Sun, 28 Dec 2008 16:54:54 +0000 Subject: [PATCH] Add parentheses to macro parameters where needed. --- desmume/src/MMU.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/desmume/src/MMU.h b/desmume/src/MMU.h index 49e95c638..0d32c354b 100644 --- a/desmume/src/MMU.h +++ b/desmume/src/MMU.h @@ -204,17 +204,17 @@ extern void (*_MMU_write32[2])(u32 addr, u32 val); // Use this macros for reading/writing, so the GDB stub isn't broken #ifdef GDB_STUB - #define READ32(a,b) cpu->mem_if->read32(a,b & 0xFFFFFFFC) - #define WRITE32(a,b,c) cpu->mem_if->write32(a,b & 0xFFFFFFFC,c) - #define READ16(a,b) cpu->mem_if->read16(a,b & 0xFFFFFFFE) - #define WRITE16(a,b,c) cpu->mem_if->write16(a,b & 0xFFFFFFFE,c) + #define READ32(a,b) cpu->mem_if->read32(a,(b) & 0xFFFFFFFC) + #define WRITE32(a,b,c) cpu->mem_if->write32(a,(b) & 0xFFFFFFFC,c) + #define READ16(a,b) cpu->mem_if->read16(a,(b) & 0xFFFFFFFE) + #define WRITE16(a,b,c) cpu->mem_if->write16(a,(b) & 0xFFFFFFFE,c) #define READ8(a,b) cpu->mem_if->read8(a,b) #define WRITE8(a,b,c) cpu->mem_if->write8(a,b,c) #else - #define READ32(a,b) _MMU_read32[PROCNUM](b & 0xFFFFFFFC) - #define WRITE32(a,b,c) _MMU_write32[PROCNUM](b & 0xFFFFFFFC,c) - #define READ16(a,b) _MMU_read16[PROCNUM](b & 0xFFFFFFFE) - #define WRITE16(a,b,c) _MMU_write16[PROCNUM](b & 0xFFFFFFFE,c) + #define READ32(a,b) _MMU_read32[PROCNUM]((b) & 0xFFFFFFFC) + #define WRITE32(a,b,c) _MMU_write32[PROCNUM]((b) & 0xFFFFFFFC,c) + #define READ16(a,b) _MMU_read16[PROCNUM]((b) & 0xFFFFFFFE) + #define WRITE16(a,b,c) _MMU_write16[PROCNUM]((b) & 0xFFFFFFFE,c) #define READ8(a,b) _MMU_read08[PROCNUM](b) #define WRITE8(a,b,c) _MMU_write08[PROCNUM](b, c) #endif