From 9a6d550d8f496fbdccd13721eb06b5f06c2417ed Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 3 Feb 2023 13:34:19 +0100 Subject: [PATCH] Apply clang-format/cmake-format --- lib/binary/serializable.h | 3 +-- lib/cmake/modules/ReflectionGenerator.cmake | 6 +++++- lib/json/serializable.h | 3 +-- lib/traits.h | 24 +++++++-------------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/lib/binary/serializable.h b/lib/binary/serializable.h index a2f0922..3a87d06 100644 --- a/lib/binary/serializable.h +++ b/lib/binary/serializable.h @@ -58,8 +58,7 @@ template Type BinarySerializable::from * Find out whether this is a compiler bug or a correct error message. */ #define REFLECTIVE_RAPIDJSON_MAKE_BINARY_SERIALIZABLE(T) \ - template <> struct ReflectiveRapidJSON::AdaptedBinarySerializable : Traits::Bool { \ - } + template <> struct ReflectiveRapidJSON::AdaptedBinarySerializable : Traits::Bool {} } // namespace ReflectiveRapidJSON diff --git a/lib/cmake/modules/ReflectionGenerator.cmake b/lib/cmake/modules/ReflectionGenerator.cmake index b80497b..1a65d0e 100644 --- a/lib/cmake/modules/ReflectionGenerator.cmake +++ b/lib/cmake/modules/ReflectionGenerator.cmake @@ -141,7 +141,11 @@ function (add_reflection_generator_invocation) if (ARGS_CLANG_OPTIONS_FROM_TARGETS) foreach (TARGET_NAME ${ARGS_CLANG_OPTIONS_FROM_TARGETS}) # set c++ standard - list(APPEND ARGS_CLANG_OPTIONS "$<$>:-std=c++$>") + list( + APPEND + ARGS_CLANG_OPTIONS + "$<$>:-std=c++$>" + ) # add compile flags and options _reflective_rapidjson_set_prop("${TARGET_NAME}" COMPILE_FLAGS) list(APPEND ARGS_CLANG_OPTIONS "$<$:$>>") diff --git a/lib/json/serializable.h b/lib/json/serializable.h index 26497a6..079ab00 100644 --- a/lib/json/serializable.h +++ b/lib/json/serializable.h @@ -120,8 +120,7 @@ const JsonSerializable &as(const Type &serializable) * Find out whether this is a compiler bug or a correct error message. */ #define REFLECTIVE_RAPIDJSON_MAKE_JSON_SERIALIZABLE(T) \ - template <> struct ReflectiveRapidJSON::AdaptedJsonSerializable : Traits::Bool { \ - } + template <> struct ReflectiveRapidJSON::AdaptedJsonSerializable : Traits::Bool {} /*! * \def The REFLECTIVE_RAPIDJSON_PUSH_PRIVATE_MEMBERS macro enables serialization of private members. diff --git a/lib/traits.h b/lib/traits.h index c608d1b..8aff3db 100644 --- a/lib/traits.h +++ b/lib/traits.h @@ -16,30 +16,22 @@ namespace Traits = ::CppUtilities::Traits; // define structs and macros to allow treating custom data types as std::map, std::set, ... /// \brief \brief The TreatAsMapOrHash class allows treating custom classes as std::map or std::unordered_map. -template struct TreatAsMapOrHash : public Traits::Bool { -}; +template struct TreatAsMapOrHash : public Traits::Bool {}; /// \brief \brief The TreatAsMultiMapOrHash class allows treating custom classes as std::multimap or std::unordered_multimap. -template struct TreatAsMultiMapOrHash : public Traits::Bool { -}; +template struct TreatAsMultiMapOrHash : public Traits::Bool {}; /// \brief \brief The TreatAsSet class allows treating custom classes as std::set or std::unordered_set. -template struct TreatAsSet : public Traits::Bool { -}; +template struct TreatAsSet : public Traits::Bool {}; /// \brief \brief The TreatAsMultiSet class allows treating custom classes as std::multiset or std::unordered_multiset. -template struct TreatAsMultiSet : public Traits::Bool { -}; +template struct TreatAsMultiSet : public Traits::Bool {}; #define REFLECTIVE_RAPIDJSON_TREAT_AS_MAP_OR_HASH(T) \ - template <> struct TreatAsMapOrHash : public Traits::Bool { \ - } + template <> struct TreatAsMapOrHash : public Traits::Bool {} #define REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_MAP_OR_HASH(T) \ - template <> struct TreatAsMultiMapOrHash : public Traits::Bool { \ - } + template <> struct TreatAsMultiMapOrHash : public Traits::Bool {} #define REFLECTIVE_RAPIDJSON_TREAT_AS_SET(T) \ - template <> struct TreatAsSet : public Traits::Bool { \ - } + template <> struct TreatAsSet : public Traits::Bool {} #define REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_SET(T) \ - template <> struct TreatAsMultiSet : public Traits::Bool { \ - } + template <> struct TreatAsMultiSet : public Traits::Bool {} // define traits to check for arrays, sets and maps template