diff options
author | tron <tron@openttd.org> | 2006-02-02 07:15:46 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-02 07:15:46 +0000 |
commit | b844aa2db3f7ee77ffee09bdfb2fd9f2dc13b924 (patch) | |
tree | 986bf53fde84b3cd16b658ae7ff1a59b2d28e5ec | |
parent | 21fb5b5150672011d9bc57e227f6d6747a8938de (diff) | |
download | openttd-b844aa2db3f7ee77ffee09bdfb2fd9f2dc13b924.tar.xz |
(svn r3520) Remove unused parameters from some functions
-rw-r--r-- | aircraft_gui.c | 4 | ||||
-rw-r--r-- | newgrf.c | 4 | ||||
-rw-r--r-- | road_cmd.c | 2 | ||||
-rw-r--r-- | roadveh_gui.c | 4 | ||||
-rw-r--r-- | saveload.c | 27 | ||||
-rw-r--r-- | ship_gui.c | 4 | ||||
-rw-r--r-- | town.h | 2 | ||||
-rw-r--r-- | town_cmd.c | 22 | ||||
-rw-r--r-- | train_gui.c | 4 | ||||
-rw-r--r-- | tree_cmd.c | 8 | ||||
-rw-r--r-- | tunnelbridge_cmd.c | 5 |
11 files changed, 44 insertions, 42 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c index ed6ceb376..3898f9040 100644 --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -764,7 +764,7 @@ static void HandleCloneVehClick(const Vehicle* v, const Window* w) ResetObjectToPlace(); } -static void ClonePlaceObj(TileIndex tile, const Window* w) +static void ClonePlaceObj(const Window* w) { const Vehicle* v = CheckMouseOverVehicle(); @@ -810,7 +810,7 @@ static void AircraftDepotWndProc(Window *w, WindowEvent *e) break; case WE_PLACE_OBJ: { - ClonePlaceObj(e->place.tile, w); + ClonePlaceObj(w); } break; case WE_ABORT_PLACE_OBJ: { @@ -2575,7 +2575,7 @@ static void CalculateRefitMasks(void) /* XXX: We consider GRF files trusted. It would be trivial to exploit OTTD by * a crafted invalid GRF file. We should tell that to the user somehow, or * better make this more robust in the future. */ -static void DecodeSpecialSprite(const char* filename, uint num, uint stage) +static void DecodeSpecialSprite(uint num, uint stage) { /* XXX: There is a difference between staged loading in TTDPatch and * here. In TTDPatch, for some reason actions 1 and 2 are carried out @@ -2671,7 +2671,7 @@ static void LoadNewGRFFile(const char* filename, uint file_index, uint stage) if (type == 0xFF) { if (_skip_sprites == 0) { - DecodeSpecialSprite(filename, num, stage); + DecodeSpecialSprite(num, stage); continue; } else { FioSkipBytes(num); diff --git a/road_cmd.c b/road_cmd.c index 8bbd33c97..85a029585 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -204,7 +204,7 @@ int32 CmdRemoveRoad(int x, int y, uint32 flags, uint32 p1, uint32 p2) } else if (ti.type == MP_STREET) { // check if you're allowed to remove the street owned by a town // removal allowance depends on difficulty setting - if (!CheckforTownRating(tile, flags, t, ROAD_REMOVE)) return CMD_ERROR; + if (!CheckforTownRating(flags, t, ROAD_REMOVE)) return CMD_ERROR; // XXX - change cascading ifs to switch when doing rewrite if ((ti.map5 & 0xF0) == 0) { // normal road diff --git a/roadveh_gui.c b/roadveh_gui.c index 6d58567e3..c4d8017c1 100644 --- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -670,7 +670,7 @@ static void HandleCloneVehClick(const Vehicle* v, const Window* w) ResetObjectToPlace(); } -static void ClonePlaceObj(TileIndex tile, const Window* w) +static void ClonePlaceObj(const Window* w) { const Vehicle* v = CheckMouseOverVehicle(); @@ -715,7 +715,7 @@ static void RoadDepotWndProc(Window *w, WindowEvent *e) } break; case WE_PLACE_OBJ: { - ClonePlaceObj(e->place.tile, w); + ClonePlaceObj(w); } break; case WE_ABORT_PLACE_OBJ: { diff --git a/saveload.c b/saveload.c index f521ff7d6..210022039 100644 --- a/saveload.c +++ b/saveload.c @@ -445,11 +445,13 @@ static const byte _conv_lengths[] = {1, 1, 2, 2, 4, 4, 8, 8, 2}; /** * Return the size in bytes of a certain type of normal/atomic variable - * @param var The variable the size is being asked of (NOTICE: unused) * @param conv @VarType type of variable that is used for calculating the size * @return Return the size of this type in byes */ -static inline size_t SlCalcConvLen(const void *var, VarType conv) {return _conv_lengths[conv & 0xF];} +static inline size_t SlCalcConvLen(VarType conv) +{ + return _conv_lengths[conv & 0xF]; +} /** * Return the size in bytes of a reference (pointer) @@ -458,11 +460,13 @@ static inline size_t SlCalcRefLen(void) {return 2;} /** * Return the size in bytes of a certain type of atomic array - * @param array The variable the size is being asked of (NOTICE: unused) * @param length The length of the array counted in elements * @param conv @VarType type of the variable that is used in calculating the size */ -static inline size_t SlCalcArrayLen(const void *array, uint length, VarType conv) {return _conv_lengths[conv & 0xF] * length;} +static inline size_t SlCalcArrayLen(uint length, VarType conv) +{ + return _conv_lengths[conv & 0xF] * length; +} /** * Save/Load an array. @@ -476,7 +480,7 @@ void SlArray(void *array, uint length, VarType conv) // Automatically calculate the length? if (_sl.need_length != NL_NONE) { - SlSetLength(SlCalcArrayLen(array, length, conv)); + SlSetLength(SlCalcArrayLen(length, conv)); // Determine length only? if (_sl.need_length == NL_CALCLENGTH) return; @@ -509,10 +513,9 @@ void SlArray(void *array, uint length, VarType conv) /** * Calculate the size of an object. - * @param object Object that needs its length calculated * @param sld The @SaveLoad description of the object so we know how to manipulate it */ -static size_t SlCalcObjLength(void *object, const SaveLoad *sld) +static size_t SlCalcObjLength(const SaveLoad *sld) { size_t length = 0; @@ -527,17 +530,17 @@ static size_t SlCalcObjLength(void *object, const SaveLoad *sld) switch (sld->cmd) { case SL_VAR: case SL_CONDVAR: /* Normal Variable */ - length += SlCalcConvLen(NULL, sld->type); break; + length += SlCalcConvLen(sld->type); break; case SL_REF: case SL_CONDREF: /* Reference variable */ length += SlCalcRefLen(); break; case SL_ARR: case SL_CONDARR: /* Array */ - length += SlCalcArrayLen(NULL, sld->length, sld->type); break; + length += SlCalcArrayLen(sld->length, sld->type); break; default: NOT_REACHED(); } } else if (sld->cmd == SL_WRITEBYTE) { length++; // a byte is logically of size 1 } else if (sld->cmd == SL_INCLUDE) { - length += SlCalcObjLength(NULL, _sl.includes[sld->version_from]); + length += SlCalcObjLength(_sl.includes[sld->version_from]); } else assert(sld->cmd == SL_END); } @@ -553,7 +556,7 @@ void SlObject(void *object, const SaveLoad *sld) { // Automatically calculate the length? if (_sl.need_length != NL_NONE) { - SlSetLength(SlCalcObjLength(object, sld)); + SlSetLength(SlCalcObjLength(sld)); if (_sl.need_length == NL_CALCLENGTH) return; } @@ -615,7 +618,7 @@ static size_t SlCalcGlobListLength(const SaveLoadGlobVarList *desc) for (; desc->address != NULL; desc++) { // Of course the global variable must exist in the sought savegame version if (_sl_version >= desc->from_version && _sl_version <= desc->to_version) - length += SlCalcConvLen(NULL, desc->conv); + length += SlCalcConvLen(desc->conv); } return length; } diff --git a/ship_gui.c b/ship_gui.c index f8f154ed1..32c4822fe 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -748,7 +748,7 @@ static void HandleCloneVehClick(const Vehicle* v, const Window* w) ResetObjectToPlace(); } -static void ClonePlaceObj(TileIndex tile, const Window* w) +static void ClonePlaceObj(const Window* w) { const Vehicle* v = CheckMouseOverVehicle(); @@ -793,7 +793,7 @@ static void ShipDepotWndProc(Window* w, WindowEvent* e) break; case WE_PLACE_OBJ: { - ClonePlaceObj(w->window_number, w); + ClonePlaceObj(w); } break; case WE_ABORT_PLACE_OBJ: { @@ -128,7 +128,7 @@ enum { RATING_BRIBE_DOWN_TO = -50 // XXX SHOULD BE SOMETHING LOWER? }; -bool CheckforTownRating(TileIndex tile, uint32 flags, Town *t, byte type); +bool CheckforTownRating(uint32 flags, Town *t, byte type); VARDEF uint16 *_town_sort; diff --git a/town_cmd.c b/town_cmd.c index fdf1e6a41..4811651b6 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -1118,7 +1118,7 @@ bool GenerateTowns(void) return true; } -static bool CheckBuildHouseMode(Town *t1, TileIndex tile, uint tileh, int mode) +static bool CheckBuildHouseMode(TileIndex tile, uint tileh, int mode) { int b; uint slope; @@ -1159,7 +1159,7 @@ int GetTownRadiusGroup(const Town *t, TileIndex tile) return smallest; } -static bool CheckFree2x2Area(Town *t1, TileIndex tile) +static bool CheckFree2x2Area(TileIndex tile) { int i; @@ -1248,24 +1248,24 @@ static void DoBuildTownHouse(Town *t, TileIndex tile) if (_housetype_extra_flags[house] & 0x12 && slope) continue; if (_housetype_extra_flags[house] & 0x10) { - if (CheckFree2x2Area(t, tile) || - CheckFree2x2Area(t, (tile += TileDiffXY(-1, 0))) || - CheckFree2x2Area(t, (tile += TileDiffXY( 0, -1))) || - CheckFree2x2Area(t, (tile += TileDiffXY( 1, 0)))) { + if (CheckFree2x2Area(tile) || + CheckFree2x2Area(tile += TileDiffXY(-1, 0)) || + CheckFree2x2Area(tile += TileDiffXY( 0, -1)) || + CheckFree2x2Area(tile += TileDiffXY( 1, 0))) { break; } tile += TileDiffXY(0, 1); } else if (_housetype_extra_flags[house] & 4) { - if (CheckBuildHouseMode(t, tile + TileDiffXY(1, 0), slope, 0)) break; + if (CheckBuildHouseMode(tile + TileDiffXY(1, 0), slope, 0)) break; - if (CheckBuildHouseMode(t, tile + TileDiffXY(-1, 0), slope, 1)) { + if (CheckBuildHouseMode(tile + TileDiffXY(-1, 0), slope, 1)) { tile += TileDiffXY(-1, 0); break; } } else if (_housetype_extra_flags[house] & 8) { - if (CheckBuildHouseMode(t, tile + TileDiffXY(0, 1), slope, 2)) break; + if (CheckBuildHouseMode(tile + TileDiffXY(0, 1), slope, 2)) break; - if (CheckBuildHouseMode(t, tile + TileDiffXY(0, -1), slope, 3)) { + if (CheckBuildHouseMode(tile + TileDiffXY(0, -1), slope, 3)) { tile += TileDiffXY(0, -1); break; } @@ -1886,7 +1886,7 @@ static const int _default_rating_settings [3][3] = { { 96, 384, 768}, // Hostile }; -bool CheckforTownRating(TileIndex tile, uint32 flags, Town *t, byte type) +bool CheckforTownRating(uint32 flags, Town *t, byte type) { int modemod; diff --git a/train_gui.c b/train_gui.c index 4fc4f264f..f3fd603b6 100644 --- a/train_gui.c +++ b/train_gui.c @@ -618,7 +618,7 @@ static void HandleCloneVehClick(const Vehicle* v, const Window* w) ResetObjectToPlace(); } -static void ClonePlaceObj(TileIndex tile, const Window* w) +static void ClonePlaceObj(const Window* w) { Vehicle* v = CheckMouseOverVehicle(); @@ -661,7 +661,7 @@ static void TrainDepotWndProc(Window *w, WindowEvent *e) } break; case WE_PLACE_OBJ: { - ClonePlaceObj(e->place.tile, w); + ClonePlaceObj(w); } break; case WE_ABORT_PLACE_OBJ: { diff --git a/tree_cmd.c b/tree_cmd.c index 8fbf4a670..174bfd8d6 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -36,7 +36,7 @@ static int GetRandomTreeType(TileIndex tile, uint seed) } } -static void PlaceTree(TileIndex tile, uint32 r, byte m5_or) +static void PlaceTree(TileIndex tile, uint32 r) { int tree = GetRandomTreeType(tile, GB(r, 24, 8)); byte m5; @@ -78,7 +78,7 @@ static void DoPlaceMoreTrees(TileIndex tile) IsTileType(cur_tile, MP_CLEAR) && !IsClearGround(cur_tile, CL_FIELDS) && !IsClearGround(cur_tile, CL_ROCKS)) { - PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0); + PlaceTree(cur_tile, r); } } } @@ -102,7 +102,7 @@ void PlaceTreesRandomly(void) if (IsTileType(tile, MP_CLEAR) && !IsClearGround(tile, CL_FIELDS) && !IsClearGround(tile, CL_ROCKS)) { - PlaceTree(tile, r, 0); + PlaceTree(tile, r); } } while (--i); @@ -114,7 +114,7 @@ void PlaceTreesRandomly(void) uint32 r = Random(); TileIndex tile = RandomTileSeed(r); if (IsTileType(tile, MP_CLEAR) && GetMapExtraBits(tile) == 2) { - PlaceTree(tile, r, 0); + PlaceTree(tile, r); } } while (--i); } diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 19fb0330d..bcec4f093 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -663,7 +663,7 @@ static int32 DoClearTunnel(TileIndex tile, uint32 flags) // check if you're allowed to remove the tunnel owned by a town // removal allowal depends on difficulty settings if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) { - if (!CheckforTownRating(tile, flags, t, TUNNELBRIDGE_REMOVE)) { + if (!CheckforTownRating(flags, t, TUNNELBRIDGE_REMOVE)) { SetDParam(0, t->index); return_cmd_error(STR_2009_LOCAL_AUTHORITY_REFUSES); } @@ -788,8 +788,7 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags) // check if you're allowed to remove the bridge owned by a town. // removal allowal depends on difficulty settings if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) { - if (!CheckforTownRating(tile, flags, t, TUNNELBRIDGE_REMOVE)) - return CMD_ERROR; + if (!CheckforTownRating(flags, t, TUNNELBRIDGE_REMOVE)) return CMD_ERROR; } if (flags & DC_EXEC) { |