changeset 4840:b96b17c0f941 draft

(svn r6766) -Codechange: Move _openttd_revision[] into the functions that use it instead of global
author Darkvater <Darkvater@openttd.org>
date Fri, 13 Oct 2006 15:52:22 +0000
parents 91c33bc3c7a1
children 0b0283759d52
files network_client.c openttd.c strings.c video/sdl_v.c video/win32_v.c
diffstat 5 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/network_client.c
+++ b/network_client.c
@@ -24,8 +24,6 @@
 // This file handles all the client-commands
 
 
-extern const char _openttd_revision[];
-
 // So we don't make too much typos ;)
 #define MY_CLIENT DEREF_CLIENT(0)
 
@@ -65,6 +63,7 @@
 	//    String: Unique id to find the player back in server-listing
 	//
 
+	extern const char _openttd_revision[];
 	Packet *p;
 	_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
 	InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
--- a/openttd.c
+++ b/openttd.c
@@ -125,10 +125,9 @@
 	return mem;
 }
 
-extern const char _openttd_revision[];
-
 static void showhelp(void)
 {
+	extern const char _openttd_revision[];
 	char buf[4096], *p;
 
 	p    = buf;
--- a/strings.c
+++ b/strings.c
@@ -37,8 +37,6 @@
 
 static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei);
 
-extern const char _openttd_revision[];
-
 typedef struct LanguagePack {
 	uint32 ident;
 	uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
@@ -568,6 +566,7 @@
 
 static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei)
 {
+	extern const char _openttd_revision[];
 	byte b;
 	const int32 *argv_orig = argv;
 	uint modifier = 0;
--- a/video/sdl_v.c
+++ b/video/sdl_v.c
@@ -156,8 +156,6 @@
 	*h = _resolutions[best][1];
 }
 
-extern const char _openttd_revision[];
-
 #ifndef ICON_DIR
 #define ICON_DIR "media"
 #endif
@@ -171,6 +169,7 @@
 
 static bool CreateMainSurface(int w, int h)
 {
+	extern const char _openttd_revision[];
 	SDL_Surface *newscreen, *icon;
 	char caption[50];
 
--- a/video/win32_v.c
+++ b/video/win32_v.c
@@ -510,8 +510,6 @@
 	}
 }
 
-extern const char _openttd_revision[];
-
 static void MakeWindow(bool full_screen)
 {
 	_fullscreen = full_screen;
@@ -572,6 +570,7 @@
 			ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
 		} else {
+			extern const char _openttd_revision[];
 			char Windowtitle[50];
 
 			snprintf(Windowtitle, lengthof(Windowtitle), "OpenTTD %s", _openttd_revision);