diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-01-07 13:30:26 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-01-07 13:30:26 +0100 |
commit | b91ac429108096a3de75b9b81ca2c637b27524ba (patch) | |
tree | c5fecc84faa6ed7fec01e7cff28f70107721e5c5 /constantes.h | |
parent | c10788083cc013fb8f93cc5a223aab205e6da15c (diff) |
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 <duskcoder@gmail.com>
Diffstat (limited to 'constantes.h')
-rw-r--r-- | constantes.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/constantes.h b/constantes.h index 24111d3..b3f9335 100644 --- a/constantes.h +++ b/constantes.h @@ -85,7 +85,7 @@ if(clan==ALLIE)\ selection=0;\ while(ennemis[selection].etat==MORT)\ selection++;\ - inverse(&clan);\ + inverse_boolean(clan);\ SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncurseurallies,surfaces->Pecran,&positions->Vpositioncurseurallies);\ Fchangercurseurennemis (surfaces,positions,selection,ennemis);\ }\ @@ -98,7 +98,7 @@ if(clan==ENNEMI)\ selection=0;\ while(persos[selection].etat==MORT)\ selection++;\ - inverse(&clan);\ + inverse_boolean(clan);\ SDL_BlitSurface(surfaces->Pfondjeu,&positions->Vpositioncurseurennemis,surfaces->Pecran,&positions->Vpositioncurseurennemis);\ Fchangercurseurpersos(surfaces,positions,selection,persos);\ }\ @@ -170,4 +170,7 @@ else\ }\ break; +#include <stdbool.h> +#define inverse_boolean(_b) ((_b) = (((_b)) ? false : true)) + #endif |