]> git.tdb.fi Git - libs/gui.git/commitdiff
Use the override specifier where appropriate
authorMikko Rasa <tdb@tdb.fi>
Sun, 27 Nov 2022 09:56:52 +0000 (11:56 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 27 Nov 2022 14:20:17 +0000 (16:20 +0200)
18 files changed:
source/graphics/bmploader.h
source/graphics/devil/devilloader.h
source/graphics/errordialog.h
source/graphics/imageloader.h
source/graphics/jpeg/jpegloader.h
source/graphics/png/pngloader.h
source/graphics/quartz/quartzloader.h
source/input/binarycontrol.h
source/input/bindings.h
source/input/gamecontroller.h
source/input/gesturedetector.h
source/input/hub.h
source/input/keyboard.h
source/input/linux/gamecontroller_platform.h
source/input/mouse.h
source/input/smoothcontrol.h
source/input/touchscreen.h
source/input/windows/gamecontroller_platform.h

index 60be2dc14cf066a87450eefba6e05613109cbc89..60d4a2e5251d7208bba3aa332a284665f589d5a0 100644 (file)
@@ -19,8 +19,8 @@ public:
        static unsigned get_signature_size() { return 2; }
        static bool detect(const std::string &);
 
-       virtual void load_headers_(Image::Data &);
-       virtual void load_pixels_(Image::Data &);
+       void load_headers_(Image::Data &) override;
+       void load_pixels_(Image::Data &) override;
 };
 
 } // namespace Graphics
index 01c26b1ead1282351343fdeda60c559a14dbae90..2a8e28d784bca8d3a9ff92bc53a2a9fa5e80f753 100644 (file)
@@ -14,13 +14,13 @@ private:
 
 public:
        DevilLoader(IO::Seekable &);
-       virtual ~DevilLoader();
+       ~DevilLoader();
 
        static unsigned get_signature_size() { return 128; }
        static bool detect(const std::string &);
 
-       virtual void load_headers_(Image::Data &);
-       virtual void load_pixels_(Image::Data &);
+       void load_headers_(Image::Data &) override;
+       void load_pixels_(Image::Data &) override;
 };
 
 } // namespace Graphics
index 7ece72e3fd483bd3aa57ae7fd1e2e02b07df7ab0..562883c64446057f3efc44669bc8742398d966a5 100644 (file)
@@ -16,7 +16,7 @@ private:
 public:
        ErrorDialog(Display *d): display(d) { }
 
-       virtual bool report_uncaught_exception(const std::exception &) const;
+       bool report_uncaught_exception(const std::exception &) const override;
 };
 
 } // namespace Graphics
index 9a69aca8da3058f3a903e30e92575a9dec21d346..9645f116ffd4228a1098c425339fe7a0f39f3ec3 100644 (file)
@@ -46,9 +46,9 @@ protected:
        class RegisteredLoader: public RegisterBase
        {
        public:
-               virtual unsigned get_signature_size() const { return T::get_signature_size(); }
-               virtual bool detect(const std::string &s) const { return T::detect(s); }
-               virtual ImageLoader *create(IO::Seekable &io) const { return new T(io); }
+               unsigned get_signature_size() const override { return T::get_signature_size(); }
+               bool detect(const std::string &s) const override { return T::detect(s); }
+               ImageLoader *create(IO::Seekable &io) const override { return new T(io); }
        };
 
        struct Registry
index a18d37e81bb10a8de2225ef8c686fa631576bda7..793951acc6784fa16a012e3a1d12c1192ac203b2 100644 (file)
@@ -15,13 +15,13 @@ private:
 
 public:
        JpegLoader(IO::Seekable &);
-       virtual ~JpegLoader();
+       ~JpegLoader();
 
        static unsigned get_signature_size() { return 3; }
        static bool detect(const std::string &);
 
-       virtual void load_headers_(Image::Data &);
-       virtual void load_pixels_(Image::Data &);
+       void load_headers_(Image::Data &) override;
+       void load_pixels_(Image::Data &) override;
 };
 
 } // namespace Graphics
