diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index c7a389129a..9a5478c090 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -251,7 +251,7 @@ void TextfileWindow::FindHyperlinksInMarkdown(Line &line, size_t line_index) while (matcher != std::sregex_iterator()) { std::smatch match = *matcher; - Hyperlink link; + Hyperlink link{}; link.line = line_index; link.destination = match[2].str(); this->links.push_back(link); diff --git a/src/textfile_gui.h b/src/textfile_gui.h index 95a8e93e7c..ab9acd465c 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -54,10 +54,10 @@ protected: }; struct Hyperlink { - size_t line; ///< Which line the link is on. - size_t begin; ///< Character position on line the link begins. - size_t end; ///< Character position on line the link end. - std::string destination; ///< Destination for the link. + size_t line = 0; ///< Which line the link is on. + size_t begin = 0; ///< Character position on line the link begins. + size_t end = 0; ///< Character position on line the link end. + std::string destination{}; ///< Destination for the link. }; struct HistoryEntry { diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 078d2750e3..1a47376d4e 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -857,7 +857,7 @@ static void AddAcceptedCargo_Town(TileIndex tile, CargoArray &acceptance, CargoT */ CargoArray GetAcceptedCargoOfHouse(const HouseSpec *hs) { - CargoTypes always_accepted; + CargoTypes always_accepted{}; CargoArray acceptance{}; AddAcceptedCargoOfHouse(INVALID_TILE, hs->Index(), hs, nullptr, acceptance, always_accepted); return acceptance;