From c0d009758c92215aaa0f10278cfbf5981cbb01a2 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Thu, 7 Jul 2005 21:57:15 +0000 Subject: [PATCH] (show_sect_capab, mission_pln_equip, pln_equip): Change i_type references to use I_NONE instead of zero. Zero has been invalid since item.h rev. 1.12, and was questionable style before. --- src/lib/subs/mission.c | 4 ++-- src/lib/subs/plnsub.c | 4 ++-- src/lib/subs/show.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 1a86976c0..e14e2bcdb 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -1279,7 +1279,7 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags, item[I_PETROL] -= pcp->pl_fuel; rval = 0; if (!(flags & P_F)) { - itype = 0; + itype = I_NONE; needed = 0; switch (mission) { case 's': @@ -1320,7 +1320,7 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags, default: break; } - if (rval < 0 || (itype && needed <= 0)) { + if (rval < 0 || (itype != I_NONE && needed <= 0)) { return -1; } if (item[itype] < needed && (itype == I_SHELL)) diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index 71a41eb61..50909fec4 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -599,7 +599,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission) item[I_PETROL] -= pcp->pl_fuel; rval = 0; if ((flags & P_F) == 0) { - itype = 0; + itype = I_NONE; needed = 0; switch (mission) { case 's': @@ -641,7 +641,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission) default: break; } - if (rval < 0 || (itype && needed <= 0)) { + if (rval < 0 || (itype != I_NONE && needed <= 0)) { pr("%s can't contribute to mission\n", prplane(pp)); return -1; } diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 65acb979f..6a5097a7d 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -732,7 +732,7 @@ show_sect_capab(int foo) pchr[j].p_nlmin, pchr[j].p_nllag, pchr[j].p_effic, pchr[j].p_cost, pchr[j].p_nrdep, - pchr[j].p_type ? ichr[pchr[j].p_type].i_mnem : ' '); + pchr[j].p_type != I_NONE ? ichr[pchr[j].p_type].i_mnem : ' '); pr("\n"); } -- 2.43.0