diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 06f102f2b1..1ded2bc131 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -184,7 +184,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) OVERRIDE + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_CTO_HEADER) { (*size).height = std::max((*size).height, (uint) WD_FRAMERECT_TOP + FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM); @@ -200,7 +200,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const OVERRIDE + virtual void DrawWidget(const Rect &r, int widget) const override { if (WID_CTO_CARGO_LABEL_FIRST <= widget && widget <= WID_CTO_CARGO_LABEL_LAST) { const CargoSpec *cs = _sorted_cargo_specs[widget - WID_CTO_CARGO_LABEL_FIRST]; @@ -223,7 +223,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) OVERRIDE + virtual void OnClick(Point pt, int widget, int click_count) override { if (!this->CheckOrderStillValid()) { delete this; @@ -241,7 +241,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int action_type) OVERRIDE + virtual void OnDropdownSelect(int widget, int action_type) override { if (!this->CheckOrderStillValid()) { delete this; @@ -279,7 +279,7 @@ public: } } - virtual void SetStringParameters(int widget) const OVERRIDE + virtual void SetStringParameters(int widget) const override { if (!this->CheckOrderStillValid()) { return; @@ -291,7 +291,7 @@ public: } } - virtual void OnFocus(Window *previously_focused_window) OVERRIDE + virtual void OnFocus(Window *previously_focused_window) override { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) { MarkAllRoutePathsDirty(this->vehicle); @@ -299,7 +299,7 @@ public: } } - virtual void OnFocusLost(Window *newly_focused_window) OVERRIDE + virtual void OnFocusLost(Window *newly_focused_window) override { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) { MarkAllRoutePathsDirty(this->vehicle); @@ -312,7 +312,7 @@ public: * @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. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) OVERRIDE + virtual void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!this->CheckOrderStillValid()) { delete this; @@ -1750,7 +1750,7 @@ public: } } - virtual EventState OnCTRLStateChange() OVERRIDE + virtual EventState OnCTRLStateChange() override { this->UpdateButtonState(); return ES_NOT_HANDLED; @@ -2791,7 +2791,7 @@ public: this->vscroll->SetCapacityFromWidget(this, WID_O_ORDER_LIST); } - virtual void OnFocus(Window *previously_focused_window) OVERRIDE + virtual void OnFocus(Window *previously_focused_window) override { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) { MarkAllRoutePathsDirty(this->vehicle); @@ -2799,7 +2799,7 @@ public: } } - virtual void OnFocusLost(Window *newly_focused_window) OVERRIDE + virtual void OnFocusLost(Window *newly_focused_window) override { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) { MarkAllRoutePathsDirty(this->vehicle); diff --git a/src/plans_gui.cpp b/src/plans_gui.cpp index 5f8f09be41..01e05c3aae 100644 --- a/src/plans_gui.cpp +++ b/src/plans_gui.cpp @@ -436,7 +436,7 @@ struct PlansWindow : Window { this->vscroll->SetCount(sbcnt); } - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + virtual void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data != INVALID_PLAN && this->selected != INT_MAX) { if (this->list[this->selected].plan_id == data) { diff --git a/src/programmable_signals_gui.cpp b/src/programmable_signals_gui.cpp index 8b34d65427..1747c6d8db 100644 --- a/src/programmable_signals_gui.cpp +++ b/src/programmable_signals_gui.cpp @@ -266,7 +266,7 @@ public: RebuildInstructionList(); } - virtual void OnClick(Point pt, int widget, int click_count) OVERRIDE + virtual void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case PROGRAM_WIDGET_INSTRUCTION_LIST: { @@ -415,7 +415,7 @@ public: } } - virtual void OnPlaceObject(Point pt, TileIndex tile1) OVERRIDE + virtual void OnPlaceObject(Point pt, TileIndex tile1) override { if (this->IsWidgetLowered(PROGRAM_WIDGET_COPY_PROGRAM)) { //Copy program from another progsignal @@ -514,7 +514,7 @@ public: //OnPaint(); // this appears to cause visual artefacts } - virtual void OnQueryTextFinished(char *str) OVERRIDE + virtual void OnQueryTextFinished(char *str) override { if (!StrEmpty(str)) { SignalInstruction *si = this->GetSelected(); @@ -536,7 +536,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) OVERRIDE + virtual void OnDropdownSelect(int widget, int index) override { SignalInstruction *ins = this->GetSelected(); if (!ins) return; @@ -602,7 +602,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) OVERRIDE + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case PROGRAM_WIDGET_INSTRUCTION_LIST: @@ -612,18 +612,18 @@ public: } } - virtual void OnResize() OVERRIDE + virtual void OnResize() override { /* Update the scroll bar */ this->vscroll->SetCapacityFromWidget(this, PROGRAM_WIDGET_INSTRUCTION_LIST); } - virtual void OnPaint() OVERRIDE + virtual void OnPaint() override { this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const OVERRIDE + virtual void DrawWidget(const Rect &r, int widget) const override { if (widget != PROGRAM_WIDGET_INSTRUCTION_LIST) return; @@ -640,14 +640,14 @@ public: } } - virtual void OnInvalidateData(int data, bool gui_scope) OVERRIDE { + virtual void OnInvalidateData(int data, bool gui_scope) override { if (gui_scope) { this->RebuildInstructionList(); } } - virtual void SetStringParameters(int widget) const OVERRIDE + virtual void SetStringParameters(int widget) const override { switch (widget) { case PROGRAM_WIDGET_COND_VALUE: { diff --git a/src/stdafx.h b/src/stdafx.h index ae94b10c63..ee4f1bf3e1 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -517,11 +517,6 @@ static inline void free(const void *ptr) # define IGNORE_UNINITIALIZED_WARNING_STOP #endif -/* - * Define for the override keyword. - */ -#define OVERRIDE override - /** * Using _mm_prefetch() with gcc implies the compile flag -msse. * This is not the case with __builtin_prefetch() so the latter can be used in normal .cpp files. diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 0cbd601039..981e105cd5 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -409,7 +409,7 @@ struct TimetableWindow : Window { } } - virtual EventState OnCTRLStateChange() OVERRIDE + virtual EventState OnCTRLStateChange() override { this->UpdateSelectionStates(); this->SetDirty(); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 119d62e464..1bdeed3e39 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -1481,7 +1481,7 @@ public: if (_cur_house != INVALID_HOUSE_ID) matrix->SetClicked(this->house_offset); // set clicked item again to make it visible } - virtual void OnInit() OVERRIDE + virtual void OnInit() override { this->house_list.Build(); this->RestoreSelectedHouseIndex(); @@ -1751,12 +1751,12 @@ public: } } - virtual void OnPlaceObject(Point pt, TileIndex tile) OVERRIDE + virtual void OnPlaceObject(Point pt, TileIndex tile) override { PlaceProc_House(tile); } - virtual void OnPlaceObjectAbort() OVERRIDE + virtual void OnPlaceObjectAbort() override { this->house_offset = -1; _cur_house = INVALID_HOUSE_ID; diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index 412b72c257..40a3ff39ae 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -1481,7 +1481,7 @@ public: this->ReloadProgramme(); } - virtual void OnClick(Point pt, int widget, int click_count) OVERRIDE + virtual void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case TR_WIDGET_INSTRUCTION_LIST: { @@ -1817,7 +1817,7 @@ public: } } - virtual void OnQueryTextFinished(char *str) OVERRIDE + virtual void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) { return; @@ -1864,7 +1864,7 @@ public: TraceRestrictDoCommandP(tile, track, TRDCT_MODIFY_ITEM, this->selected_instruction - 1, item, STR_TRACE_RESTRICT_ERROR_CAN_T_MODIFY_ITEM); } - virtual void OnDropdownSelect(int widget, int index) OVERRIDE + virtual void OnDropdownSelect(int widget, int index) override { TraceRestrictItem item = GetSelected(); if (item == 0 || index < 0 || this->selected_instruction < 1) { @@ -1961,7 +1961,7 @@ public: } } - virtual void OnPlaceObject(Point pt, TileIndex tile) OVERRIDE + virtual void OnPlaceObject(Point pt, TileIndex tile) override { int widget = this->current_placement_widget; this->current_placement_widget = -1; @@ -2127,13 +2127,13 @@ public: TraceRestrictDoCommandP(this->tile, this->track, TRDCT_MODIFY_DUAL_ITEM, this->selected_instruction - 1, tile, STR_TRACE_RESTRICT_ERROR_CAN_T_MODIFY_ITEM); } - virtual void OnPlaceObjectAbort() OVERRIDE + virtual void OnPlaceObjectAbort() override { this->RaiseButtons(); this->current_placement_widget = -1; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) OVERRIDE + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case TR_WIDGET_INSTRUCTION_LIST: @@ -2147,18 +2147,18 @@ public: } } - virtual void OnResize() OVERRIDE + virtual void OnResize() override { /* Update the scroll bar */ this->vscroll->SetCapacityFromWidget(this, TR_WIDGET_INSTRUCTION_LIST); } - virtual void OnPaint() OVERRIDE + virtual void OnPaint() override { this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const OVERRIDE + virtual void DrawWidget(const Rect &r, int widget) const override { if (widget != TR_WIDGET_INSTRUCTION_LIST) return; @@ -2194,14 +2194,14 @@ public: } } - virtual void OnInvalidateData(int data, bool gui_scope) OVERRIDE + virtual void OnInvalidateData(int data, bool gui_scope) override { if (gui_scope) { this->ReloadProgramme(); } } - virtual void SetStringParameters(int widget) const OVERRIDE + virtual void SetStringParameters(int widget) const override { switch (widget) { case TR_WIDGET_VALUE_INT: { @@ -2267,7 +2267,7 @@ public: } } - virtual EventState OnCTRLStateChange() OVERRIDE + virtual EventState OnCTRLStateChange() override { this->UpdateButtonState(); return ES_NOT_HANDLED;