1
0
Fork 0

Codefix: initialise a few uninitialised variables

pull/9953/merge
Rubidium 2025-03-08 17:08:12 +01:00 committed by rubidium42
parent 8a243f7391
commit 0b102db421
3 changed files with 6 additions and 6 deletions

View File

@ -251,7 +251,7 @@ void TextfileWindow::FindHyperlinksInMarkdown(Line &line, size_t line_index)
while (matcher != std::sregex_iterator()) { while (matcher != std::sregex_iterator()) {
std::smatch match = *matcher; std::smatch match = *matcher;
Hyperlink link; Hyperlink link{};
link.line = line_index; link.line = line_index;
link.destination = match[2].str(); link.destination = match[2].str();
this->links.push_back(link); this->links.push_back(link);

View File

@ -54,10 +54,10 @@ protected:
}; };
struct Hyperlink { struct Hyperlink {
size_t line; ///< Which line the link is on. size_t line = 0; ///< Which line the link is on.
size_t begin; ///< Character position on line the link begins. size_t begin = 0; ///< Character position on line the link begins.
size_t end; ///< Character position on line the link end. size_t end = 0; ///< Character position on line the link end.
std::string destination; ///< Destination for the link. std::string destination{}; ///< Destination for the link.
}; };
struct HistoryEntry { struct HistoryEntry {

View File

@ -857,7 +857,7 @@ static void AddAcceptedCargo_Town(TileIndex tile, CargoArray &acceptance, CargoT
*/ */
CargoArray GetAcceptedCargoOfHouse(const HouseSpec *hs) CargoArray GetAcceptedCargoOfHouse(const HouseSpec *hs)
{ {
CargoTypes always_accepted; CargoTypes always_accepted{};
CargoArray acceptance{}; CargoArray acceptance{};
AddAcceptedCargoOfHouse(INVALID_TILE, hs->Index(), hs, nullptr, acceptance, always_accepted); AddAcceptedCargoOfHouse(INVALID_TILE, hs->Index(), hs, nullptr, acceptance, always_accepted);
return acceptance; return acceptance;