Codechange: Pass WindowDesc by reference instead of pointer. (#12771)

WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
This commit is contained in:
Peter Nelson
2024-06-11 08:58:03 +01:00
committed by GitHub
parent 18bce69623
commit 4cf6d1dd79
68 changed files with 293 additions and 301 deletions
+4 -4
View File
@@ -86,7 +86,7 @@ private:
}
public:
PerformanceLeagueWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
PerformanceLeagueWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
this->InitNested(window_number);
this->companies.ForceRebuild();
@@ -209,7 +209,7 @@ static WindowDesc _performance_league_desc(
void ShowPerformanceLeagueTable()
{
AllocateWindowDescFront<PerformanceLeagueWindow>(&_performance_league_desc, 0);
AllocateWindowDescFront<PerformanceLeagueWindow>(_performance_league_desc, 0);
}
static void HandleLinkClick(Link link)
@@ -298,7 +298,7 @@ private:
}
public:
ScriptLeagueWindow(WindowDesc *desc, LeagueTableID table) : Window(desc)
ScriptLeagueWindow(WindowDesc &desc, LeagueTableID table) : Window(desc)
{
this->table = table;
this->BuildTable();
@@ -445,7 +445,7 @@ static WindowDesc _script_league_desc(
void ShowScriptLeagueTable(LeagueTableID table)
{
if (!LeagueTable::IsValidID(table)) return;
AllocateWindowDescFront<ScriptLeagueWindow>(&_script_league_desc, table);
AllocateWindowDescFront<ScriptLeagueWindow>(_script_league_desc, table);
}
void ShowFirstLeagueTable()