index 7c9390f23f79c4222972f211eeb87d1ad4561bd7..8023b019f7f17dfbbf9944aa165d50f312b73f37 100644 (file)
@@ -15,13 +15,13 @@ private:
 
 public:
        PngLoader(IO::Base &, unsigned = 0);
-       virtual ~PngLoader();
+       ~PngLoader();
 
        static unsigned get_signature_size() { return 8; }
        static bool detect(const std::string &);
 
-       virtual void load_headers_(Image::Data &);
-       virtual void load_pixels_(Image::Data &);
+       void load_headers_(Image::Data &) override;
+       void load_pixels_(Image::Data &) override;
 };
 
 } // namespace Graphics
index 3e856a98fdeb37ce6685f84457fa245ad6e92b00..2aa0588d18ef653aadfa8b2ffb82711e5566cde6 100644 (file)
@@ -15,15 +15,15 @@ private:
 
 public:
        QuartzLoader(IO::Seekable &);
-       virtual ~QuartzLoader();
+       ~QuartzLoader();
 
        /* Experimentally found value, works for png and jpeg at least.  8 bytes
        is not enough for Quartz to recognize png. */
        static unsigned get_signature_size() { return 12; }
        static bool detect(const std::string &);
 
-       virtual void load_headers_(Image::Data &);
-       virtual void load_pixels_(Image::Data &);
+       void load_headers_(Image::Data &) override;
+       void load_pixels_(Image::Data &) override;
 };
 
 } // namespace Graphics
index ff773b8a3fb8f2d225ac01ea387aa5998c6c16a6..e71f4c30204d5de23df792c0bf507131ef36ebb5 100644 (file)
@@ -25,7 +25,7 @@ public:
        BinaryControl();
        BinaryControl(const ControlSource &);
        BinaryControl(Device &, ControlSrcType, unsigned);
-       virtual ~BinaryControl();
+       ~BinaryControl();
 
        /** Sets the threshold between states for axis sources.  No effect on button
        sources */
@@ -36,9 +36,9 @@ public:
        bool was_released() const { return falling_edge; }
 
 private:
-       virtual void on_press();
-       virtual void on_release();
-       virtual void on_motion(float, float);
+       void on_press() override;
+       void on_release() override;
+       void on_motion(float, float) override;
 };
 
 } // namespace Input
index 879a516e20c9ea6e8e156e678044719b3d260ed7..b5e3a3b225f15aa03f9a795d1a46b67c392c0763 100644 (file)
@@ -24,7 +24,7 @@ public:
                Loader(Bindings &);
 
        private:
-               virtual void init_actions();
+               void init_actions() override;
 
                void binding(const std::string &);
                void device_type(DeviceType);
@@ -59,7 +59,7 @@ public:
                        Loader(Binding &);
 
                private:
-                       virtual void init_actions();
+                       void init_actions() override;
 
                        void axis(unsigned, AxisSide);
                        void button(unsigned);
index 863f66f3e5a338bea6d8cdb2acdcb3968f7f43b3..19f98d5c0c075085e41171d9bbb354476916e701 100644 (file)
@@ -21,7 +21,7 @@ private:
 
 public:
        GameController(unsigned);
-       virtual ~GameController();
+       ~GameController();
 
        static unsigned detect();
        static bool is_available(unsigned = 0);
index 51af312720c17da85a4f49692a6116c9022ab5bf..5f7c4afc4f729ee0322db88c0ff44611e02ee458 100644 (file)
@@ -58,8 +58,8 @@ private:
 public:
        GestureDetector(Touchscreen &);
 
-       virtual std::string get_button_name(unsigned) const;
-       virtual std::string get_axis_name(unsigned) const;
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 
 private:
        void touch_down(unsigned);
index 55d58765f1d705dabeeec7ff5eb028a4f65a46b8..1abff37a18cc52cc10b6fa20db170f79a91c3a3b 100644 (file)
@@ -23,11 +23,11 @@ public:
        /// Attaches an input device to the hub.
        void attach(Device &dev);
 
