summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cargotype.cpp2
-rw-r--r--src/network/network_gui.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cargotype.cpp b/src/cargotype.cpp
index 52dd196c8..8421c482e 100644
--- a/src/cargotype.cpp
+++ b/src/cargotype.cpp
@@ -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 */
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index ab72d9521..c430c47e5 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -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;
}
}