forked from mirror/OpenTTD
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:
@@ -40,7 +40,7 @@ struct SetDateWindow : Window {
|
||||
* @param max_year the maximum year (inclusive) to show in the year dropdown
|
||||
* @param callback the callback to call once a date has been selected
|
||||
*/
|
||||
SetDateWindow(WindowDesc *desc, WindowNumber window_number, Window *parent, TimerGameEconomy::Date initial_date, TimerGameEconomy::Year min_year, TimerGameEconomy::Year max_year, SetDateCallback *callback, void *callback_data) :
|
||||
SetDateWindow(WindowDesc &desc, WindowNumber window_number, Window *parent, TimerGameEconomy::Date initial_date, TimerGameEconomy::Year min_year, TimerGameEconomy::Year max_year, SetDateCallback *callback, void *callback_data) :
|
||||
Window(desc),
|
||||
callback(callback),
|
||||
callback_data(callback_data),
|
||||
@@ -216,5 +216,5 @@ static WindowDesc _set_date_desc(
|
||||
void ShowSetDateWindow(Window *parent, int window_number, TimerGameEconomy::Date initial_date, TimerGameEconomy::Year min_year, TimerGameEconomy::Year max_year, SetDateCallback *callback, void *callback_data)
|
||||
{
|
||||
CloseWindowByClass(WC_SET_DATE);
|
||||
new SetDateWindow(&_set_date_desc, window_number, parent, initial_date, min_year, max_year, callback, callback_data);
|
||||
new SetDateWindow(_set_date_desc, window_number, parent, initial_date, min_year, max_year, callback, callback_data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user