Skip to contentSkip to conversation

target/ppc/cpu.h: Put macro parameter in parentheses

PATCH In review BALATON Zoltan 2 participants 2 messages Jan 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc/cpu.h: Put macro parameter in parentheses

Fix PPC_INPUT macro to work with more complex expressions by protecting its argument with parentheses.

---
 target/ppc/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/cpu.h +1 -1
index 8ebeaba649..e3a937e163 100644
@@ -180,7 +180,7 @@ enum {
     POWERPC_EXCP_TRAP          = 0x40,
 };
 
-#define PPC_INPUT(env) (env->bus_model)
+#define PPC_INPUT(env) ((env)->bus_model)
 
 /*****************************************************************************/
 typedef struct opc_handler_t opc_handler_t;
Signature · 1 line
2.21.1
#1 lore raw
Quoted 4 lines · BALATON Zoltan

Fix PPC_INPUT macro to work with more complex expressions by protecting its argument with parentheses.

Pretty unlikely to break anything in practice, but applied nonetheless.

Quoted 17 lines
---
 target/ppc/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/cpu.h +1 -1
index 8ebeaba649..e3a937e163 100644
@@ -180,7 +180,7 @@ enum {
     POWERPC_EXCP_TRAP          = 0x40,
 };
 
-#define PPC_INPUT(env) (env->bus_model)
+#define PPC_INPUT(env) ((env)->bus_model)
 
 /*****************************************************************************/
 typedef struct opc_handler_t opc_handler_t;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson