(svn r1596) Add some more statics
authortron
Sat, 22 Jan 2005 22:47:58 +0000
changeset 1095 b59632d9df1b
parent 1094 9a01482df45a
child 1096 87415b0c6fdb
(svn r1596) Add some more statics
ai_pathfinder.c
aystar.c
clear_cmd.c
console.c
console_cmds.c
engine_gui.c
gfx.c
landscape.c
misc.c
misc_gui.c
network.c
network_data.c
network_gamelist.c
news_gui.c
order_gui.c
queue.c
rail_cmd.c
road_cmd.c
roadveh_cmd.c
saveload.c
settings_gui.c
terraform_gui.c
train_cmd.c
ttd.c
tunnelbridge_cmd.c
viewport.c
widget.c
window.c
--- a/ai_pathfinder.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/ai_pathfinder.c	Sat Jan 22 22:47:58 2005 +0000
@@ -8,7 +8,8 @@
 
 // Tests if a station can be build on the given spot
 // TODO: make it train compatible
-bool TestCanBuildStationHere(uint tile, byte dir) {
+static bool TestCanBuildStationHere(uint tile, byte dir)
+{
     Player *p = DEREF_PLAYER(_current_player);
     if (dir == TEST_STATION_NO_DIR) {
         // TODO: currently we only allow spots that can be access from al 4 directions...
@@ -46,7 +47,8 @@
 #define TILES_BETWEEN(a, b, c) (TileX(a) >= TileX(b) && TileX(a) <= TileX(c) && TileY(a) >= TileY(b) && TileY(a) <= TileY(c))
 
 // Check if the current tile is in our end-area
-int32 AyStar_AiPathFinder_EndNodeCheck(AyStar *aystar, OpenListNode *current) {
+static int32 AyStar_AiPathFinder_EndNodeCheck(AyStar *aystar, OpenListNode *current)
+{
 	Ai_PathFinderInfo *PathFinderInfo = (Ai_PathFinderInfo*)aystar->user_target;
 	// It is not allowed to have a station on the end of a bridge or tunnel ;)
 	if (current->path.node.user_data[0] != 0) return AYSTAR_DONE;
@@ -60,12 +62,14 @@
 
 // Calculates the hash
 //   Currently it is a 10 bit hash, so the hash array has a max depth of 6 bits (so 64)
-uint AiPathFinder_Hash(uint key1, uint key2) {
+static uint AiPathFinder_Hash(uint key1, uint key2)
+{
 	return (TileX(key1) & 0x1F) + ((TileY(key1) & 0x1F) << 5);
 }
 
 // Clear the memory of all the things
-void AyStar_AiPathFinder_Free(AyStar *aystar) {
+static void AyStar_AiPathFinder_Free(AyStar *aystar)
+{
 	AyStarMain_Free(aystar);
 	free(aystar);
 }
--- a/aystar.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/aystar.c	Sat Jan 22 22:47:58 2005 +0000
@@ -19,13 +19,15 @@
 #include "aystar.h"
 // This looks in the Hash if a node exists in ClosedList
 //  If so, it returns the PathNode, else NULL
-PathNode *AyStarMain_ClosedList_IsInList(AyStar *aystar, AyStarNode *node) {
+static PathNode *AyStarMain_ClosedList_IsInList(AyStar *aystar, AyStarNode *node)
+{
 	return (PathNode*)Hash_Get(&aystar->ClosedListHash, node->tile, node->direction);
 }
 
 // This adds a node to the ClosedList
 //  It makes a copy of the data
-void AyStarMain_ClosedList_Add(AyStar *aystar, PathNode *node) {
+static void AyStarMain_ClosedList_Add(AyStar *aystar, PathNode *node)
+{
 	// Add a node to the ClosedList
 	PathNode *new_node = malloc(sizeof(PathNode));
 	*new_node = *node;
@@ -34,14 +36,16 @@
 
 // Checks if a node is in the OpenList
 //   If so, it returns the OpenListNode, else NULL
-OpenListNode *AyStarMain_OpenList_IsInList(AyStar *aystar, AyStarNode *node) {
+static OpenListNode *AyStarMain_OpenList_IsInList(AyStar *aystar, AyStarNode *node)
+{
 	return (OpenListNode*)Hash_Get(&aystar->OpenListHash, node->tile, node->direction);
 }
 
 // Gets the best node from OpenList
 //  returns the best node, or NULL of none is found
 // Also it deletes the node from the OpenList
-OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar) {
+static OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar)
+{
 	// Return the item the Queue returns.. the best next OpenList item.
 	OpenListNode* res = (OpenListNode*)aystar->OpenListQueue.pop(&aystar->OpenListQueue);
 	if (res != NULL)
@@ -52,7 +56,8 @@
 
 // Adds a node to the OpenList
 //  It makes a copy of node, and puts the pointer of parent in the struct
-void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, AyStarNode *node, int f, int g, int userdata) {
+static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, AyStarNode *node, int f, int g, int userdata)
+{
 	// Add a new Node to the OpenList
 	OpenListNode* new_node = malloc(sizeof(OpenListNode));
 	new_node->g = g;
--- a/clear_cmd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/clear_cmd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -413,7 +413,8 @@
 }
 
 
-int32 ClearTile_Clear(uint tile, byte flags) {
+static int32 ClearTile_Clear(uint tile, byte flags)
+{
 	static const int32 * _clear_price_table[] = {
 			NULL,
 			&_price.clear_1, &_price.clear_1,&_price.clear_1,
@@ -523,9 +524,12 @@
 	DrawClearLandFence(ti, _map3_hi[ti->tile] >> 2);
 }
 
-uint GetSlopeZ_Clear(TileInfo *ti) { return GetPartialZ(ti->x&0xF, ti->y&0xF, ti->tileh) + ti->z; }
+static uint GetSlopeZ_Clear(TileInfo *ti)
+{
+	return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z;
+}
 
-uint GetSlopeTileh_Clear(TileInfo *ti)
+static uint GetSlopeTileh_Clear(TileInfo *ti)
 {
 	return ti->tileh;
 }
--- a/console.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/console.c	Sat Jan 22 22:47:58 2005 +0000
@@ -590,7 +590,8 @@
 	return NULL;
 }
 
-void IConsoleAliasExec(const char* cmdline, char* tokens[20], byte tokentypes[20]) {
+static void IConsoleAliasExec(const char* cmdline, char* tokens[20], byte tokentypes[20])
+{
 	char* lines[ICON_MAX_ALIAS_LINES];
 	char* linestream;
 	char* linestream_s;
--- a/console_cmds.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/console_cmds.c	Sat Jan 22 22:47:58 2005 +0000
@@ -1167,7 +1167,7 @@
 /*  debug commands and variables */
 /* ****************************************** */
 
-void IConsoleDebugLibRegister(void)
+static void IConsoleDebugLibRegister(void)
 {
 	// debugging variables and functions
 	extern bool _stdlib_con_developer; /* XXX extern in .c */
--- a/engine_gui.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/engine_gui.c	Sat Jan 22 22:47:58 2005 +0000
@@ -10,7 +10,7 @@
 #include "news.h"
 
 
-StringID GetEngineCategoryName(byte engine)
+static StringID GetEngineCategoryName(byte engine)
 {
 	if (engine < NUM_TRAIN_ENGINES) {
 		switch (_engines[engine].railtype) {
--- a/gfx.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/gfx.c	Sat Jan 22 22:47:58 2005 +0000
@@ -290,7 +290,8 @@
 	GfxFillRect(x-(w>>1), y+10, x-(w>>1)+w, y+10, _string_colorremap[1]);
 }
 
-uint32 FormatStringLinebreaks(byte *str, int maxw) {
+static uint32 FormatStringLinebreaks(byte *str, int maxw)
+{
 	int num = 0;
 	int base = _stringwidth_base;
 	int w;
--- a/landscape.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/landscape.c	Sat Jan 22 22:47:58 2005 +0000
@@ -234,7 +234,7 @@
 
 // direction=true:  check for foundation in east and south corner
 // direction=false: check for foundation in west and south corner
-bool hasFoundation(TileInfo *ti, bool direction)
+static bool hasFoundation(TileInfo *ti, bool direction)
 {
 	bool south, other; // southern corner and east/west corner
 	uint slope = _tile_type_procs[ti->type]->get_slope_tileh_proc(ti);
--- a/misc.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/misc.c	Sat Jan 22 22:47:58 2005 +0000
@@ -569,7 +569,7 @@
 void OnNewDay_RoadVeh(Vehicle *v);
 void OnNewDay_Aircraft(Vehicle *v);
 void OnNewDay_Ship(Vehicle *v);
-void OnNewDay_EffectVehicle(Vehicle *v) { /* empty */ }
+static void OnNewDay_EffectVehicle(Vehicle *v) { /* empty */ }
 void OnNewDay_DisasterVehicle(Vehicle *v);
 
 typedef void OnNewVehicleDayProc(Vehicle *v);
--- a/misc_gui.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/misc_gui.c	Sat Jan 22 22:47:58 2005 +0000
@@ -1514,7 +1514,7 @@
 }
 
 // p1 -1 or +1 (down/up)
-int32 ClickChangeClimateCheat(int32 p1, int32 p2)
+static int32 ClickChangeClimateCheat(int32 p1, int32 p2)
 {
 	if(p1==-1) p1 = 3;
 	if(p1==4) p1 = 0;
@@ -1527,7 +1527,7 @@
 extern void EnginesMonthlyLoop(void);
 
 // p2 1 (increase) or -1 (decrease)
-int32 ClickChangeDateCheat(int32 p1, int32 p2)
+static int32 ClickChangeDateCheat(int32 p1, int32 p2)
 {
 	YearMonthDay ymd;
 	ConvertDayToYMD(&ymd, _date);
--- a/network.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/network.c	Sat Jan 22 22:47:58 2005 +0000
@@ -182,7 +182,7 @@
 
 // There was a non-recoverable error, drop back to the main menu with a nice
 //  error
-void NetworkError(StringID error_string)
+static void NetworkError(StringID error_string)
 {
 	_switch_mode = SM_MENU;
 	_switch_mode_errorstr = error_string;
--- a/network_data.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/network_data.c	Sat Jan 22 22:47:58 2005 +0000
@@ -114,7 +114,7 @@
 //  this handles what to do.
 // For clients: close connection and drop back to main-menu
 // For servers: close connection and that is it
-NetworkRecvStatus CloseConnection(NetworkClientState *cs)
+static NetworkRecvStatus CloseConnection(NetworkClientState *cs)
 {
 	NetworkCloseClient(cs);
 
--- a/network_gamelist.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/network_gamelist.c	Sat Jan 22 22:47:58 2005 +0000
@@ -9,7 +9,7 @@
 
 extern void UpdateNetworkGameWindow(bool unselect);
 
-void NetworkGameListClear(void)
+static void NetworkGameListClear(void)
 {
 	NetworkGameList *item;
 	NetworkGameList *next;
@@ -92,7 +92,7 @@
 	}
 }
 
-void NetworkGameListAddQueriedItem(const NetworkGameInfo *info, bool server_online)
+static void NetworkGameListAddQueriedItem(const NetworkGameInfo *info, bool server_online)
 {
 	// We queried a server and now we are going to add it to the list
 	NetworkGameList *item;
--- a/news_gui.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/news_gui.c	Sat Jan 22 22:47:58 2005 +0000
@@ -200,7 +200,7 @@
 
 // returns the correct index in the array
 // (to deal with overflows)
-byte increaseIndex(byte i)
+static byte increaseIndex(byte i)
 {
 	if (i == INVALID_NEWS)
 		return 0;
@@ -451,7 +451,7 @@
 }
 
 /* Do a forced show of a specific message */
-void ShowNewsMessage(byte i)
+static void ShowNewsMessage(byte i)
 {
 	if (_total_news == 0) return;
 
--- a/order_gui.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/order_gui.c	Sat Jan 22 22:47:58 2005 +0000
@@ -167,7 +167,7 @@
 	return v;
 }
 
-Vehicle *GetVehicleOnTile(TileIndex tile, byte owner)
+static Vehicle *GetVehicleOnTile(TileIndex tile, byte owner)
 {
 	FindVehS fs;
 	fs.tile = tile;
--- a/queue.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/queue.c	Sat Jan 22 22:47:58 2005 +0000
@@ -2,7 +2,7 @@
 #include "ttd.h"
 #include "queue.h"
 
-void Stack_Clear(Queue* q, bool free_values)
+static void Stack_Clear(Queue* q, bool free_values)
 {
 	uint i;
 	if (free_values)
@@ -11,7 +11,7 @@
 	q->data.stack.size = 0;
 }
 
-void Stack_Free(Queue* q, bool free_values)
+static void Stack_Free(Queue* q, bool free_values)
 {
 	q->clear(q, free_values);
 	free(q->data.stack.elements);
@@ -19,14 +19,16 @@
 		free(q);
 }
 
-bool Stack_Push(Queue* q, void* item, int priority) {
+static bool Stack_Push(Queue* q, void* item, int priority)
+{
 	if (q->data.stack.size == q->data.stack.max_size)
 		return false;
 	q->data.stack.elements[q->data.stack.size++] = item;
 	return true;
 }
 
-void* Stack_Pop(Queue* q) {
+static void* Stack_Pop(Queue* q)
+{
 	void* result;
 	if (q->data.stack.size == 0)
 		return NULL;
@@ -35,12 +37,13 @@
 	return result;
 }
 
-bool Stack_Delete(Queue* q, void* item, int priority)
+static bool Stack_Delete(Queue* q, void* item, int priority)
 {
 	return false;
 }
 
-Queue* init_stack(Queue* q, uint max_size) {
+static Queue* init_stack(Queue* q, uint max_size)
+{
 	q->push = Stack_Push;
 	q->pop = Stack_Pop;
 	q->del = Stack_Delete;
@@ -65,7 +68,7 @@
  * Fifo
  */
 
-void Fifo_Clear(Queue* q, bool free_values)
+static void Fifo_Clear(Queue* q, bool free_values)
 {
 	uint head, tail;
 	if (free_values) {
@@ -79,7 +82,7 @@
 	q->data.fifo.head = q->data.fifo.tail = 0;
 }
 
-void Fifo_Free(Queue* q, bool free_values)
+static void Fifo_Free(Queue* q, bool free_values)
 {
 	q->clear(q, free_values);
 	free(q->data.fifo.elements);
@@ -87,7 +90,8 @@
 		free(q);
 }
 
-bool Fifo_Push(Queue* q, void* item, int priority) {
+static bool Fifo_Push(Queue* q, void* item, int priority)
+{
 	uint next = (q->data.fifo.head + 1) % q->data.fifo.max_size;
 	if (next == q->data.fifo.tail)
 		return false;
@@ -98,7 +102,8 @@
 	return true;
 }
 
-void* Fifo_Pop(Queue* q) {
+static void* Fifo_Pop(Queue* q)
+{
 	void* result;
 	if (q->data.fifo.head == q->data.fifo.tail)
 		return NULL;
@@ -109,12 +114,13 @@
 	return result;
 }
 
-bool Fifo_Delete(Queue* q, void* item, int priority)
+static bool Fifo_Delete(Queue* q, void* item, int priority)
 {
 	return false;
 }
 
-Queue* init_fifo(Queue* q, uint max_size) {
+static Queue* init_fifo(Queue* q, uint max_size)
+{
 	q->push = Fifo_Push;
 	q->pop = Fifo_Pop;
 	q->del = Fifo_Delete;
@@ -141,7 +147,8 @@
  * Insertion Sorter
  */
 
-void InsSort_Clear(Queue* q, bool free_values) {
+static void InsSort_Clear(Queue* q, bool free_values)
+{
 	InsSortNode* node = q->data.inssort.first;
 	InsSortNode* prev;
 	while (node != NULL) {
@@ -155,14 +162,15 @@
 	q->data.inssort.first = NULL;
 }
 
-void InsSort_Free(Queue* q, bool free_values)
+static void InsSort_Free(Queue* q, bool free_values)
 {
 	q->clear(q, free_values);
 	if (q->freeq)
 		free(q);
 }
 
-bool InsSort_Push(Queue* q, void* item, int priority) {
+static bool InsSort_Push(Queue* q, void* item, int priority)
+{
 	InsSortNode* newnode = malloc(sizeof(InsSortNode));
 	if (newnode == NULL) return false;
 	newnode->item = item;
@@ -184,7 +192,8 @@
 	return true;
 }
 
-void* InsSort_Pop(Queue* q) {
+static void* InsSort_Pop(Queue* q)
+{
 	InsSortNode* node = q->data.inssort.first;
 	void* result;
 	if (node == NULL)
@@ -197,7 +206,7 @@
 	return result;
 }
 
-bool InsSort_Delete(Queue* q, void* item, int priority)
+static bool InsSort_Delete(Queue* q, void* item, int priority)
 {
 	return false;
 }
@@ -235,7 +244,7 @@
 //  q->data.binaryheap.elements[i-1] every time, we use this define.
 #define BIN_HEAP_ARR(i) q->data.binaryheap.elements[((i)-1) >> BINARY_HEAP_BLOCKSIZE_BITS][((i)-1) & BINARY_HEAP_BLOCKSIZE_MASK]
 
-void BinaryHeap_Clear(Queue* q, bool free_values)
+static void BinaryHeap_Clear(Queue* q, bool free_values)
 {
 	/* Free all items if needed and free all but the first blocks of
 	 * memory */
@@ -264,7 +273,7 @@
 	q->data.binaryheap.blocks = 1;
 }
 
-void BinaryHeap_Free(Queue* q, bool free_values)
+static void BinaryHeap_Free(Queue* q, bool free_values)
 {
 	uint i;
 	q->clear(q, free_values);
@@ -277,7 +286,8 @@
 		free(q);
 }
 
-bool BinaryHeap_Push(Queue* q, void* item, int priority) {
+static bool BinaryHeap_Push(Queue* q, void* item, int priority)
+{
 	#ifdef QUEUE_DEBUG
 			printf("[BinaryHeap] Pushing an element. There are %d elements left\n", q->data.binaryheap.size);
 	#endif
@@ -325,7 +335,7 @@
 	return true;
 }
 
-bool BinaryHeap_Delete(Queue* q, void* item, int priority)
+static bool BinaryHeap_Delete(Queue* q, void* item, int priority)
 {
 	#ifdef QUEUE_DEBUG
 			printf("[BinaryHeap] Deleting an element. There are %d elements left\n", q->data.binaryheap.size);
@@ -381,7 +391,8 @@
 	return true;
 }
 
-void* BinaryHeap_Pop(Queue* q) {
+static void* BinaryHeap_Pop(Queue* q)
+{
 	#ifdef QUEUE_DEBUG
 			printf("[BinaryHeap] Popping an element. There are %d elements left\n", q->data.binaryheap.size);
 	#endif
@@ -523,7 +534,8 @@
  * bucket, or NULL if it is empty. prev can also be NULL, in which case it is
  * not used for output.
  */
-HashNode* Hash_FindNode(Hash* h, uint key1, uint key2, HashNode** prev_out) {
+static HashNode* Hash_FindNode(Hash* h, uint key1, uint key2, HashNode** prev_out)
+{
 	uint hash = h->hash(key1, key2);
 	HashNode* result = NULL;
 	#ifdef HASH_DEBUG
--- a/rail_cmd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/rail_cmd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -2017,7 +2017,7 @@
 	return z;
 }
 
-uint GetSlopeTileh_Track(TileInfo *ti)
+static uint GetSlopeTileh_Track(TileInfo *ti)
 {
 	// check if it's a foundation
 	if (ti->tileh != 0) {
--- a/road_cmd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/road_cmd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -20,7 +20,7 @@
 void RoadVehEnterDepot(Vehicle *v);
 
 
-bool HasTileRoadAt(uint tile, int i)
+static bool HasTileRoadAt(uint tile, int i)
 {
 	int mask;
 	byte b;
@@ -886,7 +886,7 @@
 	return z; // normal Z if no slope
 }
 
-uint GetSlopeTileh_Road(TileInfo *ti)
+static uint GetSlopeTileh_Road(TileInfo *ti)
 {
 	// check if it's a foundation
 	if (ti->tileh != 0) {
--- a/roadveh_cmd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/roadveh_cmd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -649,7 +649,7 @@
 	byte dir;
 } RoadVehFindData;
 
-void *EnumCheckRoadVehClose(Vehicle *v, RoadVehFindData *rvf)
+static void *EnumCheckRoadVehClose(Vehicle *v, RoadVehFindData *rvf)
 {
 	static const short _dists[] = {
 		-4, -8, -4, -1, 4, 8, 4, 1,
@@ -801,7 +801,7 @@
 	byte tilebits;
 } OvertakeData;
 
-void *EnumFindVehToOvertake(Vehicle *v, OvertakeData *od)
+static void *EnumFindVehToOvertake(Vehicle *v, OvertakeData *od)
 {
 	if (v->tile != (TileIndex)od->tile ||
 			v->type != VEH_Road ||
--- a/saveload.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/saveload.c	Sat Jan 22 22:47:58 2005 +0000
@@ -131,22 +131,22 @@
 	return (i>=0x80) ? 2 : 1;
 }
 
-inline int SlReadSparseIndex(void)
+static inline int SlReadSparseIndex(void)
 {
 	return SlReadSimpleGamma();
 }
 
-inline void SlWriteSparseIndex(uint index)
+static inline void SlWriteSparseIndex(uint index)
 {
 	SlWriteSimpleGamma(index);
 }
 
-inline int SlReadArrayLength(void)
+static inline int SlReadArrayLength(void)
 {
 	return SlReadSimpleGamma();
 }
 
-inline void SlWriteArrayLength(uint length)
+static inline void SlWriteArrayLength(uint length)
 {
 	SlWriteSimpleGamma(length);
 }
@@ -241,7 +241,7 @@
 	}
 }
 
-void SlSkipBytes(size_t length)
+static void SlSkipBytes(size_t length)
 {
 	while (length) {
 		SlReadByte();
@@ -925,7 +925,7 @@
 	return 0;
 }
 
-void *IntToReference(uint r, uint t)
+static void *IntToReference(uint r, uint t)
 {
 	/* From version 4.3 REF_VEHICLE_OLD is saved as REF_VEHICLE, and should be loaded
 	    like that */
--- a/settings_gui.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/settings_gui.c	Sat Jan 22 22:47:58 2005 +0000
@@ -517,7 +517,7 @@
 }
 
 // virtual PositionMainToolbar function, calls the right one.
-int32 v_PositionMainToolbar(int32 p1)
+static int32 v_PositionMainToolbar(int32 p1)
 {
 	if (_game_mode != GM_MENU)
 		PositionMainToolbar(NULL);
@@ -525,7 +525,7 @@
 	return 0;
 }
 
-int32 AiNew_PatchActive_Warning(int32 p1)
+static int32 AiNew_PatchActive_Warning(int32 p1)
 {
   if (p1 == 1)
     ShowErrorMessage(-1, TEMP_AI_ACTIVATED, 0, 0);
@@ -533,7 +533,7 @@
   return 0;
 }
 
-int32 PopulationInLabelActive(int32 p1)
+static int32 PopulationInLabelActive(int32 p1)
 {
 	Town *t;
 
@@ -546,20 +546,20 @@
 	return 0;
 }
 
-int32 InvisibleTreesActive(int32 p1)
+static int32 InvisibleTreesActive(int32 p1)
 {
 	MarkWholeScreenDirty();
 	return 0;
 }
 
-int32 InValidateDetailsWindow(int32 p1)
+static int32 InValidateDetailsWindow(int32 p1)
 {
 	InvalidateWindowClasses(WC_VEHICLE_DETAILS);
 	return 0;
 }
 
 /* Check service intervals of vehicles, p1 is value of % or day based servicing */
-int32 CheckInterval(int32 p1)
+static int32 CheckInterval(int32 p1)
 {
 	bool warning;
 	if (p1) {
--- a/terraform_gui.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/terraform_gui.c	Sat Jan 22 22:47:58 2005 +0000
@@ -61,7 +61,7 @@
 	VpStartPlaceSizing(tile, VPM_X_AND_Y | (2<<4));
 }
 
-void PlaceProc_PlantTree(uint tile)
+static void PlaceProc_PlantTree(uint tile)
 {
 }
 
--- a/train_cmd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/train_cmd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -1997,7 +1997,7 @@
 
 } TrainCollideChecker;
 
-void *FindTrainCollideEnum(Vehicle *v, TrainCollideChecker *tcc)
+static void *FindTrainCollideEnum(Vehicle *v, TrainCollideChecker *tcc)
 {
 	if (v == tcc->v || v == tcc->v_skip || v->type != VEH_Train || v->u.rail.track==0x80)
 		return 0;
@@ -2621,7 +2621,7 @@
 static const byte _depot_track_ind[4] = {0,1,0,1};
 
 // Validation for the news item "Train is waiting in depot"
-bool ValidateTrainInDepot( uint data_a, uint data_b )
+static bool ValidateTrainInDepot( uint data_a, uint data_b )
 {
 	Vehicle *v = GetVehicle(data_a);
 	return  (v->u.rail.track == 0x80 && (v->vehstatus | VS_STOPPED));
--- a/ttd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/ttd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -211,7 +211,7 @@
 	*dst = 0;
 }
 
-char *strecpy(char *dst, const char *src)
+static char *strecpy(char *dst, const char *src)
 {
 	while ( (*dst++ = *src++) != 0) {}
 	return dst - 1;
@@ -469,7 +469,7 @@
 	}
 }
 
-void ParseResolution(int res[2], char *s)
+static void ParseResolution(int res[2], char *s)
 {
 	char *t = strchr(s, 'x');
 	if (t == NULL) {
@@ -513,7 +513,7 @@
 }
 
 
-void LoadIntroGame(void)
+static void LoadIntroGame(void)
 {
 	char filename[256];
 	_game_mode = GM_MENU;
@@ -776,7 +776,7 @@
 
 }
 
-void MakeNewGame(void)
+static void MakeNewGame(void)
 {
 	_game_mode = GM_NORMAL;
 
@@ -834,7 +834,7 @@
 void StartupPlayers(void);
 void StartupDisasters(void);
 
-void StartScenario(void)
+static void StartScenario(void)
 {
 	_game_mode = GM_NORMAL;
 
@@ -1190,7 +1190,7 @@
 	}
 }
 
-void ConvertTownOwner(void)
+static void ConvertTownOwner(void)
 {
 	uint tile;
 
@@ -1209,7 +1209,7 @@
 }
 
 // before savegame version 4, the name of the company determined if it existed
-void CheckIsPlayerActive(void)
+static void CheckIsPlayerActive(void)
 {
 	Player *p;
 	FOR_ALL_PLAYERS(p) {
@@ -1220,7 +1220,7 @@
 }
 
 // since savegame version 4.1, exclusive transport rights are stored at towns
-void UpdateExclusiveRights(void)
+static void UpdateExclusiveRights(void)
 {
 	Town *t;
 	FOR_ALL_TOWNS(t) if (t->xy != 0) {
@@ -1245,14 +1245,14 @@
 	18,  2, 20, };
 
 // since savegame version 4.2 the currencies are arranged differently
-void UpdateCurrencies(void)
+static void UpdateCurrencies(void)
 {
 	_opt.currency = convert_currency[_opt.currency];
 }
 
 // up to revision 1413, the invisible tiles at the southern border have not been MP_VOID
 // even though they should have. This is fixed by this function
-void UpdateVoidTiles(void)
+static void UpdateVoidTiles(void)
 {
 	uint i;
 	// create void tiles on the border
--- a/tunnelbridge_cmd.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/tunnelbridge_cmd.c	Sat Jan 22 22:47:58 2005 +0000
@@ -902,7 +902,7 @@
 
 
 // fast routine for getting the height of a middle bridge tile. 'tile' MUST be a middle bridge tile.
-uint GetBridgeHeight(const TileInfo *ti)
+static uint GetBridgeHeight(const TileInfo *ti)
 {
 	uint delta;
 	TileInfo ti_end;
--- a/viewport.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/viewport.c	Sat Jan 22 22:47:58 2005 +0000
@@ -266,7 +266,8 @@
 	return NULL;
 }
 
-Point TranslateXYToTileCoord(ViewPort *vp, int x, int y) {
+static Point TranslateXYToTileCoord(ViewPort *vp, int x, int y)
+{
 	int z;
 	Point pt;
 	int a,b;
@@ -1682,7 +1683,7 @@
 void HandleClickOnRoadVeh(Vehicle *v);
 void HandleClickOnAircraft(Vehicle *v);
 void HandleClickOnShip(Vehicle *v);
-void HandleClickOnSpecialVeh(Vehicle *v) {}
+static void HandleClickOnSpecialVeh(Vehicle *v) {}
 void HandleClickOnDisasterVeh(Vehicle *v);
 typedef void OnVehicleClickProc(Vehicle *v);
 static OnVehicleClickProc * const _on_vehicle_click_proc[6] = {
--- a/widget.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/widget.c	Sat Jan 22 22:47:58 2005 +0000
@@ -478,7 +478,7 @@
 	return item;
 }
 
-void DropdownMenuWndProc(Window *w, WindowEvent *e)
+static void DropdownMenuWndProc(Window *w, WindowEvent *e)
 {
 	int item;
 
--- a/window.c	Sat Jan 22 22:46:10 2005 +0000
+++ b/window.c	Sat Jan 22 22:47:58 2005 +0000
@@ -532,7 +532,8 @@
 	return true;
 }
 
-Point GetAutoPlacePosition(int width, int height) {
+static Point GetAutoPlacePosition(int width, int height)
+{
 	Window *w;
 	Point pt;
 
@@ -778,7 +779,7 @@
 	return false;
 }
 
-bool HandleMouseOver(void)
+static bool HandleMouseOver(void)
 {
 	Window *w;
 	WindowEvent e;
@@ -811,7 +812,7 @@
 	return true;
 }
 
-bool HandleWindowDragging(void)
+static bool HandleWindowDragging(void)
 {
 	Window *w;
 	// Get out immediately if no window is being dragged at all.