(svn r6169) -Codechange: Use GetString() instead of GetStringWithArgs() which should be
authorDarkvater
Sun, 27 Aug 2006 10:04:33 +0000
changeset 4416 442b18840569
parent 4415 720570b96364
child 4417 df176ef5fa73
(svn r6169) -Codechange: Use GetString() instead of GetStringWithArgs() which should be
integral to strings.c
misc_gui.c
network_gui.c
station_gui.c
strings.c
strings.h
town_gui.c
--- a/misc_gui.c	Sun Aug 27 10:04:02 2006 +0000
+++ b/misc_gui.c	Sun Aug 27 10:04:33 2006 +0000
@@ -105,10 +105,9 @@
 
 					// 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]);
 					}
--- a/network_gui.c	Sun Aug 27 10:04:02 2006 +0000
+++ b/network_gui.c	Sun Aug 27 10:04:33 2006 +0000
@@ -1512,11 +1512,9 @@
 		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];
 		}
 	}
--- a/station_gui.c	Sun Aug 27 10:04:02 2006 +0000
+++ b/station_gui.c	Sun Aug 27 10:04:33 2006 +0000
@@ -77,16 +77,15 @@
 	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
--- a/strings.c	Sun Aug 27 10:04:02 2006 +0000
+++ b/strings.c	Sun Aug 27 10:04:33 2006 +0000
@@ -168,7 +168,7 @@
 // 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);
--- a/strings.h	Sun Aug 27 10:04:02 2006 +0000
+++ b/strings.h	Sun Aug 27 10:04:33 2006 +0000
@@ -12,7 +12,6 @@
 }
 
 char *GetString(char *buffr, uint16 string);
-char *GetStringWithArgs(char *buffr, uint string, const int32 *argv);
 
 extern char _userstring[128];
 
--- a/town_gui.c	Sun Aug 27 10:04:02 2006 +0000
+++ b/town_gui.c	Sun Aug 27 10:04:33 2006 +0000
@@ -376,18 +376,17 @@
 	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);