more boring macros removed.

This commit is contained in:
Enno Rehling 2016-11-17 21:31:11 +01:00
parent 303eb86399
commit 27605f18ba
5 changed files with 7 additions and 10 deletions

View File

@ -426,7 +426,7 @@ building *new_building(const struct building_type * btype, region * r,
bname = parameters[P_GEBAEUDE]; bname = parameters[P_GEBAEUDE];
} }
assert(bname); 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); b->name = _strdup(bname);
return b; return b;
} }

View File

@ -45,9 +45,6 @@ struct param;
bool isparam(const char *s, const struct locale * lang, param_t param); bool isparam(const char *s, const struct locale * lang, param_t param);
param_t getparam(const struct locale *lang); param_t getparam(const struct locale *lang);
#define buildingid(x) itoa36((x)->no)
#define shipid(x) itoa36((x)->no)
const char * game_name(void); const char * game_name(void);
int game_id(void); int game_id(void);
int lovar(double xpct_x2); int lovar(double xpct_x2);

View File

@ -201,7 +201,7 @@ ship *new_ship(const ship_type * stype, region * r, const struct locale *lang)
sname = parameters[P_SHIP]; sname = parameters[P_SHIP];
} }
assert(sname); 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); sh->name = _strdup(buffer);
shash(sh); shash(sh);
if (r) { if (r) {

View File

@ -1479,7 +1479,7 @@ report_template(const char *filename, report_context * ctx, const char *charset)
} }
if (wrptr(&bufp, &size, bytes) != 0) if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER(); 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) if (wrptr(&bufp, &size, bytes) != 0)
WARN_STATIC_BUFFER(); WARN_STATIC_BUFFER();
} }

View File

@ -6298,14 +6298,14 @@ int sp_q_antimagie(castorder * co)
{ {
building *b = pa->param[0]->data.b; building *b = pa->param[0]->data.b;
ap = &b->attribs; ap = &b->attribs;
ts = buildingid(b); ts = itoa36(b->no);
break; break;
} }
case SPP_SHIP: case SPP_SHIP:
{ {
ship *sh = pa->param[0]->data.sh; ship *sh = pa->param[0]->data.sh;
ap = &sh->attribs; ap = &sh->attribs;
ts = shipid(sh); ts = itoa36(sh->no);
break; break;
} }
default: default:
@ -6391,14 +6391,14 @@ int sp_break_curse(castorder * co)
{ {
building *b = pa->param[0]->data.b; building *b = pa->param[0]->data.b;
ap = &b->attribs; ap = &b->attribs;
ts = buildingid(b); ts = itoa36(b->no);
break; break;
} }
case SPP_SHIP: case SPP_SHIP:
{ {
ship *sh = pa->param[0]->data.sh; ship *sh = pa->param[0]->data.sh;
ap = &sh->attribs; ap = &sh->attribs;
ts = shipid(sh); ts = itoa36(sh->no);
break; break;
} }
default: default: