From b91ac429108096a3de75b9b81ca2c637b27524ba Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Jan 2015 13:30:26 +0100 Subject: replaced function inverse() by macro There was multiple problems with this function: void inverse(int *bool); First, we use "bool", which is actually a standard type, as the identifier. Then, we cannot pass different types to the function without cast. Then, inverse is not a meaninful name. At last, we have to pass the address of the variable we want to inverse. Fixed all these points by replacing the function by a macro : #define inverse_boolean(_b) /* impl */ Signed-off-by: Olivier Gayot --- magies.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'magies.c') diff --git a/magies.c b/magies.c index 93a4813..b978036 100644 --- a/magies.c +++ b/magies.c @@ -58,7 +58,7 @@ int Fmagieelement (SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[], else if(ennemis[selection].invulnerabilite[element]==ACTIVE) degats=0; else if(ennemis[selection].absorbtion[element]==ACTIVE) - inverse(&Bdegats); + inverse_boolean(Bdegats); } if(clan==ENNEMI) { @@ -107,7 +107,7 @@ int Fmagieelement (SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[], } if (*Vtourallie==2) { - inverse(Vtour); + inverse_boolean(*Vtour); *Vtourallie=0; } else @@ -221,7 +221,7 @@ int Fmagiesoin(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int if (*Vtourallie==2) { *Vtourallie=0; - inverse(Vtour); + inverse_boolean(*Vtour); } else { -- cgit v1.2.3