-       virtual Device *find_subdevice(DeviceType, unsigned = 0);
-       virtual Device *find_subdevice(const std::string &);
+       Device *find_subdevice(DeviceType, unsigned = 0) override;
+       Device *find_subdevice(const std::string &) override;
 
-       virtual std::string get_button_name(unsigned) const;
-       virtual std::string get_axis_name(unsigned) const;
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 protected:
        void button_press(unsigned, unsigned);
        void button_release(unsigned, unsigned);
index 15fe4f95cd814f7ef6c7034659c265f29ede18d9..30ec39c139b74d0b8f32a98cedf5dd765510c406 100644 (file)
@@ -23,9 +23,9 @@ private:
 
 public:
        Keyboard(Graphics::Window &);
-       virtual ~Keyboard();
+       ~Keyboard();
 
-       virtual std::string get_button_name(unsigned) const;
+       std::string get_button_name(unsigned) const override;
 private:
        void input_event(const Graphics::Window::Event &);
 };
index 9bc6f589b36ba0af40ee19a028cf322753421294..58313b69d6e19ed92de701595b919f099d4dba2f 100644 (file)
@@ -18,16 +18,16 @@ public:
 
        std::string get_name() const;
 
-       virtual void set_block(bool) { }
-       virtual void set_inherit(bool) { }
+       void set_block(bool) override { }
+       void set_inherit(bool) override { }
 
 protected:
-       virtual std::size_t do_read(char *, std::size_t);
-       virtual std::size_t do_write(const char *, std::size_t);
+       std::size_t do_read(char *, std::size_t) override;
+       std::size_t do_write(const char *, std::size_t) override;
 
 public:
-       virtual const IO::Handle &get_handle(IO::Mode) { return handle; }
-       virtual const IO::Handle &get_event_handle() { return handle; }
+       const IO::Handle &get_handle(IO::Mode) override { return handle; }
+       const IO::Handle &get_event_handle() override { return handle; }
 };
 
 
index 622a783b9960efd31ff201641bd49ae2277eb681..647da7c44d1df448bc3607778f01a39a06da652a 100644 (file)
@@ -21,8 +21,9 @@ private:
 
 public:
        Mouse(Graphics::Window &);
-       virtual std::string get_button_name(unsigned) const;
-       virtual std::string get_axis_name(unsigned) const;
+
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 private:
        void input_event(const Graphics::Window::Event &);
 };
index f16177b2b2ea0076dc176ab9b0f7da76ec747506..11744ddc7fc6f4e4248580bd5b77e141a91745ca 100644 (file)
@@ -29,7 +29,7 @@ public:
        SmoothControl();
        SmoothControl(const ControlSource &);
        SmoothControl(Device &, ControlSrcType, unsigned);
-       virtual ~SmoothControl();
+       ~SmoothControl();
 
        /// Sets the dead zone value.  Any value below this will be treated as 0.
        void set_dead_zone(float);
@@ -45,9 +45,9 @@ public:
        float get_value() const { return value; }
 
 private:
-       virtual void on_press();
-       virtual void on_release();
-       virtual void on_motion(float, float);
+       void on_press() override;
+       void on_release() override;
+       void on_motion(float, float) override;
 };
 
 } // namespace Input
index 0c964068db266d6831d69a643bbb7f1eee681781..487a91c9760d66a93ea1bd6aceae51a78d1bcbed 100644 (file)
@@ -27,8 +27,8 @@ public:
 
        Graphics::Window &get_window() const { return window; }
 
-       virtual std::string get_button_name(unsigned) const;
-       virtual std::string get_axis_name(unsigned) const;
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 private:
        void input_event(const Graphics::Window::Event &);
 
index 46c2dd8a67d96f764555aa8a8aa671e5ada67d50..928ad6770dd3b917f50d823dea17ac2862cbe275 100644 (file)
@@ -25,7 +25,7 @@ public:
        static void remove_slot(Time::Timer::Slot &);
 
 private:
-       virtual void main();
+       void main() override;
 };