Browse Source

added missing finals for structs and classes

Kajetan Johannes Hammerle 3 years ago
parent
commit
c4789cf526

+ 1 - 1
client/input/Control.h

@@ -4,7 +4,7 @@
 #include "client/input/Keys.h"
 #include "client/input/MouseButtons.h"
 
-struct Control {
+struct Control final {
     void tick();
     
     Keys keys;

+ 1 - 1
client/network/Client.h

@@ -8,7 +8,7 @@
 
 using namespace std;
 
-class Client {
+class Client final {
 public:
     Client();
     virtual ~Client();

+ 1 - 1
client/rendering/RenderSettings.h

@@ -3,7 +3,7 @@
 
 #include "client/math/Vector.h"
 
-struct RenderSettings {
+struct RenderSettings final {
     RenderSettings();
     
     bool ssao;

+ 1 - 1
client/rendering/Renderer.h

@@ -4,7 +4,7 @@
 #include "client/rendering/wrapper/Shader.h"
 #include "client/math/MatrixStack.h"
 
-class Renderer {
+class Renderer final {
 public:
     Renderer(Shader& shader, MatrixStack& stack);
     

+ 1 - 1
client/rendering/wrapper/Framebuffer.h

@@ -44,7 +44,7 @@ private:
     GLuint buffer;
     bool error;
 
-    struct Data {
+    struct Data final {
         uint mask;
         GLint internalFormat;
         GLenum format;

+ 1 - 1
client/rendering/wrapper/Texture.h

@@ -5,7 +5,7 @@
 
 #include "common/utils/Types.h"
 
-class Texture {
+class Texture final {
 public:
     Texture();
     ~Texture();

+ 1 - 1
common/block/Block.h

@@ -4,7 +4,7 @@
 #include "common/utils/HashedString.h"
 #include "common/block/BlockBuilder.h"
 
-class Block {
+class Block final {
 public:
     Block(u16 id, const HashedString& registry, const BlockBuilder& builder);
     u16 getId() const;

+ 1 - 1
common/block/BlockBuilder.h

@@ -1,7 +1,7 @@
 #ifndef BLOCKBUILDER_H
 #define BLOCKBUILDER_H
 
-class BlockBuilder {
+class BlockBuilder final {
 public:
     BlockBuilder();
     BlockBuilder& test();

+ 1 - 1
common/block/BlockRegistry.h

@@ -7,7 +7,7 @@
 #include "common/utils/HashedString.h"
 #include "common/block/Block.h"
 
-class BlockRegistry {
+class BlockRegistry final {
 public:
     BlockRegistry();
     const Block& getBlock(const HashedString& registry) const;

+ 1 - 1
common/stream/Stream.h

@@ -4,7 +4,7 @@
 #include "common/utils/Types.h"
 #include "common/utils/DataVector.h"
 
-class Stream {
+class Stream final {
 public:
     Stream();
     Stream(size_t capacity);

+ 1 - 1
common/utils/Face.h

@@ -4,7 +4,7 @@
 #include <iostream>
 #include <functional>
 
-class Face {
+class Face final {
 public:
     // force usage by reference in every situation
     Face(const Face& other) = delete;

+ 2 - 2
common/utils/HashedString.h

@@ -3,7 +3,7 @@
 
 #include "common/utils/Types.h"
 
-class HashedString {
+class HashedString final {
 public:
     HashedString();
     HashedString(const char* str);
@@ -14,7 +14,7 @@ public:
 
     u32 hashCode() const;
 
-    struct Hasher {
+    struct Hasher final {
         u32 operator()(const HashedString& key) const;
     };
 

+ 1 - 1
common/utils/List.h

@@ -4,7 +4,7 @@
 #include "common/utils/Types.h"
 
 template<typename T, uint L>
-class List {
+class List final {
 public:
 
     List() : entries(0) {

+ 1 - 1
common/utils/RingBuffer.h

@@ -4,7 +4,7 @@
 #include "common/utils/Array.h"
 
 template<typename T, uint N>
-class RingBuffer {
+class RingBuffer final {
 public:
 
     void write(const T& t) {

+ 1 - 1
common/utils/SplitString.h

@@ -3,7 +3,7 @@
 
 #include "common/utils/String.h"
 
-class SplitString {
+class SplitString final {
 public:
     SplitString(const char* str);
     

+ 1 - 1
common/utils/String.h

@@ -3,7 +3,7 @@
 
 #include "common/utils/Types.h"
 
-class String {
+class String final {
 public:
     String();
     String(const char* str);

+ 1 - 1
server/network/Server.cpp

@@ -47,7 +47,7 @@ void Server::listenForClients() const {
     std::cout << message << ": " << strerror(errno) << "\n";
 }
 
-struct ConnectedClient {
+struct ConnectedClient final {
 
     ~ConnectedClient() {
         if(socket != -1) {