(svn r6766) -Codechange: Move _openttd_revision[] into the functions that use it instead of global
This commit is contained in:
		@@ -24,8 +24,6 @@
 | 
				
			|||||||
// This file handles all the client-commands
 | 
					// This file handles all the client-commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const char _openttd_revision[];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// So we don't make too much typos ;)
 | 
					// So we don't make too much typos ;)
 | 
				
			||||||
#define MY_CLIENT DEREF_CLIENT(0)
 | 
					#define MY_CLIENT DEREF_CLIENT(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -65,6 +63,7 @@ DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_JOIN)
 | 
				
			|||||||
	//    String: Unique id to find the player back in server-listing
 | 
						//    String: Unique id to find the player back in server-listing
 | 
				
			||||||
	//
 | 
						//
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						extern const char _openttd_revision[];
 | 
				
			||||||
	Packet *p;
 | 
						Packet *p;
 | 
				
			||||||
	_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
 | 
						_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
 | 
				
			||||||
	InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
 | 
						InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -125,10 +125,9 @@ void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
 | 
				
			|||||||
	return mem;
 | 
						return mem;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const char _openttd_revision[];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void showhelp(void)
 | 
					static void showhelp(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						extern const char _openttd_revision[];
 | 
				
			||||||
	char buf[4096], *p;
 | 
						char buf[4096], *p;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	p    = buf;
 | 
						p    = buf;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,8 +37,6 @@ static char *GetSpecialPlayerNameString(char *buff, int ind, const int32 *argv);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei);
 | 
					static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const char _openttd_revision[];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct LanguagePack {
 | 
					typedef struct LanguagePack {
 | 
				
			||||||
	uint32 ident;
 | 
						uint32 ident;
 | 
				
			||||||
	uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
 | 
						uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
 | 
				
			||||||
@@ -568,6 +566,7 @@ static const Units units[] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei)
 | 
					static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						extern const char _openttd_revision[];
 | 
				
			||||||
	byte b;
 | 
						byte b;
 | 
				
			||||||
	const int32 *argv_orig = argv;
 | 
						const int32 *argv_orig = argv;
 | 
				
			||||||
	uint modifier = 0;
 | 
						uint modifier = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -156,8 +156,6 @@ static void GetAvailableVideoMode(int *w, int *h)
 | 
				
			|||||||
	*h = _resolutions[best][1];
 | 
						*h = _resolutions[best][1];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const char _openttd_revision[];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef ICON_DIR
 | 
					#ifndef ICON_DIR
 | 
				
			||||||
#define ICON_DIR "media"
 | 
					#define ICON_DIR "media"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@@ -171,6 +169,7 @@ extern const char _openttd_revision[];
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static bool CreateMainSurface(int w, int h)
 | 
					static bool CreateMainSurface(int w, int h)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						extern const char _openttd_revision[];
 | 
				
			||||||
	SDL_Surface *newscreen, *icon;
 | 
						SDL_Surface *newscreen, *icon;
 | 
				
			||||||
	char caption[50];
 | 
						char caption[50];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -510,8 +510,6 @@ static void RegisterWndClass(void)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const char _openttd_revision[];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void MakeWindow(bool full_screen)
 | 
					static void MakeWindow(bool full_screen)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	_fullscreen = full_screen;
 | 
						_fullscreen = full_screen;
 | 
				
			||||||
@@ -572,6 +570,7 @@ static void MakeWindow(bool full_screen)
 | 
				
			|||||||
			ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
 | 
								ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
 | 
				
			||||||
			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
 | 
								SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
 | 
								extern const char _openttd_revision[];
 | 
				
			||||||
			char Windowtitle[50];
 | 
								char Windowtitle[50];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			snprintf(Windowtitle, lengthof(Windowtitle), "OpenTTD %s", _openttd_revision);
 | 
								snprintf(Windowtitle, lengthof(Windowtitle), "OpenTTD %s", _openttd_revision);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user