From 2f6a4bc1a92aeb4904e5e84e23fa28d0307a303c Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sun, 27 Aug 2006 10:04:33 +0000 Subject: [PATCH] (svn r6169) -Codechange: Use GetString() instead of GetStringWithArgs() which should be integral to strings.c --- misc_gui.c | 7 +++---- network_gui.c | 6 ++---- station_gui.c | 9 ++++----- strings.c | 2 +- strings.h | 1 - town_gui.c | 9 ++++----- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/misc_gui.c b/misc_gui.c index a569ab5003..4deead8994 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -105,10 +105,9 @@ static void LandInfoWndProc(Window *w, WindowEvent *e) // If the accepted value is less than 8, show it in 1/8:ths if (lid->ac[i] < 8) { - int32 argv[2]; - argv[0] = lid->ac[i]; - argv[1] = _cargoc.names_s[i]; - p = GetStringWithArgs(p, STR_01D1_8, argv); + SetDParam(0, lid->ac[i]); + SetDParam(1, _cargoc.names_s[i]); + p = GetString(p, STR_01D1_8); } else { p = GetString(p, _cargoc.names_s[i]); } diff --git a/network_gui.c b/network_gui.c index 044e4d6661..4c530cbb89 100644 --- a/network_gui.c +++ b/network_gui.c @@ -1512,11 +1512,9 @@ static const char *ChatTabCompletionNextItem(uint *item) const Town *t; FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_INFO) { - int32 temp[1]; - /* Get the town-name via the string-system */ - temp[0] = t->townnameparts; - GetStringWithArgs(chat_tab_temp_buffer, t->townnametype, temp); + SetDParam(0, t->townnameparts); + GetString(chat_tab_temp_buffer, t->townnametype); return &chat_tab_temp_buffer[0]; } } diff --git a/station_gui.c b/station_gui.c index 28d12983bb..5d76f020c2 100644 --- a/station_gui.c +++ b/station_gui.c @@ -77,16 +77,15 @@ static int CDECL StationNameSorter(const void *a, const void *b) const Station* st1 = *(const Station**)a; const Station* st2 = *(const Station**)b; char buf1[64]; - int32 argv[1]; int r; - argv[0] = st1->index; - GetStringWithArgs(buf1, STR_STATION, argv); + SetDParam(0, st1->index); + GetString(buf1, STR_STATION); if (st2 != _last_station) { _last_station = st2; - argv[0] = st2->index; - GetStringWithArgs(_bufcache, STR_STATION, argv); + SetDParam(0, st2->index); + GetString(_bufcache, STR_STATION); } r = strcmp(buf1, _bufcache); // sort by name diff --git a/strings.c b/strings.c index 3e1e9462b4..269eddc17f 100644 --- a/strings.c +++ b/strings.c @@ -168,7 +168,7 @@ static const char *GetStringPtr(StringID string) // These 8 bits will only be set when FormatString wants to print // the string in a different case. No one else except FormatString // should set those bits, therefore string CANNOT be StringID, but uint32. -char *GetStringWithArgs(char *buffr, uint string, const int32 *argv) +static char *GetStringWithArgs(char *buffr, uint string, const int32 *argv) { uint index = GB(string, 0, 11); uint tab = GB(string, 11, 5); diff --git a/strings.h b/strings.h index f984bd4802..8194fc9589 100644 --- a/strings.h +++ b/strings.h @@ -12,7 +12,6 @@ static inline char* InlineString(char* buf, uint16 string) } char *GetString(char *buffr, uint16 string); -char *GetStringWithArgs(char *buffr, uint string, const int32 *argv); extern char _userstring[128]; diff --git a/town_gui.c b/town_gui.c index cc0b0d2402..1cc5269f8c 100644 --- a/town_gui.c +++ b/town_gui.c @@ -376,18 +376,17 @@ static int CDECL TownNameSorter(const void *a, const void *b) const Town* tb = *(const Town**)b; char buf1[64]; int r; - int32 argv[1]; - argv[0] = ta->index; - GetStringWithArgs(buf1, STR_TOWN, argv); + SetDParam(0, ta->index); + GetString(buf1, STR_TOWN); /* If 'b' is the same town as in the last round, use the cached value * We do this to speed stuff up ('b' is called with the same value a lot of * times after eachother) */ if (tb != _last_town) { _last_town = tb; - argv[0] = tb->index; - GetStringWithArgs(_bufcache, STR_TOWN, argv); + SetDParam(0, tb->index); + GetString(_bufcache, STR_TOWN); } r = strcmp(buf1, _bufcache);