Codechange: Silence warnings about intentionally unused parameters.

This commit is contained in:
frosch
2023-09-16 22:20:53 +02:00
committed by frosch
parent df400ef84a
commit b6c8f301be
227 changed files with 972 additions and 1039 deletions

View File

@@ -34,7 +34,7 @@ static const SaveLoad _game_script_desc[] = {
SLEG_VAR("is_random", _game_saveload_is_random, SLE_BOOL),
};
static void SaveReal_GSDT(int *index_ptr)
static void SaveReal_GSDT(int *)
{
GameConfig *config = GameConfig::GetConfig();

View File

@@ -638,7 +638,7 @@ static bool LoadOldOrder(LoadgameState *ls, int num)
return true;
}
static bool LoadOldAnimTileList(LoadgameState *ls, int num)
static bool LoadOldAnimTileList(LoadgameState *ls, int)
{
TileIndex anim_list[256];
const OldChunks anim_chunk[] = {
@@ -894,7 +894,7 @@ static const OldChunks _company_economy_chunk[] = {
OCL_END()
};
static bool LoadOldCompanyEconomy(LoadgameState *ls, int num)
static bool LoadOldCompanyEconomy(LoadgameState *ls, int)
{
Company *c = Company::Get(_current_company_id);
@@ -1097,7 +1097,7 @@ static const OldChunks vehicle_empty_chunk[] = {
OCL_END()
};
static bool LoadOldVehicleUnion(LoadgameState *ls, int num)
static bool LoadOldVehicleUnion(LoadgameState *ls, int)
{
Vehicle *v = Vehicle::GetIfValid(_current_vehicle_id);
uint temp = ls->total_read;
@@ -1464,7 +1464,7 @@ static const OldChunks game_difficulty_chunk[] = {
OCL_END()
};
static bool LoadOldGameDifficulty(LoadgameState *ls, int num)
static bool LoadOldGameDifficulty(LoadgameState *ls, int)
{
bool ret = LoadChunk(ls, &_settings_game.difficulty, game_difficulty_chunk);
_settings_game.difficulty.max_loan *= 1000;
@@ -1472,7 +1472,7 @@ static bool LoadOldGameDifficulty(LoadgameState *ls, int num)
}
static bool LoadOldMapPart1(LoadgameState *ls, int num)
static bool LoadOldMapPart1(LoadgameState *ls, int)
{
if (_savegame_type == SGT_TTO) {
Map::Allocate(OLD_MAP_SIZE, OLD_MAP_SIZE);
@@ -1502,7 +1502,7 @@ static bool LoadOldMapPart1(LoadgameState *ls, int num)
return true;
}
static bool LoadOldMapPart2(LoadgameState *ls, int num)
static bool LoadOldMapPart2(LoadgameState *ls, int)
{
uint i;
@@ -1516,7 +1516,7 @@ static bool LoadOldMapPart2(LoadgameState *ls, int num)
return true;
}
static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int)
{
ReadTTDPatchFlags();

View File

@@ -1711,7 +1711,7 @@ void SlObject(void *object, const SaveLoadTable &slt)
* is not known to the code. This means we are going to skip it.
*/
class SlSkipHandler : public SaveLoadHandler {
void Save(void *object) const override
void Save(void *) const override
{
NOT_REACHED();
}
@@ -2339,9 +2339,8 @@ struct LZOSaveFilter : SaveFilter {
/**
* Initialise this filter.
* @param chain The next filter in this chain.
* @param compression_level The requested level of compression.
*/
LZOSaveFilter(SaveFilter *chain, byte compression_level) : SaveFilter(chain)
LZOSaveFilter(SaveFilter *chain, byte) : SaveFilter(chain)
{
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
}
@@ -2396,9 +2395,8 @@ struct NoCompSaveFilter : SaveFilter {
/**
* Initialise this filter.
* @param chain The next filter in this chain.
* @param compression_level The requested level of compression.
*/
NoCompSaveFilter(SaveFilter *chain, byte compression_level) : SaveFilter(chain)
NoCompSaveFilter(SaveFilter *chain, byte) : SaveFilter(chain)
{
}

View File

@@ -493,25 +493,25 @@ public:
* Save the object to disk.
* @param object The object to store.
*/
virtual void Save(void *object) const {}
virtual void Save([[maybe_unused]] void *object) const {}
/**
* Load the object from disk.
* @param object The object to load.
*/
virtual void Load(void *object) const {}
virtual void Load([[maybe_unused]] void *object) const {}
/**
* Similar to load, but used only to validate savegames.
* @param object The object to load.
*/
virtual void LoadCheck(void *object) const {}
virtual void LoadCheck([[maybe_unused]] void *object) const {}
/**
* A post-load callback to fix #SL_REF integers into pointers.
* @param object The object to fix.
*/
virtual void FixPointers(void *object) const {}
virtual void FixPointers([[maybe_unused]] void *object) const {}
/**
* Get the description of the fields in the savegame.
@@ -548,16 +548,16 @@ public:
SaveLoadTable GetDescription() const override { return static_cast<const TImpl *>(this)->description; }
SaveLoadCompatTable GetCompatDescription() const override { return static_cast<const TImpl *>(this)->compat_description; }
virtual void Save(TObject *object) const {}
virtual void Save([[maybe_unused]] TObject *object) const {}
void Save(void *object) const override { this->Save(static_cast<TObject *>(object)); }
virtual void Load(TObject *object) const {}
virtual void Load([[maybe_unused]] TObject *object) const {}
void Load(void *object) const override { this->Load(static_cast<TObject *>(object)); }
virtual void LoadCheck(TObject *object) const {}
virtual void LoadCheck([[maybe_unused]] TObject *object) const {}
void LoadCheck(void *object) const override { this->LoadCheck(static_cast<TObject *>(object)); }
virtual void FixPointers(TObject *object) const {}
virtual void FixPointers([[maybe_unused]] TObject *object) const {}
void FixPointers(void *object) const override { this->FixPointers(static_cast<TObject *>(object)); }
};

View File

@@ -190,7 +190,7 @@ public:
};
inline const static SaveLoadCompatTable compat_description = _town_acceptance_matrix_sl_compat;
void Load(Town *t) const override
void Load(Town *) const override
{
/* Discard now unused acceptance matrix. */
AcceptanceMatrix dummy;