diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index e100b456c1..a88f56aa02 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 ef8b7657ed..5630c01bbb 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 58f0850f94..27170551ab 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 2817346efb..80f0f6f180 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 1e16fdc063..695b842ade 100644 --- a/src/bridge_map.h +++ b/src/bridge_map.h @@ -93,13 +93,6 @@ static inline Axis GetBridgeAxis(TileIndex t) return (Axis)(GB(_m[t].m6, 6, 2) - 1); } -/** - * 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 f0f97686ab..c8bb2a5644 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -534,6 +534,53 @@ IConsoleVar *IConsoleVarGet(const char *name) return NULL; } +/** + * 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 @@ -618,43 +665,6 @@ static uint32 IConsoleVarGetValue(const IConsoleVar *var) return result; } -/** - * 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 */ @@ -672,16 +682,6 @@ void IConsoleVarPrintGetValue(const IConsoleVar *var) IConsolePrintF(CC_WARNING, "Current value for '%s' is: %s", var->name, value); } -/** - * 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 @@ -689,7 +689,7 @@ void IConsoleVarPrintSetValue(const IConsoleVar *var) * @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 2486f7588a..4c0a2c1761 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 72e8ab57ec..f36ee39508 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 45d88b82ca..858ac5abba 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 b2d2da8032..4b42e4908a 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 7ccdfb9311..43852fa291 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(size); } diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 941e7bfec5..d89f134fdb 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 70e01886b9..686951a75a 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 26c662b3d4..5bf0bff5ca 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 42b66ca12c..7080ac4a8e 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 acf1afb2d3..b9d812ede9 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 5686102f17..84eb246659 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 0c2690610d..ed7f2127f9 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 ae19c97c19..06445d5581 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 eca108f021..855ee1afa5 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 5e802f786a..705270186a 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 ff610554fa..9b59155898 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 d5f98ff498..bea758e2cc 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 332447b6c4..7acac29379 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 3eb4ae6f5d..76025aee77 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 9c44ddb264..1e0f6d8875 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 62f31ab196..e5c18a2a41 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 f0cc170caa..0e1023909d 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 25f95645c5..2ea624c331 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 5611f27a57..ad77dd6a0b 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 b7104290e3..2cf4eff2b9 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 3e12f6d5f4..58ffc5ef30 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(existing_station, station_to_join, adjacent, ta, st); } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index e4587895f2..fea1ab403d 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 75705ec594..649025ba3e 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 bab3eb4ac7..9d13663605 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 6c6d799055..d2f22da236 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 aabd1c5734..126dcd3f24 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 dab4fad327..f85c2ec3ac 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); /**