mirror of https://github.com/OpenTTD/OpenTTD.git
Fix: Compiler warnings about memsetting non-trivial classes
This commit is contained in:
parent
f8bbd8dea0
commit
d9702c9d20
|
@ -42,8 +42,8 @@ void SetupCargoForClimate(LandscapeID l)
|
|||
assert(l < lengthof(_default_climate_cargo));
|
||||
|
||||
/* Reset and disable all cargo types */
|
||||
memset(CargoSpec::array, 0, sizeof(CargoSpec::array));
|
||||
for (CargoID i = 0; i < lengthof(CargoSpec::array); i++) {
|
||||
*CargoSpec::Get(i) = {};
|
||||
CargoSpec::Get(i)->bitnum = INVALID_CARGO;
|
||||
|
||||
/* Set defaults for newer properties, which old GRFs do not know */
|
||||
|
|
|
@ -1580,7 +1580,7 @@ struct NetworkLobbyWindow : public Window {
|
|||
NetworkTCPQueryServer(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); // company info
|
||||
NetworkUDPQueryServer(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); // general data
|
||||
/* Clear the information so removed companies don't remain */
|
||||
memset(this->company_info, 0, sizeof(this->company_info));
|
||||
for (auto &company : this->company_info) company = {};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue