Drop trade_desc()'s first argument

This commit is contained in:
Markus Armbruster 2012-07-01 13:06:23 +02:00
parent 4f3d6792e3
commit 6c086a8110
3 changed files with 9 additions and 9 deletions

View file

@ -59,7 +59,7 @@ struct trdstr {
extern int trade_check_ok(struct trdstr *, struct empobj *); extern int trade_check_ok(struct trdstr *, struct empobj *);
extern char *trade_nameof(struct trdstr *, struct empobj *); extern char *trade_nameof(struct trdstr *, struct empobj *);
extern int trade_desc(struct trdstr *, struct empobj *); extern int trade_desc(struct empobj *);
extern int trade_getitem(struct trdstr *, union empobj_storage *); extern int trade_getitem(struct trdstr *, union empobj_storage *);
#define gettrade(n, p) ef_read(EF_TRADE, (n), (p)) #define gettrade(n, p) ef_read(EF_TRADE, (n), (p))

View file

@ -103,7 +103,7 @@ trad(void)
tleft = 0.0; tleft = 0.0;
pr("$%7ld %2d %5.2f hrs ", pr("$%7ld %2d %5.2f hrs ",
trade.trd_price, trade.trd_maxbidder, tleft); trade.trd_price, trade.trd_maxbidder, tleft);
trade_desc(&trade, &tg.gen); /* XXX */ trade_desc(&tg.gen); /* XXX */
pr("\n"); pr("\n");
if (trade.trd_owner == player->cnum && !player->god) if (trade.trd_owner == player->cnum && !player->god)
pr(" (your own lot)\n"); pr(" (your own lot)\n");

View file

@ -78,7 +78,7 @@ trade_nameof(struct trdstr *tp, struct empobj *tgp)
* Return 1 on success, 0 on error * Return 1 on success, 0 on error
*/ */
int int
trade_desc(struct trdstr *tp, struct empobj *tgp) trade_desc(struct empobj *tgp)
{ {
i_type it; i_type it;
struct sctstr sect; struct sctstr sect;
@ -91,12 +91,12 @@ trade_desc(struct trdstr *tp, struct empobj *tgp)
struct lndstr land; struct lndstr land;
struct nukstr nuke; struct nukstr nuke;
switch (tp->trd_type) { switch (tgp->ef_type) {
case EF_NUKE: case EF_NUKE:
np = (struct nukstr *)tgp; np = (struct nukstr *)tgp;
pr("(%3d) tech %d %d%% %s #%d", pr("(%3d) tech %d %d%% %s #%d",
np->nuk_own, np->nuk_tech, np->nuk_effic, np->nuk_own, np->nuk_tech, np->nuk_effic,
nchr[(int)np->nuk_type].n_name, tp->trd_unitid); nchr[(int)np->nuk_type].n_name, np->nuk_uid);
break; break;
case EF_SHIP: case EF_SHIP:
sp = (struct shpstr *)tgp; sp = (struct shpstr *)tgp;
@ -107,7 +107,7 @@ trade_desc(struct trdstr *tp, struct empobj *tgp)
if (sp->shp_item[it]) if (sp->shp_item[it])
pr("%c:%d ", ichr[it].i_mnem, sp->shp_item[it]); pr("%c:%d ", ichr[it].i_mnem, sp->shp_item[it]);
} }
pr("] #%d", tp->trd_unitid); pr("] #%d", sp->shp_uid);
snxtitem_cargo(&ni, EF_PLANE, EF_SHIP, sp->shp_uid); snxtitem_cargo(&ni, EF_PLANE, EF_SHIP, sp->shp_uid);
while (nxtitem(&ni, &plane)) { while (nxtitem(&ni, &plane)) {
pr("\n\t\t\t\t tech %3d %3d%% %s #%d", pr("\n\t\t\t\t tech %3d %3d%% %s #%d",
@ -152,7 +152,7 @@ trade_desc(struct trdstr *tp, struct empobj *tgp)
if (lp->lnd_item[it]) if (lp->lnd_item[it])
pr("%c:%d ", ichr[it].i_mnem, lp->lnd_item[it]); pr("%c:%d ", ichr[it].i_mnem, lp->lnd_item[it]);
} }
pr("] #%d", tp->trd_unitid); pr("] #%d", lp->lnd_uid);
break; break;
case EF_PLANE: case EF_PLANE:
pp = (struct plnstr *)tgp; pp = (struct plnstr *)tgp;
@ -160,12 +160,12 @@ trade_desc(struct trdstr *tp, struct empobj *tgp)
pp->pln_own, pp->pln_own,
pp->pln_tech, pp->pln_tech,
pp->pln_effic, pp->pln_effic,
plchr[(int)pp->pln_type].pl_name, tp->trd_unitid); plchr[(int)pp->pln_type].pl_name, pp->pln_uid);
if (getnuke(nuk_on_plane(pp), &nuke)) if (getnuke(nuk_on_plane(pp), &nuke))
pr("(%s)", nchr[nuke.nuk_type].n_name); pr("(%s)", nchr[nuke.nuk_type].n_name);
break; break;
default: default:
pr("flaky unit type %d", tp->trd_type); pr("flaky unit type %d", tgp->uid);
break; break;
} }
return 1; return 1;