From 77fe95f55270cf856cbd088182fd2ea617d48bf0 Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 1 Oct 2010 16:42:28 +0000 Subject: [PATCH] (svn r20860) -Cleanup: remove some unused functions and variables --- src/company_gui.cpp | 2 -- src/economy.cpp | 16 ---------------- src/pathfinder/npf/aystar.cpp | 5 ----- src/roadveh_cmd.cpp | 3 +-- src/saveload/engine_sl.cpp | 4 +--- src/saveload/labelmaps_sl.cpp | 3 +-- src/settings.cpp | 21 --------------------- src/thread/thread_pthread.cpp | 2 +- src/town_cmd.cpp | 5 +---- 9 files changed, 5 insertions(+), 56 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 5bb4efd48a..d2eb299b34 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -35,8 +35,6 @@ #include "table/strings.h" /** Company GUI constants. */ -static const int FIRST_GUI_CALL = INT_MAX; ///< default value to specify this is the first call of the resizable gui - static const uint EXP_LINESPACE = 2; ///< Amount of vertical space for a horizontal (sub-)total line. static const uint EXP_BLOCKSPACE = 10; ///< Amount of vertical space between two blocks of numbers. diff --git a/src/economy.cpp b/src/economy.cpp index 6d5f997610..9c79d4423d 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -71,22 +71,6 @@ static inline int32 BigMulS(const int32 a, const int32 b, const uint8 shift) return (int32)((int64)a * (int64)b >> shift); } -/** - * Multiply two unsigned integers and shift the results to right. - * - * This function multiplies two unsigned integers. The result is - * shifted by the amount of shift to right. - * - * @param a The first unsigned integer - * @param b The second unsigned integer - * @param shift The amount to shift the value to right. - * @return The shifted result - */ -static inline uint32 BigMulSU(const uint32 a, const uint32 b, const uint8 shift) -{ - return (uint32)((uint64)a * (uint64)b >> shift); -} - typedef SmallVector SmallIndustryList; /** diff --git a/src/pathfinder/npf/aystar.cpp b/src/pathfinder/npf/aystar.cpp index f2e05ec5b9..150b86b56f 100644 --- a/src/pathfinder/npf/aystar.cpp +++ b/src/pathfinder/npf/aystar.cpp @@ -29,9 +29,6 @@ #include "../../core/alloc_func.hpp" #include "aystar.h" -static int _aystar_stats_open_size; -static int _aystar_stats_closed_size; - /* This looks in the Hash if a node exists in ClosedList * If so, it returns the PathNode, else NULL */ static PathNode *AyStarMain_ClosedList_IsInList(AyStar *aystar, const AyStarNode *node) @@ -257,8 +254,6 @@ int AyStarMain_Main(AyStar *aystar) #endif if (r != AYSTAR_STILL_BUSY) { /* We're done, clean up */ - _aystar_stats_open_size = aystar->OpenListHash.size; - _aystar_stats_closed_size = aystar->ClosedListHash.size; aystar->clear(aystar); } diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 1391d8cb75..2689af8a57 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1251,8 +1251,7 @@ again: Trackdir dir; uint turn_around_start_frame = RVC_TURN_AROUND_START_FRAME; - RoadBits tram; - if (v->roadtype == ROADTYPE_TRAM && !IsRoadDepotTile(v->tile) && HasExactlyOneBit(tram = GetAnyRoadBits(v->tile, ROADTYPE_TRAM, true))) { + if (v->roadtype == ROADTYPE_TRAM && !IsRoadDepotTile(v->tile) && HasExactlyOneBit(GetAnyRoadBits(v->tile, ROADTYPE_TRAM, true))) { /* * The tram is turning around with one tram 'roadbit'. This means that * it is using the 'big' corner 'drive data'. However, to support the diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 038717e3fb..188db2deab 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -137,11 +137,9 @@ static void Save_EIDS() static void Load_EIDS() { - int index; - _engine_mngr.Clear(); - while ((index = SlIterateArray()) != -1) { + while (SlIterateArray() != -1) { EngineIDMapping *eid = _engine_mngr.Append(); SlObject(eid, _engine_id_mapping_desc); } diff --git a/src/saveload/labelmaps_sl.cpp b/src/saveload/labelmaps_sl.cpp index 67d06d485f..5cc77af0ce 100644 --- a/src/saveload/labelmaps_sl.cpp +++ b/src/saveload/labelmaps_sl.cpp @@ -109,9 +109,8 @@ static void Load_RAIL() _railtype_list.Clear(); LabelObject lo; - int index; - while ((index = SlIterateArray()) != -1) { + while (SlIterateArray() != -1) { SlObject(&lo, _label_object_desc); *_railtype_list.Append() = (RailTypeLabel)lo.label; } diff --git a/src/settings.cpp b/src/settings.cpp index b3ef6e6c2e..82ddb9a144 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1948,17 +1948,6 @@ static void LoadSettings(const SettingDesc *osd, void *object) } } -/** - * Loadhandler for a list of global variables - * @param sdg pointer for the global variable list SettingDescGlobVarList - * @note this is actually a stub for LoadSettings with the - * object pointer set to NULL - */ -static inline void LoadSettingsGlobList(const SettingDescGlobVarList *sdg) -{ - LoadSettings((const SettingDesc*)sdg, NULL); -} - /** * Save and load handler for settings * @param sd SettingDesc struct containing all information @@ -1982,16 +1971,6 @@ static void SaveSettings(const SettingDesc *sd, void *object) } } -/** - * Savehandler for a list of global variables - * @note this is actually a stub for SaveSettings with the - * object pointer set to NULL - */ -static inline void SaveSettingsGlobList(const SettingDescGlobVarList *sdg) -{ - SaveSettings((const SettingDesc*)sdg, NULL); -} - static void Load_OPTS() { /* Copy over default setting since some might not get loaded in diff --git a/src/thread/thread_pthread.cpp b/src/thread/thread_pthread.cpp index e2af7bac4e..ab46c0a0a4 100644 --- a/src/thread/thread_pthread.cpp +++ b/src/thread/thread_pthread.cpp @@ -71,7 +71,7 @@ private: /* Call the proc of the creator to continue this thread */ try { this->proc(this->param); - } catch (OTTDThreadExitSignal e) { + } catch (OTTDThreadExitSignal) { } catch (...) { NOT_REACHED(); } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index bef8301eeb..d2a983ddcd 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -51,8 +51,6 @@ #include "table/strings.h" #include "table/town_land.h" -static Town *_cleared_town; -static int _cleared_town_rating; TownID _new_town_id; /* Initialize the town-pool */ @@ -542,8 +540,7 @@ static CommandCost ClearTile_Town(TileIndex tile, DoCommandFlag flags) cost.AddCost(hs->GetRemovalCost()); int rating = hs->remove_rating_decrease; - _cleared_town_rating += rating; - Town *t = _cleared_town = Town::GetByTile(tile); + Town *t = Town::GetByTile(tile); if (Company::IsValidID(_current_company)) { if (rating > t->ratings[_current_company] && !(flags & DC_NO_TEST_TOWN_RATING) && !_cheats.magic_bulldozer.value) {