From 068325d15130af7e2c639b34008f99572925e419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 8 Apr 2020 17:18:32 +0200 Subject: [PATCH] Coding style: remove unecessary 'virtual' keyword when 'override' is present 2/2 --- apps/apps_container.h | 2 +- .../additional_outputs/expressions_list_controller.h | 2 +- apps/exam_pop_up_controller.h | 2 +- apps/home/controller.h | 12 ++++++------ apps/regression/model/logarithmic_model.h | 2 +- apps/shared/expression_field_delegate_app.h | 2 +- apps/shared/text_field_delegate_app.h | 2 +- apps/shared/values_controller.h | 4 ++-- apps/shared/values_function_parameter_controller.h | 6 +++--- apps/solver/solutions_controller.h | 4 ++-- escher/include/escher/even_odd_editable_text_cell.h | 2 +- escher/include/escher/message_table_cell.h | 2 +- escher/include/escher/nested_menu_controller.h | 2 +- escher/include/escher/scroll_view.h | 4 ++-- escher/include/escher/scroll_view_indicator.h | 4 ++-- escher/include/escher/selectable_table_view.h | 6 +++--- escher/include/escher/toolbox.h | 4 ++-- escher/include/escher/window.h | 6 +++--- ion/src/device/shared/usb/calculator.h | 6 +++--- .../shared/usb/stack/descriptor/bos_descriptor.h | 2 +- .../usb/stack/descriptor/configuration_descriptor.h | 2 +- .../stack/descriptor/device_capability_descriptor.h | 2 +- .../shared/usb/stack/descriptor/device_descriptor.h | 2 +- .../usb/stack/descriptor/dfu_functional_descriptor.h | 2 +- .../usb/stack/descriptor/interface_descriptor.h | 2 +- .../stack/descriptor/language_id_string_descriptor.h | 2 +- .../descriptor/microsoft_os_string_descriptor.h | 2 +- .../platform_device_capability_descriptor.h | 2 +- .../shared/usb/stack/descriptor/string_descriptor.h | 2 +- .../shared/usb/stack/descriptor/url_descriptor.h | 2 +- .../stack/descriptor/webusb_platform_descriptor.h | 2 +- 31 files changed, 49 insertions(+), 49 deletions(-) diff --git a/apps/apps_container.h b/apps/apps_container.h index f4c683d5a..18d755512 100644 --- a/apps/apps_container.h +++ b/apps/apps_container.h @@ -36,7 +36,7 @@ public: MathToolbox * mathToolbox(); VariableBoxController * variableBoxController(); void suspend(bool checkIfOnOffKeyReleased = false); - virtual bool dispatchEvent(Ion::Events::Event event) override; + bool dispatchEvent(Ion::Events::Event event) override; bool switchTo(App::Snapshot * snapshot) override; void run() override; bool updateBatteryState(); diff --git a/apps/calculation/additional_outputs/expressions_list_controller.h b/apps/calculation/additional_outputs/expressions_list_controller.h index afc59e9c1..df8f8e4ff 100644 --- a/apps/calculation/additional_outputs/expressions_list_controller.h +++ b/apps/calculation/additional_outputs/expressions_list_controller.h @@ -28,7 +28,7 @@ public: protected: constexpr static int k_maxNumberOfCells = 4; - virtual int textAtIndex(char * buffer, size_t bufferSize, int index) override; + int textAtIndex(char * buffer, size_t bufferSize, int index) override; Poincare::Expression m_expression; // Memoization of layouts mutable Poincare::Layout m_layouts[k_maxNumberOfCells]; diff --git a/apps/exam_pop_up_controller.h b/apps/exam_pop_up_controller.h index 102ed8b2d..694bf5ca2 100644 --- a/apps/exam_pop_up_controller.h +++ b/apps/exam_pop_up_controller.h @@ -8,7 +8,7 @@ class HighContrastButton : public Button { public: using Button::Button; - virtual KDColor highlightedBackgroundColor() const override { return Palette::YellowDark; } + KDColor highlightedBackgroundColor() const override { return Palette::YellowDark; } }; class ExamPopUpController : public ViewController { diff --git a/apps/home/controller.h b/apps/home/controller.h index b7c5dcaca..730541718 100644 --- a/apps/home/controller.h +++ b/apps/home/controller.h @@ -16,12 +16,12 @@ public: void didBecomeFirstResponder() override; TELEMETRY_ID(""); - virtual int numberOfRows() const override; - virtual int numberOfColumns() const override; - virtual KDCoordinate cellHeight() override; - virtual KDCoordinate cellWidth() override; - virtual HighlightCell * reusableCell(int index) override; - virtual int reusableCellCount() const override; + int numberOfRows() const override; + int numberOfColumns() const override; + KDCoordinate cellHeight() override; + KDCoordinate cellWidth() override; + HighlightCell * reusableCell(int index) override; + int reusableCellCount() const override; void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override; void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY, bool withinTemporarySelection) override; private: diff --git a/apps/regression/model/logarithmic_model.h b/apps/regression/model/logarithmic_model.h index a541b571d..0fd7048fa 100644 --- a/apps/regression/model/logarithmic_model.h +++ b/apps/regression/model/logarithmic_model.h @@ -16,7 +16,7 @@ public: int numberOfCoefficients() const override { return 2; } int bannerLinesCount() const override { return 2; } protected: - virtual bool dataSuitableForFit(Store * store, int series) const override; + bool dataSuitableForFit(Store * store, int series) const override; }; } diff --git a/apps/shared/expression_field_delegate_app.h b/apps/shared/expression_field_delegate_app.h index 1c73f1c7e..0e1752813 100644 --- a/apps/shared/expression_field_delegate_app.h +++ b/apps/shared/expression_field_delegate_app.h @@ -10,7 +10,7 @@ class ExpressionFieldDelegateApp : public TextFieldDelegateApp, public LayoutFie public: virtual ~ExpressionFieldDelegateApp() = default; bool layoutFieldShouldFinishEditing(LayoutField * layoutField, Ion::Events::Event event) override; - virtual bool layoutFieldDidReceiveEvent(LayoutField * layoutField, Ion::Events::Event event) override; + bool layoutFieldDidReceiveEvent(LayoutField * layoutField, Ion::Events::Event event) override; protected: ExpressionFieldDelegateApp(Snapshot * snapshot, ViewController * rootViewController); }; diff --git a/apps/shared/text_field_delegate_app.h b/apps/shared/text_field_delegate_app.h index 185646dd6..0dd472e78 100644 --- a/apps/shared/text_field_delegate_app.h +++ b/apps/shared/text_field_delegate_app.h @@ -17,7 +17,7 @@ public: virtual bool XNTCanBeOverriden() const { return true; } virtual CodePoint XNT() { return 'x'; } bool textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) override; - virtual bool textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) override; + bool textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) override; bool isAcceptableText(const char * text); template bool hasUndefinedValue(const char * text, T & value, bool enablePlusInfinity = false, bool enableMinusInfinity = false); diff --git a/apps/shared/values_controller.h b/apps/shared/values_controller.h index 817de16bc..42d8a2501 100644 --- a/apps/shared/values_controller.h +++ b/apps/shared/values_controller.h @@ -23,13 +23,13 @@ public: TELEMETRY_ID("Values"); // Responder - virtual bool handleEvent(Ion::Events::Event event) override; + bool handleEvent(Ion::Events::Event event) override; void didBecomeFirstResponder() override; void willExitResponderChain(Responder * nextFirstResponder) override; // TableViewDataSource int numberOfColumns() const override; - virtual void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override; + void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override; HighlightCell * reusableCell(int index, int type) override; int reusableCellCount(int type) override; int typeAtLocation(int i, int j) override; diff --git a/apps/shared/values_function_parameter_controller.h b/apps/shared/values_function_parameter_controller.h index a39dbed49..f43653123 100644 --- a/apps/shared/values_function_parameter_controller.h +++ b/apps/shared/values_function_parameter_controller.h @@ -20,13 +20,13 @@ public: const char * title() override; void viewWillAppear() override; void didBecomeFirstResponder() override; - virtual int numberOfRows() const override { return 1; } + int numberOfRows() const override { return 1; } KDCoordinate cellHeight() override { return Metric::ParameterCellHeight; } - virtual HighlightCell * reusableCell(int index) override { + HighlightCell * reusableCell(int index) override { assert(index == 0); return &m_copyColumn; } - virtual int reusableCellCount() const override { return 1; } + int reusableCellCount() const override { return 1; } void setRecord(Ion::Storage::Record record) { m_record = record; } protected: MessageTableCellWithChevron m_copyColumn; diff --git a/apps/solver/solutions_controller.h b/apps/solver/solutions_controller.h index 37b16022a..f63465d94 100644 --- a/apps/solver/solutions_controller.h +++ b/apps/solver/solutions_controller.h @@ -23,8 +23,8 @@ public: /* AlternateEmptyViewDefaultDelegate */ bool isEmpty() const override; - virtual I18n::Message emptyMessage() override; - virtual Responder * defaultController() override; + I18n::Message emptyMessage() override; + Responder * defaultController() override; /* TableViewDataSource */ int numberOfRows() const override; int numberOfColumns() const override { return 2; } diff --git a/escher/include/escher/even_odd_editable_text_cell.h b/escher/include/escher/even_odd_editable_text_cell.h index b462144c6..c9986766e 100644 --- a/escher/include/escher/even_odd_editable_text_cell.h +++ b/escher/include/escher/even_odd_editable_text_cell.h @@ -11,7 +11,7 @@ public: EditableTextCell * editableTextCell(); void setEven(bool even) override; void setHighlighted(bool highlight) override; - virtual Responder * responder() override { + Responder * responder() override { return this; } const char * text() const override { diff --git a/escher/include/escher/message_table_cell.h b/escher/include/escher/message_table_cell.h index 788bfb1b1..10a0e795b 100644 --- a/escher/include/escher/message_table_cell.h +++ b/escher/include/escher/message_table_cell.h @@ -9,7 +9,7 @@ class MessageTableCell : public TableCell { public: MessageTableCell(I18n::Message label = (I18n::Message)0, const KDFont * font = KDFont::SmallFont, Layout layout = Layout::HorizontalLeftOverlap); View * labelView() const override; - virtual void setHighlighted(bool highlight) override; + void setHighlighted(bool highlight) override; void setMessage(I18n::Message message); virtual void setTextColor(KDColor color); void setMessageFont(const KDFont * font); diff --git a/escher/include/escher/nested_menu_controller.h b/escher/include/escher/nested_menu_controller.h index 0ff69acfe..0037d9c90 100644 --- a/escher/include/escher/nested_menu_controller.h +++ b/escher/include/escher/nested_menu_controller.h @@ -19,7 +19,7 @@ public: void viewDidDisappear() override; //ListViewDataSource - virtual KDCoordinate rowHeight(int j) override; + KDCoordinate rowHeight(int j) override; HighlightCell * reusableCell(int index, int type) override; protected: class Stack { diff --git a/escher/include/escher/scroll_view.h b/escher/include/escher/scroll_view.h index a5790af32..34225273e 100644 --- a/escher/include/escher/scroll_view.h +++ b/escher/include/escher/scroll_view.h @@ -106,8 +106,8 @@ protected: void layoutSubviews(bool force = false) override; virtual KDSize contentSize() const { return m_contentView->minimalSizeForOptimalDisplay(); } #if ESCHER_VIEW_LOGGING - virtual const char * className() const override; - virtual void logAttributes(std::ostream &os) const override; + const char * className() const override; + void logAttributes(std::ostream &os) const override; #endif View * m_contentView; private: diff --git a/escher/include/escher/scroll_view_indicator.h b/escher/include/escher/scroll_view_indicator.h index 6779b7fd9..4b81198bd 100644 --- a/escher/include/escher/scroll_view_indicator.h +++ b/escher/include/escher/scroll_view_indicator.h @@ -10,8 +10,8 @@ public: KDCoordinate margin() const { return m_margin; } protected: #if ESCHER_VIEW_LOGGING - virtual const char * className() const override; - virtual void logAttributes(std::ostream &os) const override; + const char * className() const override; + void logAttributes(std::ostream &os) const override; #endif KDColor m_color; KDCoordinate m_margin; diff --git a/escher/include/escher/selectable_table_view.h b/escher/include/escher/selectable_table_view.h index f10a606be..6e4fb7ac0 100644 --- a/escher/include/escher/selectable_table_view.h +++ b/escher/include/escher/selectable_table_view.h @@ -25,9 +25,9 @@ public: void selectRow(int j); void selectColumn(int i); void reloadData(bool setFirstResponder = true); - virtual bool handleEvent(Ion::Events::Event event) override; - virtual void didEnterResponderChain(Responder * previousFirstResponder) override; - virtual void willExitResponderChain(Responder * nextFirstResponder) override; + bool handleEvent(Ion::Events::Event event) override; + void didEnterResponderChain(Responder * previousFirstResponder) override; + void willExitResponderChain(Responder * nextFirstResponder) override; void deselectTable(bool withinTemporarySelection = false); bool selectCellAtLocation(int i, int j, bool setFirstResponder = true, bool withinTemporarySelection = false); HighlightCell * selectedCell(); diff --git a/escher/include/escher/toolbox.h b/escher/include/escher/toolbox.h index 7737c1369..e38df51ed 100644 --- a/escher/include/escher/toolbox.h +++ b/escher/include/escher/toolbox.h @@ -25,8 +25,8 @@ protected: bool returnToPreviousMenu() override; virtual int maxNumberOfDisplayedRows() = 0; virtual const ToolboxMessageTree * rootModel() const = 0; - virtual MessageTableCellWithMessage * leafCellAtIndex(int index) override = 0; - virtual MessageTableCellWithChevron * nodeCellAtIndex(int index) override = 0; + MessageTableCellWithMessage * leafCellAtIndex(int index) override = 0; + MessageTableCellWithChevron * nodeCellAtIndex(int index) override = 0; mutable ToolboxMessageTree * m_messageTreeModel; /* m_messageTreeModel points at the messageTree of the tree (describing the * whole model) where we are located. It enables to know which rows are leaves diff --git a/escher/include/escher/window.h b/escher/include/escher/window.h index 553b386f4..a20a0a59a 100644 --- a/escher/include/escher/window.h +++ b/escher/include/escher/window.h @@ -12,9 +12,9 @@ protected: #if ESCHER_VIEW_LOGGING const char * className() const override; #endif - virtual int numberOfSubviews() const override; - virtual void layoutSubviews(bool force = false) override; - virtual View * subviewAtIndex(int index) override; + int numberOfSubviews() const override; + void layoutSubviews(bool force = false) override; + View * subviewAtIndex(int index) override; View * m_contentView; private: const Window * window() const override; diff --git a/ion/src/device/shared/usb/calculator.h b/ion/src/device/shared/usb/calculator.h index 2532356e3..6dd9679f5 100644 --- a/ion/src/device/shared/usb/calculator.h +++ b/ion/src/device/shared/usb/calculator.h @@ -117,11 +117,11 @@ public: uint32_t addressPointer() const { return m_dfuInterface.addressPointer(); } bool isErasingAndWriting() const { return m_dfuInterface.isErasingAndWriting(); } protected: - virtual Descriptor * descriptor(uint8_t type, uint8_t index) override; - virtual void setActiveConfiguration(uint8_t configurationIndex) override { + Descriptor * descriptor(uint8_t type, uint8_t index) override; + void setActiveConfiguration(uint8_t configurationIndex) override { assert(configurationIndex == k_bConfigurationValue); } - virtual uint8_t getActiveConfiguration() override { + uint8_t getActiveConfiguration() override { return k_bConfigurationValue; } bool processSetupInRequest(SetupPacket * request, uint8_t * transferBuffer, uint16_t * transferBufferLength, uint16_t transferBufferMaxLength) override; diff --git a/ion/src/device/shared/usb/stack/descriptor/bos_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/bos_descriptor.h index 4c68bb327..25529c0e5 100644 --- a/ion/src/device/shared/usb/stack/descriptor/bos_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/bos_descriptor.h @@ -22,7 +22,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint16_t m_wTotalLength; uint8_t m_bNumDeviceCaps; diff --git a/ion/src/device/shared/usb/stack/descriptor/configuration_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/configuration_descriptor.h index aea863c43..9f994b6e3 100644 --- a/ion/src/device/shared/usb/stack/descriptor/configuration_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/configuration_descriptor.h @@ -30,7 +30,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint16_t m_wTotalLength; uint8_t m_bNumInterfaces; diff --git a/ion/src/device/shared/usb/stack/descriptor/device_capability_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/device_capability_descriptor.h index 435358a65..f434352f2 100644 --- a/ion/src/device/shared/usb/stack/descriptor/device_capability_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/device_capability_descriptor.h @@ -19,7 +19,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint8_t m_bDeviceCapabilityType; }; diff --git a/ion/src/device/shared/usb/stack/descriptor/device_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/device_descriptor.h index 840c01da6..3b526f43f 100644 --- a/ion/src/device/shared/usb/stack/descriptor/device_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/device_descriptor.h @@ -39,7 +39,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint16_t m_bcdUSB; uint8_t m_bDeviceClass; diff --git a/ion/src/device/shared/usb/stack/descriptor/dfu_functional_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/dfu_functional_descriptor.h index fb04a824a..604392895 100644 --- a/ion/src/device/shared/usb/stack/descriptor/dfu_functional_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/dfu_functional_descriptor.h @@ -23,7 +23,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint8_t m_bmAttributes; uint16_t m_wDetachTimeOut; diff --git a/ion/src/device/shared/usb/stack/descriptor/interface_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/interface_descriptor.h index ef8481289..6a49bfb8a 100644 --- a/ion/src/device/shared/usb/stack/descriptor/interface_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/interface_descriptor.h @@ -36,7 +36,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint8_t m_bInterfaceNumber; uint8_t m_bAlternateSetting; diff --git a/ion/src/device/shared/usb/stack/descriptor/language_id_string_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/language_id_string_descriptor.h index 198befac8..0f72abb91 100644 --- a/ion/src/device/shared/usb/stack/descriptor/language_id_string_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/language_id_string_descriptor.h @@ -15,7 +15,7 @@ public: Descriptor(0x03) { } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; }; } diff --git a/ion/src/device/shared/usb/stack/descriptor/microsoft_os_string_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/microsoft_os_string_descriptor.h index 69ce1a33d..dfe3a7ab2 100644 --- a/ion/src/device/shared/usb/stack/descriptor/microsoft_os_string_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/microsoft_os_string_descriptor.h @@ -17,7 +17,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint8_t m_bMSVendorCode; uint8_t m_bPad; diff --git a/ion/src/device/shared/usb/stack/descriptor/platform_device_capability_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/platform_device_capability_descriptor.h index 3c35dc11d..d2c425d4a 100644 --- a/ion/src/device/shared/usb/stack/descriptor/platform_device_capability_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/platform_device_capability_descriptor.h @@ -33,7 +33,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: constexpr static uint8_t k_platformCapabilityUUIDSize = 16; uint8_t m_bReserved; diff --git a/ion/src/device/shared/usb/stack/descriptor/string_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/string_descriptor.h index e2f5ea37c..1391c4aec 100644 --- a/ion/src/device/shared/usb/stack/descriptor/string_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/string_descriptor.h @@ -16,7 +16,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: const char * m_string; }; diff --git a/ion/src/device/shared/usb/stack/descriptor/url_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/url_descriptor.h index 3552201a2..7dee33e7c 100644 --- a/ion/src/device/shared/usb/stack/descriptor/url_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/url_descriptor.h @@ -23,7 +23,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: uint8_t m_bScheme; const char * m_string; diff --git a/ion/src/device/shared/usb/stack/descriptor/webusb_platform_descriptor.h b/ion/src/device/shared/usb/stack/descriptor/webusb_platform_descriptor.h index a1b5bcb4b..549bcdae2 100644 --- a/ion/src/device/shared/usb/stack/descriptor/webusb_platform_descriptor.h +++ b/ion/src/device/shared/usb/stack/descriptor/webusb_platform_descriptor.h @@ -18,7 +18,7 @@ public: } protected: void push(Channel * c) const override; - virtual uint8_t bLength() const override; + uint8_t bLength() const override; private: /* Little-endian encoding of {3408B638-09A9-47A0-8BFD-A0768815B665}. * See https://wicg.github.io/webusb/#webusb-platform-capability-descriptor */