Remove OVEERIDE macro

This commit is contained in:
Jonathan G Rennison
2021-03-02 23:42:47 +00:00
parent 865cf79915
commit 7e62af94ee
7 changed files with 38 additions and 43 deletions

View File

@@ -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) { if (widget == WID_CTO_HEADER) {
(*size).height = std::max((*size).height, (uint) WD_FRAMERECT_TOP + FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM); (*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) { 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]; 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()) { if (!this->CheckOrderStillValid()) {
delete this; 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()) { if (!this->CheckOrderStillValid()) {
delete this; delete this;
@@ -279,7 +279,7 @@ public:
} }
} }
virtual void SetStringParameters(int widget) const OVERRIDE virtual void SetStringParameters(int widget) const override
{ {
if (!this->CheckOrderStillValid()) { if (!this->CheckOrderStillValid()) {
return; 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)) { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); 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)) { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); MarkAllRoutePathsDirty(this->vehicle);
@@ -312,7 +312,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) OVERRIDE virtual void OnInvalidateData(int data = 0, bool gui_scope = true) override
{ {
if (!this->CheckOrderStillValid()) { if (!this->CheckOrderStillValid()) {
delete this; delete this;
@@ -1750,7 +1750,7 @@ public:
} }
} }
virtual EventState OnCTRLStateChange() OVERRIDE virtual EventState OnCTRLStateChange() override
{ {
this->UpdateButtonState(); this->UpdateButtonState();
return ES_NOT_HANDLED; return ES_NOT_HANDLED;
@@ -2791,7 +2791,7 @@ public:
this->vscroll->SetCapacityFromWidget(this, WID_O_ORDER_LIST); 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)) { if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); 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)) { if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
MarkAllRoutePathsDirty(this->vehicle); MarkAllRoutePathsDirty(this->vehicle);

View File

@@ -436,7 +436,7 @@ struct PlansWindow : Window {
this->vscroll->SetCount(sbcnt); 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 (data != INVALID_PLAN && this->selected != INT_MAX) {
if (this->list[this->selected].plan_id == data) { if (this->list[this->selected].plan_id == data) {

View File

@@ -266,7 +266,7 @@ public:
RebuildInstructionList(); 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) { switch (widget) {
case PROGRAM_WIDGET_INSTRUCTION_LIST: { 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)) { if (this->IsWidgetLowered(PROGRAM_WIDGET_COPY_PROGRAM)) {
//Copy program from another progsignal //Copy program from another progsignal
@@ -514,7 +514,7 @@ public:
//OnPaint(); // this appears to cause visual artefacts //OnPaint(); // this appears to cause visual artefacts
} }
virtual void OnQueryTextFinished(char *str) OVERRIDE virtual void OnQueryTextFinished(char *str) override
{ {
if (!StrEmpty(str)) { if (!StrEmpty(str)) {
SignalInstruction *si = this->GetSelected(); 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(); SignalInstruction *ins = this->GetSelected();
if (!ins) return; 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) { switch (widget) {
case PROGRAM_WIDGET_INSTRUCTION_LIST: case PROGRAM_WIDGET_INSTRUCTION_LIST:
@@ -612,18 +612,18 @@ public:
} }
} }
virtual void OnResize() OVERRIDE virtual void OnResize() override
{ {
/* Update the scroll bar */ /* Update the scroll bar */
this->vscroll->SetCapacityFromWidget(this, PROGRAM_WIDGET_INSTRUCTION_LIST); this->vscroll->SetCapacityFromWidget(this, PROGRAM_WIDGET_INSTRUCTION_LIST);
} }
virtual void OnPaint() OVERRIDE virtual void OnPaint() override
{ {
this->DrawWidgets(); 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; 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) { if (gui_scope) {
this->RebuildInstructionList(); this->RebuildInstructionList();
} }
} }
virtual void SetStringParameters(int widget) const OVERRIDE virtual void SetStringParameters(int widget) const override
{ {
switch (widget) { switch (widget) {
case PROGRAM_WIDGET_COND_VALUE: { case PROGRAM_WIDGET_COND_VALUE: {

View File

@@ -517,11 +517,6 @@ static inline void free(const void *ptr)
# define IGNORE_UNINITIALIZED_WARNING_STOP # define IGNORE_UNINITIALIZED_WARNING_STOP
#endif #endif
/*
* Define for the override keyword.
*/
#define OVERRIDE override
/** /**
* Using _mm_prefetch() with gcc implies the compile flag -msse. * 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. * This is not the case with __builtin_prefetch() so the latter can be used in normal .cpp files.

View File

@@ -409,7 +409,7 @@ struct TimetableWindow : Window {
} }
} }
virtual EventState OnCTRLStateChange() OVERRIDE virtual EventState OnCTRLStateChange() override
{ {
this->UpdateSelectionStates(); this->UpdateSelectionStates();
this->SetDirty(); this->SetDirty();

View File

@@ -1481,7 +1481,7 @@ public:
if (_cur_house != INVALID_HOUSE_ID) matrix->SetClicked(this->house_offset); // set clicked item again to make it visible 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->house_list.Build();
this->RestoreSelectedHouseIndex(); 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); PlaceProc_House(tile);
} }
virtual void OnPlaceObjectAbort() OVERRIDE virtual void OnPlaceObjectAbort() override
{ {
this->house_offset = -1; this->house_offset = -1;
_cur_house = INVALID_HOUSE_ID; _cur_house = INVALID_HOUSE_ID;

View File

@@ -1481,7 +1481,7 @@ public:
this->ReloadProgramme(); 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) { switch (widget) {
case TR_WIDGET_INSTRUCTION_LIST: { 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)) { if (StrEmpty(str)) {
return; 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); 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(); TraceRestrictItem item = GetSelected();
if (item == 0 || index < 0 || this->selected_instruction < 1) { 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; int widget = this->current_placement_widget;
this->current_placement_widget = -1; 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); 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->RaiseButtons();
this->current_placement_widget = -1; 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) { switch (widget) {
case TR_WIDGET_INSTRUCTION_LIST: case TR_WIDGET_INSTRUCTION_LIST:
@@ -2147,18 +2147,18 @@ public:
} }
} }
virtual void OnResize() OVERRIDE virtual void OnResize() override
{ {
/* Update the scroll bar */ /* Update the scroll bar */
this->vscroll->SetCapacityFromWidget(this, TR_WIDGET_INSTRUCTION_LIST); this->vscroll->SetCapacityFromWidget(this, TR_WIDGET_INSTRUCTION_LIST);
} }
virtual void OnPaint() OVERRIDE virtual void OnPaint() override
{ {
this->DrawWidgets(); 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; 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) { if (gui_scope) {
this->ReloadProgramme(); this->ReloadProgramme();
} }
} }
virtual void SetStringParameters(int widget) const OVERRIDE virtual void SetStringParameters(int widget) const override
{ {
switch (widget) { switch (widget) {
case TR_WIDGET_VALUE_INT: { case TR_WIDGET_VALUE_INT: {
@@ -2267,7 +2267,7 @@ public:
} }
} }
virtual EventState OnCTRLStateChange() OVERRIDE virtual EventState OnCTRLStateChange() override
{ {
this->UpdateButtonState(); this->UpdateButtonState();
return ES_NOT_HANDLED; return ES_NOT_HANDLED;