From 8ef3a3d463eabc5d4dd93c6bed2bc5b1f6d43053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Tue, 2 Jul 2024 11:04:07 +0200 Subject: [PATCH] Codefix: "maybe uninitialized" warnings for linux generic release build (#12838) --- src/industry_gui.cpp | 2 +- src/newgrf_class.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index d083ce261b..0b0693e8e4 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -375,7 +375,7 @@ class BuildIndustryWindow : public Window { std::string cargostring; size_t numcargo = 0; - size_t firstcargo; + size_t firstcargo = 0; for (size_t j = 0; j < cargolist.size(); j++) { if (!IsValidCargoID(cargolist[j])) continue; diff --git a/src/newgrf_class.h b/src/newgrf_class.h index e04c86adac..e206ad0004 100644 --- a/src/newgrf_class.h +++ b/src/newgrf_class.h @@ -29,7 +29,7 @@ private: static_assert(std::is_base_of_v, Tspec>); uint ui_count = 0; ///< Number of specs in this class potentially available to the user. - Tindex index; ///< Index of class within the list of classes. + Tindex index = static_cast(0); ///< Index of class within the list of classes. std::vector spec; ///< List of specifications. /**