From e55fb6da71ff311cd6aba4314304f78053a62db1 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 1 Sep 2024 15:17:54 +0200 Subject: [PATCH] Mark a bunch of classes as final --- irr/include/CIndexBuffer.h | 2 +- irr/include/CMeshBuffer.h | 2 +- irr/include/CVertexBuffer.h | 2 +- irr/include/SAnimatedMesh.h | 2 +- irr/include/SMesh.h | 2 +- irr/include/SSkinMeshBuffer.h | 2 +- irr/src/CFileSystem.h | 2 +- irr/src/CImage.h | 2 +- irr/src/CLimitReadFile.h | 2 +- irr/src/CMemoryFile.h | 2 +- irr/src/CReadFile.h | 2 +- irr/src/CSceneManager.h | 2 +- src/client/inputhandler.h | 7 ++++--- src/client/texturesource.cpp | 2 +- src/network/mtp/impl.h | 2 +- 15 files changed, 18 insertions(+), 17 deletions(-) diff --git a/irr/include/CIndexBuffer.h b/irr/include/CIndexBuffer.h index 676408e65..4318ddaab 100644 --- a/irr/include/CIndexBuffer.h +++ b/irr/include/CIndexBuffer.h @@ -13,7 +13,7 @@ namespace scene { //! Template implementation of the IIndexBuffer interface template -class CIndexBuffer : public IIndexBuffer +class CIndexBuffer final : public IIndexBuffer { public: //! Default constructor for empty buffer diff --git a/irr/include/CMeshBuffer.h b/irr/include/CMeshBuffer.h index 6eb325889..9a6d4426f 100644 --- a/irr/include/CMeshBuffer.h +++ b/irr/include/CMeshBuffer.h @@ -15,7 +15,7 @@ namespace scene { //! Template implementation of the IMeshBuffer interface template -class CMeshBuffer : public IMeshBuffer +class CMeshBuffer final : public IMeshBuffer { public: //! Default constructor for empty meshbuffer diff --git a/irr/include/CVertexBuffer.h b/irr/include/CVertexBuffer.h index 6861913bc..3559bbddb 100644 --- a/irr/include/CVertexBuffer.h +++ b/irr/include/CVertexBuffer.h @@ -13,7 +13,7 @@ namespace scene { //! Template implementation of the IVertexBuffer interface template -class CVertexBuffer : public IVertexBuffer +class CVertexBuffer final : public IVertexBuffer { public: //! Default constructor for empty buffer diff --git a/irr/include/SAnimatedMesh.h b/irr/include/SAnimatedMesh.h index 42ba6b952..8fe14b41f 100644 --- a/irr/include/SAnimatedMesh.h +++ b/irr/include/SAnimatedMesh.h @@ -15,7 +15,7 @@ namespace scene { //! Simple implementation of the IAnimatedMesh interface. -struct SAnimatedMesh : public IAnimatedMesh +struct SAnimatedMesh final : public IAnimatedMesh { //! constructor SAnimatedMesh(scene::IMesh *mesh = 0, scene::E_ANIMATED_MESH_TYPE type = scene::EAMT_UNKNOWN) : diff --git a/irr/include/SMesh.h b/irr/include/SMesh.h index 66e6ecc08..15fa65115 100644 --- a/irr/include/SMesh.h +++ b/irr/include/SMesh.h @@ -14,7 +14,7 @@ namespace irr namespace scene { //! Simple implementation of the IMesh interface. -struct SMesh : public IMesh +struct SMesh final : public IMesh { //! constructor SMesh() diff --git a/irr/include/SSkinMeshBuffer.h b/irr/include/SSkinMeshBuffer.h index fa6eae63a..303207d93 100644 --- a/irr/include/SSkinMeshBuffer.h +++ b/irr/include/SSkinMeshBuffer.h @@ -16,7 +16,7 @@ namespace scene { //! A mesh buffer able to choose between S3DVertex2TCoords, S3DVertex and S3DVertexTangents at runtime -struct SSkinMeshBuffer : public IMeshBuffer +struct SSkinMeshBuffer final : public IMeshBuffer { //! Default constructor SSkinMeshBuffer(video::E_VERTEX_TYPE vt = video::EVT_STANDARD) : diff --git a/irr/src/CFileSystem.h b/irr/src/CFileSystem.h index 208a1ac41..9400d85a3 100644 --- a/irr/src/CFileSystem.h +++ b/irr/src/CFileSystem.h @@ -17,7 +17,7 @@ class CZipReader; /*! FileSystem which uses normal files and one zipfile */ -class CFileSystem : public IFileSystem +class CFileSystem final : public IFileSystem { public: //! constructor diff --git a/irr/src/CImage.h b/irr/src/CImage.h index 955f85705..33a34386e 100644 --- a/irr/src/CImage.h +++ b/irr/src/CImage.h @@ -21,7 +21,7 @@ inline bool checkImageDimensions(u32 width, u32 height) //! IImage implementation with a lot of special image operations for //! 16 bit A1R5G5B5/32 Bit A8R8G8B8 images, which are used by the SoftwareDevice. -class CImage : public IImage +class CImage final : public IImage { public: //! constructor from raw image data diff --git a/irr/src/CLimitReadFile.h b/irr/src/CLimitReadFile.h index 1594135e6..6b02cfdc0 100644 --- a/irr/src/CLimitReadFile.h +++ b/irr/src/CLimitReadFile.h @@ -20,7 +20,7 @@ namespace io This can be useful, for example for reading uncompressed files in an archive (zip, tar). !*/ -class CLimitReadFile : public IReadFile +class CLimitReadFile final : public IReadFile { public: CLimitReadFile(IReadFile *alreadyOpenedFile, long pos, long areaSize, const io::path &name); diff --git a/irr/src/CMemoryFile.h b/irr/src/CMemoryFile.h index 3ce0e8460..83d77cb77 100644 --- a/irr/src/CMemoryFile.h +++ b/irr/src/CMemoryFile.h @@ -17,7 +17,7 @@ namespace io /*! Class for reading from memory. */ -class CMemoryReadFile : public IMemoryReadFile +class CMemoryReadFile final : public IMemoryReadFile { public: //! Constructor diff --git a/irr/src/CReadFile.h b/irr/src/CReadFile.h index 14f674772..c9231be7c 100644 --- a/irr/src/CReadFile.h +++ b/irr/src/CReadFile.h @@ -17,7 +17,7 @@ namespace io /*! Class for reading a real file from disk. */ -class CReadFile : public IReadFile +class CReadFile final : public IReadFile { public: CReadFile(const io::path &fileName); diff --git a/irr/src/CSceneManager.h b/irr/src/CSceneManager.h index 32df145ec..4ef6d64b0 100644 --- a/irr/src/CSceneManager.h +++ b/irr/src/CSceneManager.h @@ -25,7 +25,7 @@ class IMeshCache; /*! The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff. */ -class CSceneManager : public ISceneManager, public ISceneNode +class CSceneManager final : public ISceneManager, public ISceneNode { public: //! constructor diff --git a/src/client/inputhandler.h b/src/client/inputhandler.h index ba85b30ad..daf01c488 100644 --- a/src/client/inputhandler.h +++ b/src/client/inputhandler.h @@ -269,11 +269,12 @@ public: JoystickController joystick; KeyCache keycache; }; + /* - Separated input handler + Separated input handler implementations */ -class RealInputHandler : public InputHandler +class RealInputHandler final : public InputHandler { public: RealInputHandler(MyEventReceiver *receiver) : m_receiver(receiver) @@ -372,7 +373,7 @@ private: v2s32 m_mousepos; }; -class RandomInputHandler : public InputHandler +class RandomInputHandler final : public InputHandler { public: RandomInputHandler() = default; diff --git a/src/client/texturesource.cpp b/src/client/texturesource.cpp index 12a21771a..a4222f414 100644 --- a/src/client/texturesource.cpp +++ b/src/client/texturesource.cpp @@ -39,7 +39,7 @@ struct TextureInfo }; // TextureSource -class TextureSource : public IWritableTextureSource +class TextureSource final : public IWritableTextureSource { public: TextureSource(); diff --git a/src/network/mtp/impl.h b/src/network/mtp/impl.h index cc1d4c2ed..7105bac6d 100644 --- a/src/network/mtp/impl.h +++ b/src/network/mtp/impl.h @@ -234,7 +234,7 @@ class Peer : public IPeer { class UDPPeer; -class Connection : public IConnection +class Connection final : public IConnection { public: friend class ConnectionSendThread;