1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 05:04:07 +01:00

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

View File

@@ -403,7 +403,7 @@ class BuildIndustryWindow : public Window {
}
public:
BuildIndustryWindow() : Window(&_build_industry_desc)
BuildIndustryWindow() : Window(_build_industry_desc)
{
this->selected_type = INVALID_INDUSTRYTYPE;
@@ -812,7 +812,7 @@ class IndustryViewWindow : public Window
int cheat_line_height; ///< Height of each line for the #WID_IV_INFO panel
public:
IndustryViewWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
IndustryViewWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
this->flags |= WF_DISABLE_VP_SCROLL;
this->editbox_line = IL_NONE;
@@ -1226,7 +1226,7 @@ static WindowDesc _industry_view_desc(
void ShowIndustryViewWindow(int industry)
{
AllocateWindowDescFront<IndustryViewWindow>(&_industry_view_desc, industry);
AllocateWindowDescFront<IndustryViewWindow>(_industry_view_desc, industry);
}
/** Widget definition of the industry directory gui */
@@ -1636,7 +1636,7 @@ protected:
}
public:
IndustryDirectoryWindow(WindowDesc *desc, WindowNumber) : Window(desc), industry_editbox(MAX_FILTER_LENGTH * MAX_CHAR_LENGTH, MAX_FILTER_LENGTH)
IndustryDirectoryWindow(WindowDesc &desc, WindowNumber) : Window(desc), industry_editbox(MAX_FILTER_LENGTH * MAX_CHAR_LENGTH, MAX_FILTER_LENGTH)
{
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_ID_VSCROLLBAR);
@@ -1925,7 +1925,7 @@ static WindowDesc _industry_directory_desc(
void ShowIndustryDirectory()
{
AllocateWindowDescFront<IndustryDirectoryWindow>(&_industry_directory_desc, 0);
AllocateWindowDescFront<IndustryDirectoryWindow>(_industry_directory_desc, 0);
}
/** Widgets of the industry cargoes window. */
@@ -2542,7 +2542,7 @@ struct IndustryCargoesWindow : public Window {
Dimension ind_textsize; ///< Size to hold any industry type text, as well as STR_INDUSTRY_CARGOES_SELECT_INDUSTRY.
Scrollbar *vscroll;
IndustryCargoesWindow(int id) : Window(&_industry_cargoes_desc)
IndustryCargoesWindow(int id) : Window(_industry_cargoes_desc)
{
this->OnInit();
this->CreateNestedTree();