summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-09 10:40:33 +0000
committerrubidium <rubidium@openttd.org>2009-11-09 10:40:33 +0000
commit860b9b1cead825da2dfc109858f8f134f973f62d (patch)
tree217816b8cd30cd32331090a36222f2e968c830e2
parentc2221885f488b9a7ca52b11e621582d4c60ab80d (diff)
downloadopenttd-860b9b1cead825da2dfc109858f8f134f973f62d.tar.xz
(svn r18028) -Codechange: unglobalise some functions
-rw-r--r--src/ai/ai_gui.cpp4
-rw-r--r--src/aystar.cpp8
-rw-r--r--src/aystar.h4
-rw-r--r--src/bridge_map.cpp7
-rw-r--r--src/bridge_map.h7
-rw-r--r--src/console.cpp96
-rw-r--r--src/console_gui.cpp1
-rw-r--r--src/console_internal.h5
-rw-r--r--src/fileio.cpp4
-rw-r--r--src/fileio_func.h1
-rw-r--r--src/fontcache.cpp2
-rw-r--r--src/genworld_gui.cpp2
-rw-r--r--src/gfxinit.cpp2
-rw-r--r--src/gfxinit.h3
-rw-r--r--src/industry_cmd.cpp2
-rw-r--r--src/network/network_udp.cpp6
-rw-r--r--src/news_gui.cpp2
-rw-r--r--src/os/unix/crashlog_unix.cpp2
-rw-r--r--src/rail.h1
-rw-r--r--src/rail_cmd.cpp2
-rw-r--r--src/road.cpp9
-rw-r--r--src/road_cmd.cpp4
-rw-r--r--src/road_map.h10
-rw-r--r--src/saveload/oldloader_sl.cpp2
-rw-r--r--src/saveload/saveload.cpp2
-rw-r--r--src/saveload/station_sl.cpp2
-rw-r--r--src/saveload/subsidy_sl.cpp4
-rw-r--r--src/saveload/vehicle_sl.cpp2
-rw-r--r--src/settings.cpp4
-rw-r--r--src/settings_gui.cpp2
-rw-r--r--src/spritecache.cpp4
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/vehicle_gui.cpp2
-rw-r--r--src/vehicle_gui.h1
-rw-r--r--src/waypoint_cmd.cpp2
-rw-r--r--src/waypoint_func.h1
-rw-r--r--src/widget.cpp2
-rw-r--r--src/widget_type.h1
38 files changed, 97 insertions, 120 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index e100b456c..a88f56aa0 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -239,7 +239,7 @@ static const WindowDesc _ai_list_desc(
NULL, _nested_ai_list_widgets, lengthof(_nested_ai_list_widgets)
);
-void ShowAIListWindow(CompanyID slot)
+static void ShowAIListWindow(CompanyID slot)
{
DeleteWindowByClass(WC_AI_LIST);
new AIListWindow(&_ai_list_desc, slot);
@@ -438,7 +438,7 @@ static const WindowDesc _ai_settings_desc(
NULL, _nested_ai_settings_widgets, lengthof(_nested_ai_settings_widgets)
);
-void ShowAISettingsWindow(CompanyID slot)
+static void ShowAISettingsWindow(CompanyID slot)
{
DeleteWindowByClass(WC_AI_LIST);
DeleteWindowByClass(WC_AI_SETTINGS);
diff --git a/src/aystar.cpp b/src/aystar.cpp
index ef8b7657e..5630c01bb 100644
--- a/src/aystar.cpp
+++ b/src/aystar.cpp
@@ -90,7 +90,7 @@ static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, const AySt
* return values:
* AYSTAR_DONE : indicates we are done
*/
-int AyStarMain_CheckTile(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
+static int AyStarMain_CheckTile(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
{
int new_f, new_g, new_h;
PathNode *closedlist_parent;
@@ -156,7 +156,7 @@ int AyStarMain_CheckTile(AyStar *aystar, AyStarNode *current, OpenListNode *pare
* AYSTAR_FOUND_END_NODE : indicates we found the end. Path_found now is true, and in path is the path found.
* AYSTAR_STILL_BUSY : indicates we have done this tile, did not found the path yet, and have items left to try.
*/
-int AyStarMain_Loop(AyStar *aystar)
+static int AyStarMain_Loop(AyStar *aystar)
{
int i, r;
@@ -200,7 +200,7 @@ int AyStarMain_Loop(AyStar *aystar)
/*
* This function frees the memory it allocated
*/
-void AyStarMain_Free(AyStar *aystar)
+static void AyStarMain_Free(AyStar *aystar)
{
aystar->OpenListQueue.free(&aystar->OpenListQueue, false);
/* 2nd argument above is false, below is true, to free the values only
@@ -276,7 +276,7 @@ int AyStarMain_Main(AyStar *aystar)
* clear() automatically when the algorithm finishes
* g is the cost for starting with this node.
*/
-void AyStarMain_AddStartNode(AyStar *aystar, AyStarNode *start_node, uint g)
+static void AyStarMain_AddStartNode(AyStar *aystar, AyStarNode *start_node, uint g)
{
#ifdef AYSTAR_DEBUG
printf("[AyStar] Starting A* Algorithm from node (%d, %d, %d)\n",
diff --git a/src/aystar.h b/src/aystar.h
index 58f0850f9..27170551a 100644
--- a/src/aystar.h
+++ b/src/aystar.h
@@ -169,11 +169,7 @@ struct AyStar {
};
-void AyStarMain_AddStartNode(AyStar *aystar, AyStarNode *start_node, uint g);
int AyStarMain_Main(AyStar *aystar);
-int AyStarMain_Loop(AyStar *aystar);
-int AyStarMain_CheckTile(AyStar *aystar, AyStarNode *current, OpenListNode *parent);
-void AyStarMain_Free(AyStar *aystar);
void AyStarMain_Clear(AyStar *aystar);
/* Initialize an AyStar. You should fill all appropriate fields before
diff --git a/src/bridge_map.cpp b/src/bridge_map.cpp
index 2817346ef..80f0f6f18 100644
--- a/src/bridge_map.cpp
+++ b/src/bridge_map.cpp
@@ -14,7 +14,12 @@
#include "tunnelbridge_map.h"
-TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
+/**
+ * Finds the end of a bridge in the specified direction starting at a middle tile
+ * @param t the bridge tile to find the bridge ramp for
+ * @param d the direction to search in
+ */
+static TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
{
TileIndexDiff delta = TileOffsByDiagDir(dir);
diff --git a/src/bridge_map.h b/src/bridge_map.h
index 1e16fdc06..695b842ad 100644
--- a/src/bridge_map.h
+++ b/src/bridge_map.h
@@ -94,13 +94,6 @@ static inline Axis GetBridgeAxis(TileIndex t)
}
/**
- * Finds the end of a bridge in the specified direction starting at a middle tile
- * @param t the bridge tile to find the bridge ramp for
- * @param d the direction to search in
- */
-TileIndex GetBridgeEnd(TileIndex t, DiagDirection d);
-
-/**
* Finds the northern end of a bridge starting at a middle tile
* @param t the bridge tile to find the bridge ramp for
*/
diff --git a/src/console.cpp b/src/console.cpp
index f0f97686a..c8bb2a564 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -535,6 +535,53 @@ IConsoleVar *IConsoleVarGet(const char *name)
}
/**
+ * Get the value of the variable and put it into a printable
+ * string form so we can use it for printing
+ */
+static char *IConsoleVarGetStringValue(const IConsoleVar *var)
+{
+ static char tempres[50];
+ char *value = tempres;
+
+ switch (var->type) {
+ case ICONSOLE_VAR_BOOLEAN:
+ snprintf(tempres, sizeof(tempres), "%s", (*(bool*)var->addr) ? "on" : "off");
+ break;
+ case ICONSOLE_VAR_BYTE:
+ snprintf(tempres, sizeof(tempres), "%u", *(byte*)var->addr);
+ break;
+ case ICONSOLE_VAR_UINT16:
+ snprintf(tempres, sizeof(tempres), "%u", *(uint16*)var->addr);
+ break;
+ case ICONSOLE_VAR_UINT32:
+ snprintf(tempres, sizeof(tempres), "%u", *(uint32*)var->addr);
+ break;
+ case ICONSOLE_VAR_INT16:
+ snprintf(tempres, sizeof(tempres), "%i", *(int16*)var->addr);
+ break;
+ case ICONSOLE_VAR_INT32:
+ snprintf(tempres, sizeof(tempres), "%i", *(int32*)var->addr);
+ break;
+ case ICONSOLE_VAR_STRING:
+ value = (char*)var->addr;
+ break;
+ default: NOT_REACHED();
+ }
+
+ return value;
+}
+
+/**
+ * Print out the value of the variable after it has been assigned
+ * a new value, thus giving us feedback on the action
+ */
+static void IConsoleVarPrintSetValue(const IConsoleVar *var)
+{
+ char *value = IConsoleVarGetStringValue(var);
+ IConsolePrintF(CC_WARNING, "'%s' changed to: %s", var->name, value);
+}
+
+/**
* Set a new value to a console variable
* @param *var the variable being set/changed
* @param value the new value given to the variable, cast properly
@@ -619,43 +666,6 @@ static uint32 IConsoleVarGetValue(const IConsoleVar *var)
}
/**
- * Get the value of the variable and put it into a printable
- * string form so we can use it for printing
- */
-static char *IConsoleVarGetStringValue(const IConsoleVar *var)
-{
- static char tempres[50];
- char *value = tempres;
-
- switch (var->type) {
- case ICONSOLE_VAR_BOOLEAN:
- snprintf(tempres, sizeof(tempres), "%s", (*(bool*)var->addr) ? "on" : "off");
- break;
- case ICONSOLE_VAR_BYTE:
- snprintf(tempres, sizeof(tempres), "%u", *(byte*)var->addr);
- break;
- case ICONSOLE_VAR_UINT16:
- snprintf(tempres, sizeof(tempres), "%u", *(uint16*)var->addr);
- break;
- case ICONSOLE_VAR_UINT32:
- snprintf(tempres, sizeof(tempres), "%u", *(uint32*)var->addr);
- break;
- case ICONSOLE_VAR_INT16:
- snprintf(tempres, sizeof(tempres), "%i", *(int16*)var->addr);
- break;
- case ICONSOLE_VAR_INT32:
- snprintf(tempres, sizeof(tempres), "%i", *(int32*)var->addr);
- break;
- case ICONSOLE_VAR_STRING:
- value = (char*)var->addr;
- break;
- default: NOT_REACHED();
- }
-
- return value;
-}
-
-/**
* Print out the value of the variable when asked
*/
void IConsoleVarPrintGetValue(const IConsoleVar *var)
@@ -673,23 +683,13 @@ void IConsoleVarPrintGetValue(const IConsoleVar *var)
}
/**
- * Print out the value of the variable after it has been assigned
- * a new value, thus giving us feedback on the action
- */
-void IConsoleVarPrintSetValue(const IConsoleVar *var)
-{
- char *value = IConsoleVarGetStringValue(var);
- IConsolePrintF(CC_WARNING, "'%s' changed to: %s", var->name, value);
-}
-
-/**
* Execute a variable command. Without any parameters, print out its value
* with parameters it assigns a new value to the variable
* @param *var the variable that we will be querying/changing
* @param tokencount how many additional parameters have been given to the commandline
* @param *token the actual parameters the variable was called with
*/
-void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[ICON_TOKEN_COUNT])
+static void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[ICON_TOKEN_COUNT])
{
const char *tokenptr = token[0];
byte t_index = tokencount;
diff --git a/src/console_gui.cpp b/src/console_gui.cpp
index 2486f7588..4c0a2c176 100644
--- a/src/console_gui.cpp
+++ b/src/console_gui.cpp
@@ -407,7 +407,6 @@ void IConsoleSwitch()
}
void IConsoleClose() {if (_iconsole_mode == ICONSOLE_OPENED) IConsoleSwitch();}
-void IConsoleOpen() {if (_iconsole_mode == ICONSOLE_CLOSED) IConsoleSwitch();}
/**
* Add the entered line into the history so you can look it back
diff --git a/src/console_internal.h b/src/console_internal.h
index 72e8ab57e..f36ee3950 100644
--- a/src/console_internal.h
+++ b/src/console_internal.h
@@ -110,7 +110,6 @@ extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
/* console functions */
void IConsoleClearBuffer();
-void IConsoleOpen();
/* Commands */
void IConsoleCmdRegister(const char *name, IConsoleCmdProc *proc);
@@ -123,10 +122,6 @@ void IConsoleVarRegister(const char *name, void *addr, IConsoleVarTypes type, co
void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help);
IConsoleVar *IConsoleVarGet(const char *name);
void IConsoleVarPrintGetValue(const IConsoleVar *var);
-void IConsoleVarPrintSetValue(const IConsoleVar *var);
-
-/* Parser */
-void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[]);
/* console std lib (register ingame commands/aliases/variables) */
void IConsoleStdLibRegister();
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 45d88b82c..858ac5abb 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -302,7 +302,7 @@ char *FioGetDirectory(char *buf, size_t buflen, Subdirectory subdir)
return buf;
}
-FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subdirectory subdir, size_t *filesize)
+static FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subdirectory subdir, size_t *filesize)
{
#if defined(WIN32) && defined(UNICODE)
/* fopen is implemented as a define with ellipses for
@@ -436,7 +436,7 @@ void FioCreateDirectory(const char *name)
* @param buf string to append the separator to
* @param buflen the length of the buf
*/
-void AppendPathSeparator(char *buf, size_t buflen)
+static void AppendPathSeparator(char *buf, size_t buflen)
{
size_t s = strlen(buf);
diff --git a/src/fileio_func.h b/src/fileio_func.h
index b2d2da803..4b42e4908 100644
--- a/src/fileio_func.h
+++ b/src/fileio_func.h
@@ -57,7 +57,6 @@ char *FioAppendDirectory(char *buf, size_t buflen, Searchpath sp, Subdirectory s
char *FioGetDirectory(char *buf, size_t buflen, Subdirectory subdir);
void SanitizeFilename(char *filename);
-void AppendPathSeparator(char *buf, size_t buflen);
void DeterminePaths(const char *exe);
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
bool FileExists(const char *filename);
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index 7ccdfb931..43852fa29 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -902,7 +902,7 @@ static void SetGlyphPtr(FontSize size, WChar key, const GlyphEntry *glyph)
_glyph_ptr[size][GB(key, 8, 8)][GB(key, 0, 8)].width = glyph->width;
}
-void *AllocateFont(size_t size)
+static void *AllocateFont(size_t size)
{
return MallocT<byte>(size);
}
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 941e7bfec..d89f134fd 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -310,7 +310,7 @@ static const NWidgetPart _nested_heightmap_load_widgets[] = {
EndContainer(),
};
-void StartGeneratingLandscape(glwp_modes mode)
+static void StartGeneratingLandscape(glwp_modes mode)
{
DeleteAllNonVitalWindows();
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 70e01886b..686951a75 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -65,7 +65,7 @@ static uint LoadGrfFile(const char *filename, uint load_index, int file_index)
}
-void LoadSpritesIndexed(int file_index, uint *sprite_id, const SpriteID *index_tbl)
+static void LoadSpritesIndexed(int file_index, uint *sprite_id, const SpriteID *index_tbl)
{
uint start;
while ((start = *index_tbl++) != END) {
diff --git a/src/gfxinit.h b/src/gfxinit.h
index 26c662b3d..5bf0bff5c 100644
--- a/src/gfxinit.h
+++ b/src/gfxinit.h
@@ -12,9 +12,6 @@
#ifndef GFXINIT_H
#define GFXINIT_H
-#include "gfx_type.h"
-
void GfxLoadSprites();
-void LoadSpritesIndexed(int file_index, uint *sprite_id, const SpriteID *index_tbl);
#endif /* GFXINIT_H */
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 42b66ca12..7080ac4a8 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2058,7 +2058,7 @@ static void CanCargoServiceIndustry(CargoID cargo, Industry *ind, bool *c_accept
* service the industry, and 1 otherwise (only competitors can service the
* industry)
*/
-int WhoCanServiceIndustry(Industry *ind)
+static int WhoCanServiceIndustry(Industry *ind)
{
/* Find all stations within reach of the industry */
StationList stations;
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index acf1afb2d..b9d812ede 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -430,7 +430,7 @@ struct NetworkUDPQueryServerInfo : NetworkAddress {
* Threaded part for resolving the IP of a server and querying it.
* @param pntr the NetworkUDPQueryServerInfo.
*/
-void NetworkUDPQueryServerThread(void *pntr)
+static void NetworkUDPQueryServerThread(void *pntr)
{
NetworkUDPQueryServerInfo *info = (NetworkUDPQueryServerInfo*)pntr;
@@ -459,7 +459,7 @@ void NetworkUDPQueryServer(NetworkAddress address, bool manually)
}
}
-void NetworkUDPRemoveAdvertiseThread(void *pntr)
+static void NetworkUDPRemoveAdvertiseThread(void *pntr)
{
DEBUG(net, 1, "[udp] removing advertise from master server");
@@ -491,7 +491,7 @@ void NetworkUDPRemoveAdvertise(bool blocking)
}
}
-void NetworkUDPAdvertiseThread(void *pntr)
+static void NetworkUDPAdvertiseThread(void *pntr)
{
/* Find somewhere to send */
NetworkAddress out_addr(NETWORK_MASTER_SERVER_HOST, NETWORK_MASTER_SERVER_PORT);
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 5686102f1..84eb24665 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -775,7 +775,7 @@ void DeleteIndustryNews(IndustryID iid)
}
}
-void RemoveOldNewsItems()
+static void RemoveOldNewsItems()
{
NewsItem *next;
for (NewsItem *cur = _oldest_news; _total_news > MIN_NEWS_AMOUNT && cur != NULL; cur = next) {
diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp
index 0c2690610..ed7f2127f 100644
--- a/src/os/unix/crashlog_unix.cpp
+++ b/src/os/unix/crashlog_unix.cpp
@@ -143,7 +143,7 @@ static const int _signals_to_handle[] = { SIGSEGV, SIGABRT, SIGFPE, SIGBUS };
* @note Not static so it shows up in the backtrace.
* @param signum the signal that caused us to crash.
*/
-void CDECL HandleCrash(int signum)
+static void CDECL HandleCrash(int signum)
{
/* Disable all handling of signals by us, so we don't go into infinite loops. */
for (const int *i = _signals_to_handle; i != endof(_signals_to_handle); i++) {
diff --git a/src/rail.h b/src/rail.h
index ae19c97c1..06445d558 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -227,7 +227,6 @@ static inline Money RailConvertCost(RailType from, RailType to)
return RailBuildCost(to) + _price[PR_CLEAR_RAIL];
}
-Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data);
void DrawTrainDepotSprite(int x, int y, int image, RailType railtype);
Vehicle *EnsureNoTrainOnTrackProc(Vehicle *v, void *data);
int TicksToLeaveDepot(const Train *v);
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index eca108f02..855ee1afa 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1256,7 +1256,7 @@ CommandCost CmdRemoveSignalTrack(TileIndex tile, DoCommandFlag flags, uint32 p1,
}
/** Update power of train under which is the railtype being converted */
-Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data)
+static Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data)
{
if (v->type != VEH_TRAIN) return NULL;
diff --git a/src/road.cpp b/src/road.cpp
index 5e802f786..705270186 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -21,7 +21,14 @@
#include "date_func.h"
#include "landscape.h"
-bool IsPossibleCrossing(const TileIndex tile, Axis ax)
+/**
+ * Return if the tile is a valid tile for a crossing.
+ *
+ * @param tile the curent tile
+ * @param ax the axis of the road over the rail
+ * @return true if it is a valid tile
+ */
+static bool IsPossibleCrossing(const TileIndex tile, Axis ax)
{
return (IsTileType(tile, MP_RAILWAY) &&
GetRailTileType(tile) == RAIL_TILE_NORMAL &&
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index ff610554f..9b5915589 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -103,7 +103,7 @@ static const RoadBits _invalid_tileh_slopes_road[2][15] = {
}
};
-Foundation GetRoadFoundation(Slope tileh, RoadBits bits);
+static Foundation GetRoadFoundation(Slope tileh, RoadBits bits);
/**
* Is it allowed to remove the given road bits from the given tile?
@@ -981,7 +981,7 @@ struct DrawRoadTileStruct {
* @param bits The RoadBits part
* @return The resulting Foundation
*/
-Foundation GetRoadFoundation(Slope tileh, RoadBits bits)
+static Foundation GetRoadFoundation(Slope tileh, RoadBits bits)
{
/* Flat land and land without a road doesn't require a foundation */
if (tileh == SLOPE_FLAT || bits == ROAD_NONE) return FOUNDATION_NONE;
diff --git a/src/road_map.h b/src/road_map.h
index d5f98ff49..bea758e2c 100644
--- a/src/road_map.h
+++ b/src/road_map.h
@@ -369,16 +369,6 @@ static inline DiagDirection GetRoadDepotDirection(TileIndex t)
*/
RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance = false);
-/**
- * Return if the tile is a valid tile for a crossing.
- *
- * @note function is overloaded
- * @param tile the curent tile
- * @param ax the axis of the road over the rail
- * @return true if it is a valid tile
- */
-bool IsPossibleCrossing(const TileIndex tile, Axis ax);
-
static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram)
{
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp
index 332447b6c..7acac2937 100644
--- a/src/saveload/oldloader_sl.cpp
+++ b/src/saveload/oldloader_sl.cpp
@@ -148,7 +148,7 @@ static uint32 RemapOldTownName(uint32 townnameparts, byte old_town_name_type)
#undef FIXNUM
-void FixOldTowns()
+static void FixOldTowns()
{
Town *town;
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 3eb4ae6f5..76025aee7 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -767,7 +767,7 @@ static inline size_t SlCalcListLen(const void *list)
* @param list The list being manipulated
* @param conv SLRefType type of the list (Vehicle *, Station *, etc)
*/
-void SlList(void *list, SLRefType conv)
+static void SlList(void *list, SLRefType conv)
{
/* Automatically calculate the length? */
if (_sl.need_length != NL_NONE) {
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp
index 9c44ddb26..1e0f6d887 100644
--- a/src/saveload/station_sl.cpp
+++ b/src/saveload/station_sl.cpp
@@ -259,7 +259,7 @@ static void Load_STNS()
}
}
-void Ptrs_STNS()
+static void Ptrs_STNS()
{
/* Don't run when savegame version is higher than or equal to 123. */
if (!CheckSavegameVersion(123)) return;
diff --git a/src/saveload/subsidy_sl.cpp b/src/saveload/subsidy_sl.cpp
index 62f31ab19..e5c18a2a4 100644
--- a/src/saveload/subsidy_sl.cpp
+++ b/src/saveload/subsidy_sl.cpp
@@ -27,7 +27,7 @@ static const SaveLoad _subsidies_desc[] = {
SLE_END()
};
-void Save_SUBS()
+static void Save_SUBS()
{
Subsidy *s;
FOR_ALL_SUBSIDIES(s) {
@@ -36,7 +36,7 @@ void Save_SUBS()
}
}
-void Load_SUBS()
+static void Load_SUBS()
{
int index;
while ((index = SlIterateArray()) != -1) {
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index f0cc170ca..0e1023909 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -737,7 +737,7 @@ void Load_VEHS()
}
}
-void Ptrs_VEHS()
+static void Ptrs_VEHS()
{
Vehicle *v;
FOR_ALL_VEHICLES(v) {
diff --git a/src/settings.cpp b/src/settings.cpp
index 25f95645c..2ea624c33 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -796,7 +796,7 @@ void SetDifficultyLevel(int mode, DifficultySettings *gm_opt)
* Checks the difficulty levels read from the configuration and
* forces them to be correct when invalid.
*/
-void CheckDifficultyLevels()
+static void CheckDifficultyLevels()
{
if (_settings_newgame.difficulty.diff_level != 3) {
SetDifficultyLevel(_settings_newgame.difficulty.diff_level, &_settings_newgame.difficulty);
@@ -1048,7 +1048,7 @@ static void HandleOldDiffCustom(bool savegame)
* @param name pointer to the string defining name of the old news config
* @param value pointer to the string defining value of the old news config
* @returns true if conversion could have been made */
-bool ConvertOldNewsSetting(const char *name, const char *value)
+static bool ConvertOldNewsSetting(const char *name, const char *value)
{
if (strcasecmp(name, "openclose") == 0) {
/* openclose has been split in "open" and "close".
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 5611f27a5..ad77dd6a0 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1052,7 +1052,7 @@ uint SettingEntry::Draw(GameSettings *settings_ptr, int base_x, int base_y, int
return cur_row;
}
-const void *ResolveVariableAddress(const GameSettings *settings_ptr, const SettingDesc *sd)
+static const void *ResolveVariableAddress(const GameSettings *settings_ptr, const SettingDesc *sd)
{
if ((sd->desc.flags & SGF_PER_COMPANY) != 0) {
if (Company::IsValidID(_local_company) && _game_mode != GM_MENU) {
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index b7104290e..2cf4eff2b 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -141,7 +141,7 @@ bool SpriteExists(SpriteID id)
return !(GetSpriteCache(id)->file_pos == 0 && GetSpriteCache(id)->file_slot == 0);
}
-void *AllocSprite(size_t);
+static void *AllocSprite(size_t);
static void *ReadSprite(SpriteCache *sc, SpriteID id, SpriteType sprite_type)
{
@@ -451,7 +451,7 @@ static void DeleteEntryFromSpriteCache()
}
}
-void *AllocSprite(size_t mem_req)
+static void *AllocSprite(size_t mem_req)
{
mem_req += sizeof(MemBlock);
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 3e12f6d5f..58ffc5ef3 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -917,7 +917,7 @@ CommandCost FindJoiningBaseStation(StationID existing_station, StationID station
* @param st 'return' pointer for the found station
* @return command cost with the error or 'okay'
*/
-CommandCost FindJoiningStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Station **st)
+static CommandCost FindJoiningStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Station **st)
{
return FindJoiningBaseStation<Station, STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST>(existing_station, station_to_join, adjacent, ta, st);
}
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index e4587895f..fea1ab403 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -122,7 +122,7 @@ void DepotSortList(VehicleList *list)
}
/** draw the vehicle profit button in the vehicle list window. */
-void DrawVehicleProfitButton(const Vehicle *v, int x, int y)
+static void DrawVehicleProfitButton(const Vehicle *v, int x, int y)
{
SpriteID pal;
diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h
index 75705ec59..649025ba3 100644
--- a/src/vehicle_gui.h
+++ b/src/vehicle_gui.h
@@ -19,7 +19,6 @@
#include "engine_type.h"
#include "tile_type.h"
-void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent);
/** Constants of vehicle view widget indices */
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp
index bab3eb4ac..9d1366360 100644
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -46,7 +46,7 @@ void Waypoint::UpdateVirtCoord()
* Set the default name for a waypoint
* @param wp Waypoint to work on
*/
-void MakeDefaultWaypointName(Waypoint *wp)
+static void MakeDefaultWaypointName(Waypoint *wp)
{
uint32 used = 0; // bitmap of used waypoint numbers, sliding window with 'next' as base
uint32 next = 0; // first waypoint number in the bitmap
diff --git a/src/waypoint_func.h b/src/waypoint_func.h
index 6c6d79905..d2f22da23 100644
--- a/src/waypoint_func.h
+++ b/src/waypoint_func.h
@@ -22,6 +22,5 @@ CommandCost RemoveBuoy(TileIndex tile, DoCommandFlag flags);
Axis GetAxisForNewWaypoint(TileIndex tile);
void ShowWaypointWindow(const Waypoint *wp);
void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype);
-void MakeDefaultWaypointName(Waypoint *wp);
#endif /* WAYPOINT_FUNC_H */
diff --git a/src/widget.cpp b/src/widget.cpp
index aabd1c573..126dcd3f2 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -2314,7 +2314,7 @@ bool NWidgetLeaf::ButtonHit(const Point &pt)
* @note Caller should release returned widget array with \c free(widgets).
* @ingroup NestedWidgets
*/
-Widget *InitializeNWidgets(NWidgetBase *nwid, bool rtl, int biggest_index)
+static Widget *InitializeNWidgets(NWidgetBase *nwid, bool rtl, int biggest_index)
{
/* Initialize nested widgets. */
nwid->SetupSmallestSize(NULL, false);
diff --git a/src/widget_type.h b/src/widget_type.h
index dab4fad32..f85c2ec3a 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -548,7 +548,6 @@ private:
static Dimension closebox_dimension; ///< Cached size of a closebox widget.
};
-Widget *InitializeNWidgets(NWidgetBase *nwid, bool rtl = false);
bool CompareWidgetArrays(const Widget *orig, const Widget *gen, bool report = true);
/**