From b0a77b1a560ef0030971c496daa7be814b9373da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sun, 23 May 2021 17:17:05 +0200 Subject: [PATCH] norm fix --- CPPLINT.cfg | 2 ++ lib/Ray/sources/Drawables/Image.hpp | 4 ++-- lib/wal/sources/Component/Component.cpp | 2 +- lib/wal/sources/Component/Component.hpp | 4 ++-- lib/wal/sources/Component/Movable/MovableComponent.cpp | 2 +- lib/wal/sources/Component/Movable/MovableComponent.hpp | 2 +- lib/wal/sources/Component/Position/PositionComponent.cpp | 2 +- lib/wal/sources/Component/Position/PositionComponent.hpp | 2 +- lib/wal/sources/Entity/Entity.cpp | 4 ++-- lib/wal/sources/Entity/Entity.hpp | 4 ++-- lib/wal/sources/Exception/WalError.cpp | 2 +- lib/wal/sources/Exception/WalError.hpp | 2 +- lib/wal/sources/Models/Callback.hpp | 2 +- lib/wal/sources/Models/Vector3.hpp | 8 ++++---- lib/wal/sources/Scene/Scene.cpp | 3 +-- lib/wal/sources/Scene/Scene.hpp | 2 +- lib/wal/sources/System/Movable/MovableSystem.cpp | 2 +- lib/wal/sources/System/Movable/MovableSystem.hpp | 2 +- lib/wal/sources/System/System.cpp | 2 +- lib/wal/sources/System/System.hpp | 2 +- lib/wal/sources/Wal.cpp | 2 +- lib/wal/sources/Wal.hpp | 3 ++- sources/main.cpp | 2 +- 23 files changed, 32 insertions(+), 30 deletions(-) diff --git a/CPPLINT.cfg b/CPPLINT.cfg index 53e7904e..81525644 100644 --- a/CPPLINT.cfg +++ b/CPPLINT.cfg @@ -14,6 +14,8 @@ filter=-legal/copyright filter=-runtime/indentation_namespace filter=-whitespace/ending_newline filter=-build/header_guard +filter=-readability/todo +filer=-whitespace/indent # due to public class rule #filter=-readability/function,-readability/streams,-readability/todo #filter=-runtime/printf,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn # TODO: this should be re-enabled. diff --git a/lib/Ray/sources/Drawables/Image.hpp b/lib/Ray/sources/Drawables/Image.hpp index 3dfca7cc..dae6385f 100644 --- a/lib/Ray/sources/Drawables/Image.hpp +++ b/lib/Ray/sources/Drawables/Image.hpp @@ -64,7 +64,7 @@ namespace RAY private: //! @brief Image, really, that's just it... ::Image _image; - }; -} + }; +} // namespace RAY #endif /* !IMAGE_HPP_ */ diff --git a/lib/wal/sources/Component/Component.cpp b/lib/wal/sources/Component/Component.cpp index 1c0144da..aba34221 100644 --- a/lib/wal/sources/Component/Component.cpp +++ b/lib/wal/sources/Component/Component.cpp @@ -29,4 +29,4 @@ namespace WAL { // TODO handle events here } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Component/Component.hpp b/lib/wal/sources/Component/Component.hpp index dd8d02d9..33794d89 100644 --- a/lib/wal/sources/Component/Component.hpp +++ b/lib/wal/sources/Component/Component.hpp @@ -37,7 +37,7 @@ namespace WAL //! @param entity The entity that owns the ne component. virtual Component *clone(Entity &entity) const = 0; - //! @brief Used if the component is disabled + //! @brief Used if the component is disabled bool isDisabled() const; //! @brief Disable this component. void setDisable(bool disabled); @@ -48,4 +48,4 @@ namespace WAL //! @brief The entity or this component has just been disable. virtual void onStop(); }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Component/Movable/MovableComponent.cpp b/lib/wal/sources/Component/Movable/MovableComponent.cpp index a86a69ab..2f639a7b 100644 --- a/lib/wal/sources/Component/Movable/MovableComponent.cpp +++ b/lib/wal/sources/Component/Movable/MovableComponent.cpp @@ -19,4 +19,4 @@ namespace WAL { this->_acceleration += force; } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Component/Movable/MovableComponent.hpp b/lib/wal/sources/Component/Movable/MovableComponent.hpp index 0693121a..c96f767f 100644 --- a/lib/wal/sources/Component/Movable/MovableComponent.hpp +++ b/lib/wal/sources/Component/Movable/MovableComponent.hpp @@ -36,4 +36,4 @@ namespace WAL friend class MovableSystem; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Component/Position/PositionComponent.cpp b/lib/wal/sources/Component/Position/PositionComponent.cpp index 1e470254..523ff3d1 100644 --- a/lib/wal/sources/Component/Position/PositionComponent.cpp +++ b/lib/wal/sources/Component/Position/PositionComponent.cpp @@ -40,4 +40,4 @@ namespace WAL { return this->position.z; } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Component/Position/PositionComponent.hpp b/lib/wal/sources/Component/Position/PositionComponent.hpp index 8e11a2e3..f6a84e27 100644 --- a/lib/wal/sources/Component/Position/PositionComponent.hpp +++ b/lib/wal/sources/Component/Position/PositionComponent.hpp @@ -39,4 +39,4 @@ namespace WAL //! @brief A position component is not assignable PositionComponent &operator=(const PositionComponent &) = delete; }; -} +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Entity/Entity.cpp b/lib/wal/sources/Entity/Entity.cpp index 9a59447b..56627a16 100644 --- a/lib/wal/sources/Entity/Entity.cpp +++ b/lib/wal/sources/Entity/Entity.cpp @@ -3,7 +3,7 @@ // #include "Entity/Entity.hpp" - +#include #include namespace WAL @@ -67,4 +67,4 @@ namespace WAL }); return existing != this->_components.end(); } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Entity/Entity.hpp b/lib/wal/sources/Entity/Entity.hpp index 5f4b21ca..f0c3d641 100644 --- a/lib/wal/sources/Entity/Entity.hpp +++ b/lib/wal/sources/Entity/Entity.hpp @@ -34,7 +34,7 @@ namespace WAL //! @brief Get the name fo the entity std::string getName() const; - //! @brief Used if the entity is disabled + //! @brief Used if the entity is disabled bool isDisable() const; //! @brief Disable this entity. @@ -114,4 +114,4 @@ namespace WAL //! @brief An entity is assignable Entity &operator=(const Entity &) = default; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Exception/WalError.cpp b/lib/wal/sources/Exception/WalError.cpp index 53581300..7a3d3b24 100644 --- a/lib/wal/sources/Exception/WalError.cpp +++ b/lib/wal/sources/Exception/WalError.cpp @@ -17,4 +17,4 @@ namespace WAL NotFoundError::NotFoundError(const std::string &what) : WalError(what) {} -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Exception/WalError.hpp b/lib/wal/sources/Exception/WalError.hpp index 0c791647..417ebbd7 100644 --- a/lib/wal/sources/Exception/WalError.hpp +++ b/lib/wal/sources/Exception/WalError.hpp @@ -51,4 +51,4 @@ namespace WAL //! @brief A default assignment operator NotFoundError &operator=(const NotFoundError &) = default; }; -} +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Models/Callback.hpp b/lib/wal/sources/Models/Callback.hpp index 9cce38cd..4b5ed23a 100644 --- a/lib/wal/sources/Models/Callback.hpp +++ b/lib/wal/sources/Models/Callback.hpp @@ -51,4 +51,4 @@ namespace WAL //! @brief A default assignment operator Callback &operator=(const Callback &) = default; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Models/Vector3.hpp b/lib/wal/sources/Models/Vector3.hpp index 9aa58d10..8ae6f2fe 100644 --- a/lib/wal/sources/Models/Vector3.hpp +++ b/lib/wal/sources/Models/Vector3.hpp @@ -85,13 +85,13 @@ namespace WAL } template - Vector3 operator*(Vector3 &b) const + Vector3 operator*(const Vector3 &b) const { return Vector3(this->x * b.x, this->y * b.y, this->z * b.z); } template - Vector3 operator/=(Vector3 &b) + Vector3 operator/=(const Vector3 &b) { this->x /= b.x; this->y /= b.y; @@ -100,7 +100,7 @@ namespace WAL } template - Vector3 operator/(Vector3 &b) const + Vector3 operator/(const Vector3 &b) const { return Vector3(this->x / b.x, this->y / b.y, this->z / b.z); } @@ -164,4 +164,4 @@ std::ostream &operator<<(std::ostream &s, const WAL::Vector3 &v) { s << "Vector3<" << typeid(T).name() << ">("<< v.x << ", " << v.y << ", " << v.z << ")"; return s; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Scene/Scene.cpp b/lib/wal/sources/Scene/Scene.cpp index b0a3b3a7..0ec83228 100644 --- a/lib/wal/sources/Scene/Scene.cpp +++ b/lib/wal/sources/Scene/Scene.cpp @@ -10,5 +10,4 @@ namespace WAL { return this->_entities; } -} - +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Scene/Scene.hpp b/lib/wal/sources/Scene/Scene.hpp index 00329172..3491170e 100644 --- a/lib/wal/sources/Scene/Scene.hpp +++ b/lib/wal/sources/Scene/Scene.hpp @@ -39,4 +39,4 @@ namespace WAL //! @brief A scene is assignable Scene &operator=(const Scene &) = default; }; -} +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/System/Movable/MovableSystem.cpp b/lib/wal/sources/System/Movable/MovableSystem.cpp index 7bd56fb0..db47d6b2 100644 --- a/lib/wal/sources/System/Movable/MovableSystem.cpp +++ b/lib/wal/sources/System/Movable/MovableSystem.cpp @@ -25,4 +25,4 @@ namespace WAL movable._velocity = movable._acceleration * Wal::timestep.count(); movable._acceleration = Vector3f(); } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/System/Movable/MovableSystem.hpp b/lib/wal/sources/System/Movable/MovableSystem.hpp index f7ec3c3c..d19258ae 100644 --- a/lib/wal/sources/System/Movable/MovableSystem.hpp +++ b/lib/wal/sources/System/Movable/MovableSystem.hpp @@ -25,4 +25,4 @@ namespace WAL //! @brief A movable system is assignable. MovableSystem &operator=(const MovableSystem &) = default; }; -} +} // namespace WAL diff --git a/lib/wal/sources/System/System.cpp b/lib/wal/sources/System/System.cpp index 56814735..4cf91ac6 100644 --- a/lib/wal/sources/System/System.cpp +++ b/lib/wal/sources/System/System.cpp @@ -25,4 +25,4 @@ namespace WAL { return this->_dependencies; } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/System/System.hpp b/lib/wal/sources/System/System.hpp index 5ab9b8a5..98905ee9 100644 --- a/lib/wal/sources/System/System.hpp +++ b/lib/wal/sources/System/System.hpp @@ -44,4 +44,4 @@ namespace WAL //! @brief A system can't be instantiated, it should be derived. System &operator=(const System &) = default; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Wal.cpp b/lib/wal/sources/Wal.cpp index 45d2caff..abda5061 100644 --- a/lib/wal/sources/Wal.cpp +++ b/lib/wal/sources/Wal.cpp @@ -66,4 +66,4 @@ namespace WAL return entity.hasComponent(dependency); }); } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Wal.hpp b/lib/wal/sources/Wal.hpp index f1b61f6f..d4be58c5 100644 --- a/lib/wal/sources/Wal.hpp +++ b/lib/wal/sources/Wal.hpp @@ -6,6 +6,7 @@ #pragma once #include +#include #include #include #include @@ -112,4 +113,4 @@ namespace WAL //! @brief A WAL can't be assigned. Wal &operator=(const Wal &) = delete; }; -} +} // namespace WAL \ No newline at end of file diff --git a/sources/main.cpp b/sources/main.cpp index bc091ba2..29af56f6 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -18,7 +18,7 @@ int main() wal.run(); return 0; } catch (const std::exception &ex) { - std::cerr << ex.what() << std::endl; +std::cerr << ex.what() << std::endl; return 84; } }