summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-10-01 16:42:28 +0000
committersmatz <smatz@openttd.org>2010-10-01 16:42:28 +0000
commit77fe95f55270cf856cbd088182fd2ea617d48bf0 (patch)
tree815b5cf915f4510e7ba8e19dbcd9bc956e7cfe75 /src
parent7f5f4950d7c1ffd09b1425263b202372c73c752e (diff)
downloadopenttd-77fe95f55270cf856cbd088182fd2ea617d48bf0.tar.xz
(svn r20860) -Cleanup: remove some unused functions and variables
Diffstat (limited to 'src')
-rw-r--r--src/company_gui.cpp2
-rw-r--r--src/economy.cpp16
-rw-r--r--src/pathfinder/npf/aystar.cpp5
-rw-r--r--src/roadveh_cmd.cpp3
-rw-r--r--src/saveload/engine_sl.cpp4
-rw-r--r--src/saveload/labelmaps_sl.cpp3
-rw-r--r--src/settings.cpp21
-rw-r--r--src/thread/thread_pthread.cpp2
-rw-r--r--src/town_cmd.cpp5
9 files changed, 5 insertions, 56 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 5bb4efd48..d2eb299b3 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 6d5f99761..9c79d4423 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<Industry *, 16> SmallIndustryList;
/**
diff --git a/src/pathfinder/npf/aystar.cpp b/src/pathfinder/npf/aystar.cpp
index f2e05ec5b..150b86b56 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 1391d8cb7..2689af8a5 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 038717e3f..188db2dea 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 67d06d485..5cc77af0c 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 b3ef6e6c2..82ddb9a14 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1949,17 +1949,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
* @param object can be either NULL in which case we load global variables or
@@ -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 e2af7bac4..ab46c0a0a 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 bef8301ee..d2a983ddc 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) {