diff --git a/src/citymania/cm_bitstream.hpp b/src/citymania/cm_bitstream.hpp index 095ca6d..8b80fe2 100644 --- a/src/citymania/cm_bitstream.hpp +++ b/src/citymania/cm_bitstream.hpp @@ -27,7 +27,7 @@ class BitOStream { }; class BitIStreamUnexpectedEnd: public std::exception { - virtual const char* what() const throw() { + const char* what() const noexcept override { return "Unexpected end of bit input stream"; } }; diff --git a/src/citymania/cm_console_cmds.cpp b/src/citymania/cm_console_cmds.cpp index 60ea233..a6f7ae4 100644 --- a/src/citymania/cm_console_cmds.cpp +++ b/src/citymania/cm_console_cmds.cpp @@ -16,7 +16,7 @@ static void IConsoleHelp(const char *str) IConsolePrint(CC_WARNING, "- {}", str); } -bool ConExport(byte argc, char *argv[]) { +bool ConExport(byte argc, [[maybe_unused]] char *argv[]) { if (argc == 0) { IConsoleHelp("Exports various game data in json format to openttd.json file"); return true; diff --git a/src/citymania/cm_export.cpp b/src/citymania/cm_export.cpp index daebe59..cb2b812 100644 --- a/src/citymania/cm_export.cpp +++ b/src/citymania/cm_export.cpp @@ -178,10 +178,7 @@ void WriteHouseSpecInfo(JsonWriter &j) { void WriteCargoSpecInfo(JsonWriter &j) { j.begin_list_with_key("cargo_specs"); - const CargoSpec *cs; - char buffer[128]; char cargo_label[16]; - bool first = true; SetDParam(0, 123); for (const CargoSpec *cs : CargoSpec::Iterate()) { j.begin_dict(); @@ -242,12 +239,11 @@ void WritePaletteInfo(JsonWriter &j) { j.f << "]"; } j.end_list(); - const byte *remap = GetNonSprite(GB(PALETTE_TO_RED, 0, PALETTE_WIDTH), SpriteType::Recolour) + 1; + // const byte *remap = GetNonSprite(GB(PALETTE_TO_RED, 0, PALETTE_WIDTH), SpriteType::Recolour) + 1; } void WriteEngineInfo(JsonWriter &j) { j.begin_list_with_key("engines"); - const Engine *e; for (const Engine *e : Engine::Iterate()) { if (e->type != VEH_TRAIN) continue; j.begin_dict(); diff --git a/src/citymania/cm_game.cpp b/src/citymania/cm_game.cpp index 99ea2bc..95549e0 100644 --- a/src/citymania/cm_game.cpp +++ b/src/citymania/cm_game.cpp @@ -31,7 +31,7 @@ Game::Game() { this->towns_growth_tiles.clear(); }); - this->events.listen(event::Slot::GAME, [this] (const event::TownBuilt &event) { + this->events.listen(event::Slot::GAME, [] (const event::TownBuilt &event) { auto t = event.town; t->cm.hs_total = t->cm.hs_last_month = t->cm.hs_this_month = 0; t->cm.cs_total = t->cm.cs_last_month = t->cm.cs_this_month = 0; @@ -68,13 +68,13 @@ Game::Game() { this->set_town_growth_tile(event.town, event.tile, TownGrowthTileState::NEW_HOUSE); }); - this->events.listen(event::Slot::GAME, [this] (const event::HouseCleared &event) { + this->events.listen(event::Slot::GAME, [] (const event::HouseCleared &event) { if (!event.was_completed) event.town->cm.houses_constructing--; event.town->cm.real_population -= event.house_spec->population; }); - this->events.listen(event::Slot::GAME, [this] (const event::HouseCompleted &event) { + this->events.listen(event::Slot::GAME, [] (const event::HouseCompleted &event) { event.town->cm.houses_constructing--; }); @@ -86,7 +86,7 @@ Game::Game() { } }); - this->events.listen(event::Slot::GAME, [this] (const event::TownCachesRebuilt &event) { + this->events.listen(event::Slot::GAME, [this] (const event::TownCachesRebuilt&) { this->towns_growth_tiles.clear(); this->towns_growth_tiles_last_month.clear(); for (Town *town : Town::Iterate()) { @@ -109,7 +109,7 @@ Game::Game() { } }); - this->events.listen(event::Slot::GAME, [this] (const event::CargoAccepted &event) { + this->events.listen(event::Slot::GAME, [] (const event::CargoAccepted &event) { event.company->cur_economy.cm.cargo_income[event.cargo_type] += event.profit; }); }