From 6140905d6457528b1091b33dc53528457d155c70 Mon Sep 17 00:00:00 2001 From: auto code formatter Date: Wed, 27 Sep 2023 13:09:21 +0000 Subject: [PATCH] apply clang-format --- .../cubos/core/reflection/traits/fields.hpp | 2 +- core/src/cubos/core/reflection/traits/fields.cpp | 14 +++++++------- core/tests/reflection/traits/fields.cpp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/include/cubos/core/reflection/traits/fields.hpp b/core/include/cubos/core/reflection/traits/fields.hpp index c6555462b..3fd4e5d82 100644 --- a/core/include/cubos/core/reflection/traits/fields.hpp +++ b/core/include/cubos/core/reflection/traits/fields.hpp @@ -143,7 +143,7 @@ namespace cubos::core::reflection /// @brief Move constructs. /// @param other Other trait. - FieldsTrait(FieldsTrait&& other) noexcept ; + FieldsTrait(FieldsTrait&& other) noexcept; /// @brief Adds a field to the type. The getter will be deleted using `delete` and thus /// must be allocated using `new`. diff --git a/core/src/cubos/core/reflection/traits/fields.cpp b/core/src/cubos/core/reflection/traits/fields.cpp index b9630f411..22cf36603 100644 --- a/core/src/cubos/core/reflection/traits/fields.cpp +++ b/core/src/cubos/core/reflection/traits/fields.cpp @@ -77,8 +77,8 @@ FieldsTrait::FieldsTrait() { } -FieldsTrait::FieldsTrait(FieldsTrait&& other) - noexcept : mFirstField(other.mFirstField) +FieldsTrait::FieldsTrait(FieldsTrait&& other) noexcept + : mFirstField(other.mFirstField) , mLastField(other.mLastField) { other.mFirstField = nullptr; @@ -89,7 +89,7 @@ FieldsTrait::~FieldsTrait() { while (mFirstField != nullptr) { - auto *next = mFirstField->mNext; + auto* next = mFirstField->mNext; delete mFirstField; mFirstField = next; } @@ -97,12 +97,12 @@ FieldsTrait::~FieldsTrait() FieldsTrait&& FieldsTrait::withField(const Type& type, std::string name, AddressOf* addressOf) && { - for (auto *field = mFirstField; field != nullptr; field = field->mNext) + for (auto* field = mFirstField; field != nullptr; field = field->mNext) { CUBOS_ASSERT(field->mName != name, "Field '{}' already exists", name); } - auto *field = new Field(type, std::move(name), addressOf); + auto* field = new Field(type, std::move(name), addressOf); if (mFirstField != nullptr) { mLastField->mNext = field; @@ -119,7 +119,7 @@ FieldsTrait&& FieldsTrait::withField(const Type& type, std::string name, Address const FieldsTrait::Field* FieldsTrait::field(const std::string& name) const { - for (auto *field = mFirstField; field != nullptr; field = field->mNext) + for (auto* field = mFirstField; field != nullptr; field = field->mNext) { if (field->mName == name) { @@ -136,7 +136,7 @@ FieldsTrait::Iterator FieldsTrait::begin() const return Iterator{mFirstField}; } -FieldsTrait::Iterator FieldsTrait::end() +FieldsTrait::Iterator FieldsTrait::end() { return Iterator{nullptr}; } diff --git a/core/tests/reflection/traits/fields.cpp b/core/tests/reflection/traits/fields.cpp index 1d760b594..08cf512a8 100644 --- a/core/tests/reflection/traits/fields.cpp +++ b/core/tests/reflection/traits/fields.cpp @@ -34,7 +34,7 @@ TEST_CASE("reflection::FieldsTrait") { auto fields = FieldsTrait().withField("foo", &ObjectType::foo); - const auto *field = fields.field("foo"); + const auto* field = fields.field("foo"); REQUIRE(field != nullptr); CHECK(field == &*fields.begin()); CHECK(++fields.begin() == fields.end()); @@ -49,11 +49,11 @@ TEST_CASE("reflection::FieldsTrait") { auto fields = FieldsTrait().withField("foo", &ObjectType::foo).withField("bar", &ObjectType::bar); - const auto *fooField = fields.field("foo"); + const auto* fooField = fields.field("foo"); REQUIRE(fooField != nullptr); CHECK(fooField == &*fields.begin()); - const auto *barField = fields.field("bar"); + const auto* barField = fields.field("bar"); REQUIRE(barField != nullptr); CHECK(barField == &*(++fields.begin())); CHECK(++(++fields.begin()) == fields.end());