From: Daniel Karbach Date: Fri, 11 Nov 2016 15:30:47 +0000 (+0100) Subject: some linting X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=3185bad87c06739e4ec19b456c7158437ba9621f;p=blank.git some linting --- diff --git a/src/app/Assets.hpp b/src/app/Assets.hpp index ef63518..9766577 100644 --- a/src/app/Assets.hpp +++ b/src/app/Assets.hpp @@ -54,7 +54,7 @@ struct Assets { Font large_ui_font; Font small_ui_font; - Assets(const AssetLoader &); + explicit Assets(const AssetLoader &); }; diff --git a/src/geometry/primitive.hpp b/src/geometry/primitive.hpp index 76064c1..52a3617 100644 --- a/src/geometry/primitive.hpp +++ b/src/geometry/primitive.hpp @@ -102,7 +102,7 @@ struct Plane { Plane(const glm::vec3 &n, float d) : normal(n), dist(d) { } - Plane(const glm::vec4 &abcd) + explicit Plane(const glm::vec4 &abcd) : normal(abcd), dist(abcd.w) { } void Normalize() noexcept { @@ -130,14 +130,14 @@ struct Frustum { const Plane &Far() const noexcept { return plane[5]; } /// create frustum from transposed MVP - Frustum(const glm::mat4 &mat) + explicit Frustum(const glm::mat4 &mat) : plane{ - { mat[3] + mat[0] }, - { mat[3] - mat[0] }, - { mat[3] + mat[1] }, - { mat[3] - mat[1] }, - { mat[3] + mat[2] }, - { mat[3] - mat[2] }, + Plane{ mat[3] + mat[0] }, + Plane{ mat[3] - mat[0] }, + Plane{ mat[3] + mat[1] }, + Plane{ mat[3] - mat[1] }, + Plane{ mat[3] + mat[2] }, + Plane{ mat[3] - mat[2] }, } { } void Normalize() noexcept { diff --git a/src/io/TokenStreamReader.hpp b/src/io/TokenStreamReader.hpp index 7b5a8ff..f1b7349 100644 --- a/src/io/TokenStreamReader.hpp +++ b/src/io/TokenStreamReader.hpp @@ -14,7 +14,7 @@ namespace blank { class TokenStreamReader { public: - TokenStreamReader(std::istream &); + explicit TokenStreamReader(std::istream &); bool HasMore(); const Token &Next(); diff --git a/src/model/bounds.hpp b/src/model/bounds.hpp index 7177290..72ea01f 100644 --- a/src/model/bounds.hpp +++ b/src/model/bounds.hpp @@ -14,7 +14,7 @@ class CuboidBounds : public CollisionBounds { public: - CuboidBounds(const AABB &bounds); + explicit CuboidBounds(const AABB &bounds); bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; diff --git a/src/world/ChunkStore.hpp b/src/world/ChunkStore.hpp index 79a9db1..a0fd0f9 100644 --- a/src/world/ChunkStore.hpp +++ b/src/world/ChunkStore.hpp @@ -13,7 +13,7 @@ class ChunkIndex; class ChunkStore { public: - ChunkStore(const BlockTypeRegistry &); + explicit ChunkStore(const BlockTypeRegistry &); ~ChunkStore(); ChunkStore(const ChunkStore &) = delete; diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 3374e99..7f2233e 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -113,7 +113,7 @@ struct UnsetNode UnsetNode(Chunk *chunk, RoughLocation::Fine pos) : SetNode(chunk, pos), level(Get()) { } - UnsetNode(const SetNode &set) + explicit UnsetNode(const SetNode &set) : SetNode(set), level(Get()) { }