Add various missing override specifiers

This commit is contained in:
Jonathan G Rennison
2019-04-28 11:05:14 +01:00
parent 6d3e9093c4
commit 24458e9990
10 changed files with 49 additions and 49 deletions

View File

@@ -182,7 +182,7 @@ public:
this->DeleteDeparturesList(this->arrivals); this->DeleteDeparturesList(this->arrivals);
} }
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{ {
switch (widget) { switch (widget) {
case WID_DB_LIST: case WID_DB_LIST:
@@ -192,7 +192,7 @@ public:
} }
} }
virtual void SetStringParameters(int widget) const virtual void SetStringParameters(int widget) const override
{ {
if (widget == WID_DB_CAPTION) { if (widget == WID_DB_CAPTION) {
const Station *st = Station::Get(this->station); const Station *st = Station::Get(this->station);
@@ -200,7 +200,7 @@ public:
} }
} }
virtual void OnClick(Point pt, int widget, int click_count) virtual void OnClick(Point pt, int widget, int click_count) override
{ {
switch (widget) { switch (widget) {
case WID_DB_SHOW_TRAINS: // Show trains to this station case WID_DB_SHOW_TRAINS: // Show trains to this station
@@ -374,7 +374,7 @@ public:
} }
} }
virtual void OnPaint() virtual void OnPaint() override
{ {
if (Twaypoint || _settings_client.gui.departure_show_both) { if (Twaypoint || _settings_client.gui.departure_show_both) {
this->DisableWidget(WID_DB_SHOW_ARRS); this->DisableWidget(WID_DB_SHOW_ARRS);
@@ -388,7 +388,7 @@ public:
this->DrawWidgets(); this->DrawWidgets();
} }
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const override
{ {
switch (widget) { switch (widget) {
case WID_DB_LIST: case WID_DB_LIST:
@@ -397,7 +397,7 @@ public:
} }
} }
virtual void OnResize() virtual void OnResize() override
{ {
this->vscroll->SetCapacityFromWidget(this, WID_DB_LIST); this->vscroll->SetCapacityFromWidget(this, WID_DB_LIST);
this->GetWidget<NWidgetCore>(WID_DB_LIST)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); this->GetWidget<NWidgetCore>(WID_DB_LIST)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);

View File

@@ -465,7 +465,7 @@ struct MainWindow : Window
InvalidateWindowData(WC_MAIN_TOOLBAR, 0, data, true); InvalidateWindowData(WC_MAIN_TOOLBAR, 0, data, true);
} }
virtual void OnMouseOver(Point pt, int widget) virtual void OnMouseOver(Point pt, int widget) override
{ {
if (pt.x != -1 && _game_mode != GM_MENU && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) { if (pt.x != -1 && _game_mode != GM_MENU && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) {
/* Show tooltip with last month production or town name */ /* Show tooltip with last month production or town name */

View File

@@ -247,7 +247,7 @@ class CrashLogUnix : public CrashLog {
* *
* Also log GDB information if available * Also log GDB information if available
*/ */
char *LogRegisters(char *buffer, const char *last) const char *LogRegisters(char *buffer, const char *last) const override
{ {
buffer = LogGdbInfo(buffer, last); buffer = LogGdbInfo(buffer, last);
@@ -490,7 +490,7 @@ class CrashLogUnix : public CrashLog {
* This is a wrapper around the generic LogScopeInfo function which sets * This is a wrapper around the generic LogScopeInfo function which sets
* up a signal handler to catch any SIGSEGVs which may occur due to invalid data * up a signal handler to catch any SIGSEGVs which may occur due to invalid data
*/ */
/* virtual */ char *LogScopeInfo(char *buffer, const char *last) const /* virtual */ char *LogScopeInfo(char *buffer, const char *last) const override
{ {
logStacktraceSavedBuffer = buffer; logStacktraceSavedBuffer = buffer;

View File

@@ -175,7 +175,7 @@ struct SchdispatchWindow : Window {
uint flag_width; uint flag_width;
uint flag_height; uint flag_height;
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{ {
switch (widget) { switch (widget) {
case WID_SCHDISPATCH_MATRIX: { case WID_SCHDISPATCH_MATRIX: {
@@ -223,7 +223,7 @@ struct SchdispatchWindow : Window {
* @param data Information about the changed data. * @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/ */
virtual void OnInvalidateData(int data = 0, bool gui_scope = true) virtual void OnInvalidateData(int data = 0, bool gui_scope = true) override
{ {
switch (data) { switch (data) {
case VIWD_MODIFY_ORDERS: case VIWD_MODIFY_ORDERS:
@@ -233,7 +233,7 @@ struct SchdispatchWindow : Window {
} }
} }
virtual void OnPaint() virtual void OnPaint() override
{ {
const Vehicle *v = this->vehicle; const Vehicle *v = this->vehicle;
CountItem(); CountItem();
@@ -256,7 +256,7 @@ struct SchdispatchWindow : Window {
this->DrawWidgets(); this->DrawWidgets();
} }
virtual void SetStringParameters(int widget) const virtual void SetStringParameters(int widget) const override
{ {
switch (widget) { switch (widget) {
case WID_SCHDISPATCH_CAPTION: SetDParam(0, this->vehicle->index); break; case WID_SCHDISPATCH_CAPTION: SetDParam(0, this->vehicle->index); break;
@@ -296,7 +296,7 @@ struct SchdispatchWindow : Window {
} }
} }
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const override
{ {
const Vehicle *v = this->vehicle; const Vehicle *v = this->vehicle;
@@ -400,7 +400,7 @@ struct SchdispatchWindow : Window {
} }
} }
virtual void OnClick(Point pt, int widget, int click_count) virtual void OnClick(Point pt, int widget, int click_count) override
{ {
const Vehicle *v = this->vehicle; const Vehicle *v = this->vehicle;
@@ -468,7 +468,7 @@ struct SchdispatchWindow : Window {
this->SetDirty(); this->SetDirty();
} }
virtual void OnQueryTextFinished(char *str) virtual void OnQueryTextFinished(char *str) override
{ {
if (str == nullptr) return; if (str == nullptr) return;
const Vehicle *v = this->vehicle; const Vehicle *v = this->vehicle;
@@ -541,14 +541,14 @@ struct SchdispatchWindow : Window {
this->SetDirty(); this->SetDirty();
} }
virtual void OnResize() virtual void OnResize() override
{ {
this->vscroll->SetCapacityFromWidget(this, WID_SCHDISPATCH_MATRIX); this->vscroll->SetCapacityFromWidget(this, WID_SCHDISPATCH_MATRIX);
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_SCHDISPATCH_MATRIX); NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_SCHDISPATCH_MATRIX);
this->num_columns = nwi->current_x / nwi->resize_x; this->num_columns = nwi->current_x / nwi->resize_x;
} }
virtual void OnFocus(Window *previously_focused_window) virtual void OnFocus(Window *previously_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); MarkAllRoutePathsDirty(this->vehicle);

View File

@@ -84,7 +84,7 @@ class NIHVehicle : public NIHelper {
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
} }
/* virtual */ void ExtraInfo(uint index, std::function<void(const char *)> print) const /* virtual */ void ExtraInfo(uint index, std::function<void(const char *)> print) const override
{ {
char buffer[1024]; char buffer[1024];
Vehicle *v = Vehicle::Get(index); Vehicle *v = Vehicle::Get(index);

View File

@@ -970,7 +970,7 @@ struct TimetableWindow : Window {
this->GetWidget<NWidgetStacked>(WID_VT_SEL_SHARED)->SetDisplayedPlane(this->vehicle->owner == _local_company && _ctrl_pressed ? 1 : 0); this->GetWidget<NWidgetStacked>(WID_VT_SEL_SHARED)->SetDisplayedPlane(this->vehicle->owner == _local_company && _ctrl_pressed ? 1 : 0);
} }
virtual void OnFocus(Window *previously_focused_window) virtual void OnFocus(Window *previously_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); MarkAllRoutePathsDirty(this->vehicle);
@@ -978,7 +978,7 @@ struct TimetableWindow : Window {
} }
} }
virtual void OnFocusLost(Window *newly_focused_window) virtual void OnFocusLost(Window *newly_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); MarkAllRoutePathsDirty(this->vehicle);

View File

@@ -1463,7 +1463,7 @@ public:
} }
} }
virtual void SetStringParameters(int widget) const virtual void SetStringParameters(int widget) const override
{ {
if (widget == WID_HP_CAPTION) { if (widget == WID_HP_CAPTION) {
if (this->house_list.NumHouseSets() == 1) SetDParamStr(0, this->house_list.GetNameOfHouseSet(0)); if (this->house_list.NumHouseSets() == 1) SetDParamStr(0, this->house_list.GetNameOfHouseSet(0));
@@ -1576,7 +1576,7 @@ public:
} }
} }
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{ {
switch (widget) { switch (widget) {
case WID_HP_HOUSE_SETS: { case WID_HP_HOUSE_SETS: {
@@ -1652,7 +1652,7 @@ public:
} }
} }
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const override
{ {
switch (GB(widget, 0, 16)) { switch (GB(widget, 0, 16)) {
case WID_HP_HOUSE_SETS: { case WID_HP_HOUSE_SETS: {
@@ -1687,7 +1687,7 @@ public:
} }
} }
virtual void OnClick(Point pt, int widget, int click_count) virtual void OnClick(Point pt, int widget, int click_count) override
{ {
switch (GB(widget, 0, 16)) { switch (GB(widget, 0, 16)) {
case WID_HP_HOUSE_SETS: { case WID_HP_HOUSE_SETS: {

View File

@@ -2974,7 +2974,7 @@ public:
*this->sorting = this->vehicles.GetListing(); *this->sorting = this->vehicles.GetListing();
} }
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{ {
switch (widget) { switch (widget) {
case WID_TRSL_LIST_SLOTS: { case WID_TRSL_LIST_SLOTS: {
@@ -3021,7 +3021,7 @@ public:
* @param data Information about the changed data. * @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/ */
virtual void OnInvalidateData(int data = 0, bool gui_scope = true) virtual void OnInvalidateData(int data = 0, bool gui_scope = true) override
{ {
if (data == 0) { if (data == 0) {
/* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */
@@ -3048,7 +3048,7 @@ public:
this->SetDirty(); this->SetDirty();
} }
virtual void SetStringParameters(int widget) const virtual void SetStringParameters(int widget) const override
{ {
switch (widget) { switch (widget) {
case WID_TRSL_FILTER_BY_CARGO: case WID_TRSL_FILTER_BY_CARGO:
@@ -3057,7 +3057,7 @@ public:
} }
} }
virtual void OnPaint() virtual void OnPaint() override
{ {
/* If we select the all vehicles, this->list will contain all vehicles of the owner /* If we select the all vehicles, this->list will contain all vehicles of the owner
* else this->list will contain all vehicles which belong to the selected group */ * else this->list will contain all vehicles which belong to the selected group */
@@ -3094,7 +3094,7 @@ public:
this->DrawWidgets(); this->DrawWidgets();
} }
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const override
{ {
switch (widget) { switch (widget) {
case WID_TRSL_ALL_VEHICLES: case WID_TRSL_ALL_VEHICLES:
@@ -3135,7 +3135,7 @@ public:
} }
} }
virtual void OnClick(Point pt, int widget, int click_count) virtual void OnClick(Point pt, int widget, int click_count) override
{ {
switch (widget) { switch (widget) {
case WID_TRSL_SORT_BY_ORDER: // Flip sorting method ascending/descending case WID_TRSL_SORT_BY_ORDER: // Flip sorting method ascending/descending
@@ -3258,14 +3258,14 @@ public:
} }
} }
virtual void OnDragDrop(Point pt, int widget) virtual void OnDragDrop(Point pt, int widget) override
{ {
if (this->vehicle_sel != INVALID_VEHICLE) OnDragDrop_Vehicle(pt, widget); if (this->vehicle_sel != INVALID_VEHICLE) OnDragDrop_Vehicle(pt, widget);
_cursor.vehchain = false; _cursor.vehchain = false;
} }
virtual void OnQueryTextFinished(char *str) virtual void OnQueryTextFinished(char *str) override
{ {
if (str != nullptr) { if (str != nullptr) {
if (this->slot_set_max_occupancy) { if (this->slot_set_max_occupancy) {
@@ -3279,13 +3279,13 @@ public:
this->slot_rename = INVALID_TRACE_RESTRICT_SLOT_ID; this->slot_rename = INVALID_TRACE_RESTRICT_SLOT_ID;
} }
virtual void OnResize() virtual void OnResize() override
{ {
this->slot_sb->SetCapacityFromWidget(this, WID_TRSL_LIST_SLOTS); this->slot_sb->SetCapacityFromWidget(this, WID_TRSL_LIST_SLOTS);
this->vscroll->SetCapacityFromWidget(this, WID_TRSL_LIST_VEHICLE); this->vscroll->SetCapacityFromWidget(this, WID_TRSL_LIST_VEHICLE);
} }
virtual void OnDropdownSelect(int widget, int index) virtual void OnDropdownSelect(int widget, int index) override
{ {
switch (widget) { switch (widget) {
case WID_TRSL_SORT_BY_DROPDOWN: case WID_TRSL_SORT_BY_DROPDOWN:
@@ -3309,7 +3309,7 @@ public:
} }
} }
virtual void OnPlaceObjectAbort() virtual void OnPlaceObjectAbort() override
{ {
/* abort drag & drop */ /* abort drag & drop */
this->vehicle_sel = INVALID_VEHICLE; this->vehicle_sel = INVALID_VEHICLE;
@@ -3318,7 +3318,7 @@ public:
this->SetWidgetDirty(WID_TRSL_LIST_VEHICLE); this->SetWidgetDirty(WID_TRSL_LIST_VEHICLE);
} }
virtual void OnMouseDrag(Point pt, int widget) virtual void OnMouseDrag(Point pt, int widget) override
{ {
if (this->vehicle_sel == INVALID_VEHICLE) return; if (this->vehicle_sel == INVALID_VEHICLE) return;

View File

@@ -2113,7 +2113,7 @@ public:
DoCommandP(0, this->window_number, 0, CMD_CREATE_GROUP_FROM_LIST | CMD_MSG(STR_ERROR_GROUP_CAN_T_CREATE), nullptr, str); DoCommandP(0, this->window_number, 0, CMD_CREATE_GROUP_FROM_LIST | CMD_MSG(STR_ERROR_GROUP_CAN_T_CREATE), nullptr, str);
} }
virtual void OnPlaceObject(Point pt, TileIndex tile) virtual void OnPlaceObject(Point pt, TileIndex tile) override
{ {
/* check depot first */ /* check depot first */
if (IsDepotTile(tile) && GetDepotVehicleType(tile) == this->vli.vtype) { if (IsDepotTile(tile) && GetDepotVehicleType(tile) == this->vli.vtype) {
@@ -2861,7 +2861,7 @@ struct VehicleDetailsWindow : Window {
} }
} }
virtual void OnFocus(Window *previously_focused_window) virtual void OnFocus(Window *previously_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
if (this->window_number != INVALID_VEHICLE) { if (this->window_number != INVALID_VEHICLE) {
@@ -2872,7 +2872,7 @@ struct VehicleDetailsWindow : Window {
} }
} }
virtual void OnFocusLost(Window *newly_focused_window) virtual void OnFocusLost(Window *newly_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
if (this->window_number != INVALID_VEHICLE) { if (this->window_number != INVALID_VEHICLE) {
@@ -3177,7 +3177,7 @@ public:
DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false); DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false);
} }
virtual void OnFocus(Window *previously_focused_window) virtual void OnFocus(Window *previously_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
if (this->window_number != INVALID_VEHICLE) { if (this->window_number != INVALID_VEHICLE) {
@@ -3188,7 +3188,7 @@ public:
} }
} }
virtual void OnFocusLost(Window *newly_focused_window) virtual void OnFocusLost(Window *newly_focused_window) override
{ {
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
if (this->window_number != INVALID_VEHICLE) { if (this->window_number != INVALID_VEHICLE) {
@@ -3496,7 +3496,7 @@ public:
} }
} }
virtual void OnTimeout() virtual void OnTimeout() override
{ {
if (!this->depot_select_active) { if (!this->depot_select_active) {
this->RaiseWidget(WID_VV_GOTO_DEPOT); this->RaiseWidget(WID_VV_GOTO_DEPOT);
@@ -3504,7 +3504,7 @@ public:
} }
} }
virtual void OnPlaceObject(Point pt, TileIndex tile) virtual void OnPlaceObject(Point pt, TileIndex tile) override
{ {
const Vehicle *v = Vehicle::Get(this->window_number); const Vehicle *v = Vehicle::Get(this->window_number);
if (IsDepotTile(tile) && GetDepotVehicleType(tile) == v->type && IsInfraTileUsageAllowed(v->type, v->owner, tile)) { if (IsDepotTile(tile) && GetDepotVehicleType(tile) == v->type && IsInfraTileUsageAllowed(v->type, v->owner, tile)) {
@@ -3515,14 +3515,14 @@ public:
} }
} }
virtual void OnPlaceObjectAbort() virtual void OnPlaceObjectAbort() override
{ {
this->depot_select_active = false; this->depot_select_active = false;
this->RaiseWidget(WID_VV_GOTO_DEPOT); this->RaiseWidget(WID_VV_GOTO_DEPOT);
this->SetWidgetDirty(WID_VV_GOTO_DEPOT); this->SetWidgetDirty(WID_VV_GOTO_DEPOT);
} }
virtual bool OnRightClick(Point pt, int widget) virtual bool OnRightClick(Point pt, int widget) override
{ {
if (widget == WID_VV_GOTO_DEPOT && _settings_client.gui.hover_delay_ms == 0) { if (widget == WID_VV_GOTO_DEPOT && _settings_client.gui.hover_delay_ms == 0) {
const Vehicle *v = Vehicle::Get(this->window_number); const Vehicle *v = Vehicle::Get(this->window_number);
@@ -3536,7 +3536,7 @@ public:
return false; return false;
} }
virtual void OnHover(Point pt, int widget) virtual void OnHover(Point pt, int widget) override
{ {
if (widget == WID_VV_GOTO_DEPOT) { if (widget == WID_VV_GOTO_DEPOT) {
const Vehicle *v = Vehicle::Get(this->window_number); const Vehicle *v = Vehicle::Get(this->window_number);
@@ -3582,7 +3582,7 @@ public:
} }
} }
virtual void OnRealtimeTick(uint delta_ms) virtual void OnRealtimeTick(uint delta_ms) override
{ {
if (_pause_mode != PM_UNPAUSED) this->OnGameTick(); if (_pause_mode != PM_UNPAUSED) this->OnGameTick();
} }

View File

@@ -153,7 +153,7 @@ public:
} }
} }
virtual void OnMouseOver(Point pt, int widget) virtual void OnMouseOver(Point pt, int widget) override
{ {
if (pt.x != -1 && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) { if (pt.x != -1 && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) {
/* Show tooltip with last month production or town name */ /* Show tooltip with last month production or town name */