(trade_desc, get_materials): Use i_type variable instead of int for

iterating over item types.
This commit is contained in:
Markus Armbruster 2005-07-23 16:53:06 +00:00
parent 022685c47c
commit e15b7e2b9a
2 changed files with 8 additions and 7 deletions

View file

@ -97,6 +97,7 @@ int
trade_desc(struct trdstr *tp, union trdgenstr *tgp) trade_desc(struct trdstr *tp, union trdgenstr *tgp)
{ {
int i; int i;
i_type it;
struct sctstr sect; struct sctstr sect;
struct nukstr *np; struct nukstr *np;
struct shpstr *sp; struct shpstr *sp;
@ -132,9 +133,9 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
pr("(%3d) tech %d %d%% %s [", pr("(%3d) tech %d %d%% %s [",
tp->trd_owner, sp->shp_tech, sp->shp_effic, prship(sp)); tp->trd_owner, sp->shp_tech, sp->shp_effic, prship(sp));
for (i = I_NONE + 1; i <= I_MAX; ++i) { for (it = I_NONE + 1; it <= I_MAX; ++it) {
if (sp->shp_item[i]) if (sp->shp_item[it])
pr("%c:%d ", ichr[i].i_mnem, sp->shp_item[i]); pr("%c:%d ", ichr[it].i_mnem, sp->shp_item[it]);
} }
pr("] #%d", tp->trd_unitid); pr("] #%d", tp->trd_unitid);
if (opt_SHOWPLANE) { if (opt_SHOWPLANE) {
@ -190,9 +191,9 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
pr("(%3d) tech %d %d%% %s [", pr("(%3d) tech %d %d%% %s [",
tp->trd_owner, tp->trd_owner,
lp->lnd_tech, lp->lnd_effic, lchr[(int)lp->lnd_type].l_name); lp->lnd_tech, lp->lnd_effic, lchr[(int)lp->lnd_type].l_name);
for (i = I_NONE + 1; i <= I_MAX; ++i) { for (it = I_NONE + 1; it <= I_MAX; ++it) {
if (lp->lnd_item[i]) if (lp->lnd_item[it])
pr("%c:%d ", ichr[i].i_mnem, lp->lnd_item[i]); pr("%c:%d ", ichr[it].i_mnem, lp->lnd_item[it]);
} }
pr("] #%d", tp->trd_unitid); pr("] #%d", tp->trd_unitid);
if (opt_SHOWPLANE) { if (opt_SHOWPLANE) {

View file

@ -47,7 +47,7 @@ void
get_materials(struct sctstr *sp, int *bp, int *mvec, int check) get_materials(struct sctstr *sp, int *bp, int *mvec, int check)
/* only check if found=0, remove them=1 */ /* only check if found=0, remove them=1 */
{ {
int i; i_type i;
int still_left; int still_left;
for (i = I_NONE + 1; i <= I_MAX; i++) { for (i = I_NONE + 1; i <= I_MAX; i++) {