forked from github/server
i2b is a bullshit macro.
This commit is contained in:
parent
2f305f16d9
commit
bc5e744347
4 changed files with 5 additions and 7 deletions
|
@ -3130,7 +3130,7 @@ static void print_stats(battle * b)
|
|||
|
||||
static int weapon_weight(const weapon * w, bool missile)
|
||||
{
|
||||
if (missile == i2b(fval(w->type, WTF_MISSILE))) {
|
||||
if (missile == !!(fval(w->type, WTF_MISSILE))) {
|
||||
return w->attackskill + w->defenseskill;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -782,7 +782,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f,
|
|||
if (sf != u->faction)
|
||||
stream_printf(out, "%d;Verkleidung\n", sf->no);
|
||||
if (fval(u, UFL_ANON_FACTION))
|
||||
stream_printf(out, "%d;Parteitarnung\n", i2b(fval(u, UFL_ANON_FACTION)));
|
||||
stream_printf(out, "%d;Parteitarnung\n", (u->flags & UFL_ANON_FACTION)!=0);
|
||||
if (otherfaction && otherfaction != u->faction) {
|
||||
stream_printf(out, "%d;Anderepartei\n", otherfaction->no);
|
||||
}
|
||||
|
@ -794,7 +794,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f,
|
|||
else {
|
||||
if (fval(u, UFL_ANON_FACTION)) {
|
||||
/* faction info is hidden */
|
||||
stream_printf(out, "%d;Parteitarnung\n", i2b(fval(u, UFL_ANON_FACTION)));
|
||||
stream_printf(out, "%d;Parteitarnung\n", (u->flags & UFL_ANON_FACTION) != 0);
|
||||
}
|
||||
else {
|
||||
const attrib *a_otherfaction = a_find(u->attribs, &at_otherfaction);
|
||||
|
|
|
@ -34,8 +34,6 @@ struct param;
|
|||
#define OBJECTIDSIZE (NAMESIZE+5+IDSIZE) /* max. L<>nge der Strings, die
|
||||
* von struct unitname, etc. zur<EFBFBD>ckgegeben werden. ohne die 0 */
|
||||
|
||||
#define i2b(i) ((bool)((i)?(true):(false)))
|
||||
|
||||
#define fval(u, i) ((u)->flags & (i))
|
||||
#define fset(u, i) ((u)->flags |= (i))
|
||||
#define freset(u, i) ((u)->flags &= ~(i))
|
||||
|
|
|
@ -347,7 +347,7 @@ attrib_type at_mage = {
|
|||
|
||||
bool is_mage(const unit * u)
|
||||
{
|
||||
return i2b(get_mage(u) != NULL);
|
||||
return get_mage(u) != NULL;
|
||||
}
|
||||
|
||||
sc_mage *get_mage(const unit * u)
|
||||
|
@ -2167,7 +2167,7 @@ typedef struct familiar_data {
|
|||
bool is_familiar(const unit * u)
|
||||
{
|
||||
attrib *a = a_find(u->attribs, &at_familiarmage);
|
||||
return i2b(a != NULL);
|
||||
return a != NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue