]> git.pond.sub.org Git - empserver/commitdiff
(trade_desc, get_materials): Use i_type variable instead of int for
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jul 2005 16:53:06 +0000 (16:53 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jul 2005 16:53:06 +0000 (16:53 +0000)
iterating over item types.

src/lib/subs/trdsub.c
src/lib/update/material.c

index eaf98a0ef1276ef5289a546370185d5fca2e924b..c7143c4f23679ddea1d2a000df0d54ca062aab86 100644 (file)
@@ -97,6 +97,7 @@ int
 trade_desc(struct trdstr *tp, union trdgenstr *tgp)
 {
     int i;
+    i_type it;
     struct sctstr sect;
     struct nukstr *np;
     struct shpstr *sp;
@@ -132,9 +133,9 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
        pr("(%3d)  tech %d %d%% %s [",
           tp->trd_owner, sp->shp_tech, sp->shp_effic, prship(sp));
 
-       for (i = I_NONE + 1; i <= I_MAX; ++i) {
-           if (sp->shp_item[i])
-               pr("%c:%d ", ichr[i].i_mnem, sp->shp_item[i]);
+       for (it = I_NONE + 1; it <= I_MAX; ++it) {
+           if (sp->shp_item[it])
+               pr("%c:%d ", ichr[it].i_mnem, sp->shp_item[it]);
        }
        pr("] #%d", tp->trd_unitid);
        if (opt_SHOWPLANE) {
@@ -190,9 +191,9 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
        pr("(%3d)  tech %d %d%% %s [",
           tp->trd_owner,
           lp->lnd_tech, lp->lnd_effic, lchr[(int)lp->lnd_type].l_name);
-       for (i = I_NONE + 1; i <= I_MAX; ++i) {
-           if (lp->lnd_item[i])
-               pr("%c:%d ", ichr[i].i_mnem, lp->lnd_item[i]);
+       for (it = I_NONE + 1; it <= I_MAX; ++it) {
+           if (lp->lnd_item[it])
+               pr("%c:%d ", ichr[it].i_mnem, lp->lnd_item[it]);
        }
        pr("] #%d", tp->trd_unitid);
        if (opt_SHOWPLANE) {
index ec98453f141f6b7ff043a86f1ab3a610f4bec305..5aedfd3b6ae7443741871867dd8163189acff62b 100644 (file)
@@ -47,7 +47,7 @@ void
 get_materials(struct sctstr *sp, int *bp, int *mvec, int check)
               /* only check if found=0, remove them=1 */
 {
-    int i;
+    i_type i;
     int still_left;
 
     for (i = I_NONE + 1; i <= I_MAX; i++) {