From 27605f18baf4e7ed6a4451bf7f0a0e6acf08df68 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 17 Nov 2016 21:31:11 +0100 Subject: [PATCH] more boring macros removed. --- src/kernel/building.c | 2 +- src/kernel/config.h | 3 --- src/kernel/ship.c | 2 +- src/report.c | 2 +- src/spells.c | 8 ++++---- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/kernel/building.c b/src/kernel/building.c index 8789e40b2..60fd420fb 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -426,7 +426,7 @@ building *new_building(const struct building_type * btype, region * r, bname = parameters[P_GEBAEUDE]; } assert(bname); - slprintf(buffer, sizeof(buffer), "%s %s", bname, buildingid(b)); + slprintf(buffer, sizeof(buffer), "%s %s", bname, itoa36(b->no)); b->name = _strdup(bname); return b; } diff --git a/src/kernel/config.h b/src/kernel/config.h index a15a77ba4..6e1059092 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -45,9 +45,6 @@ struct param; bool isparam(const char *s, const struct locale * lang, param_t param); param_t getparam(const struct locale *lang); -#define buildingid(x) itoa36((x)->no) -#define shipid(x) itoa36((x)->no) - const char * game_name(void); int game_id(void); int lovar(double xpct_x2); diff --git a/src/kernel/ship.c b/src/kernel/ship.c index 02a980b68..d01d0a788 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -201,7 +201,7 @@ ship *new_ship(const ship_type * stype, region * r, const struct locale *lang) sname = parameters[P_SHIP]; } assert(sname); - slprintf(buffer, sizeof(buffer), "%s %s", sname, shipid(sh)); + slprintf(buffer, sizeof(buffer), "%s %s", sname, itoa36(sh->no)); sh->name = _strdup(buffer); shash(sh); if (r) { diff --git a/src/report.c b/src/report.c index 569674403..dc52c38a3 100644 --- a/src/report.c +++ b/src/report.c @@ -1479,7 +1479,7 @@ report_template(const char *filename, report_context * ctx, const char *charset) } if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); - bytes = (int)strlcpy(bufp, shipid(u->ship), size); + bytes = (int)strlcpy(bufp, itoa36(u->ship->no), size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); } diff --git a/src/spells.c b/src/spells.c index 369dab924..941b50014 100644 --- a/src/spells.c +++ b/src/spells.c @@ -6298,14 +6298,14 @@ int sp_q_antimagie(castorder * co) { building *b = pa->param[0]->data.b; ap = &b->attribs; - ts = buildingid(b); + ts = itoa36(b->no); break; } case SPP_SHIP: { ship *sh = pa->param[0]->data.sh; ap = &sh->attribs; - ts = shipid(sh); + ts = itoa36(sh->no); break; } default: @@ -6391,14 +6391,14 @@ int sp_break_curse(castorder * co) { building *b = pa->param[0]->data.b; ap = &b->attribs; - ts = buildingid(b); + ts = itoa36(b->no); break; } case SPP_SHIP: { ship *sh = pa->param[0]->data.sh; ap = &sh->attribs; - ts = shipid(sh); + ts = itoa36(sh->no); break; } default: