Fix compilation warnings
This commit is contained in:
@@ -27,7 +27,7 @@ public:
|
||||
};
|
||||
|
||||
class BitIStreamUnexpectedEnd: public std::exception {
|
||||
virtual const char* what() const throw() {
|
||||
const char* what() const noexcept override {
|
||||
return "Unexpected end of bit input stream";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -31,7 +31,7 @@ Game::Game() {
|
||||
this->towns_growth_tiles.clear();
|
||||
});
|
||||
|
||||
this->events.listen<event::TownBuilt>(event::Slot::GAME, [this] (const event::TownBuilt &event) {
|
||||
this->events.listen<event::TownBuilt>(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::HouseCleared>(event::Slot::GAME, [this] (const event::HouseCleared &event) {
|
||||
this->events.listen<event::HouseCleared>(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::HouseCompleted>(event::Slot::GAME, [this] (const event::HouseCompleted &event) {
|
||||
this->events.listen<event::HouseCompleted>(event::Slot::GAME, [] (const event::HouseCompleted &event) {
|
||||
event.town->cm.houses_constructing--;
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ Game::Game() {
|
||||
}
|
||||
});
|
||||
|
||||
this->events.listen<event::TownCachesRebuilt>(event::Slot::GAME, [this] (const event::TownCachesRebuilt &event) {
|
||||
this->events.listen<event::TownCachesRebuilt>(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::CargoAccepted>(event::Slot::GAME, [this] (const event::CargoAccepted &event) {
|
||||
this->events.listen<event::CargoAccepted>(event::Slot::GAME, [] (const event::CargoAccepted &event) {
|
||||
event.company->cur_economy.cm.cargo_income[event.cargo_type] += event.profit;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user