Skip to content

Commit 21643ed

Browse files
committed
Sorting of includes and special case handling of preprocessor macros
1 parent a7f6970 commit 21643ed

9 files changed

Lines changed: 24 additions & 20 deletions

File tree

libraries/application/src/morpheus/application/po/adapters/enum.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include "morpheus/core/meta/concepts/enum.hpp"
43
#include "morpheus/core/conversion/adapters/enum.hpp"
4+
#include "morpheus/core/meta/concepts/enum.hpp"
55

66
#include <boost/any.hpp>
77
#include <boost/program_options.hpp>

libraries/application/tests/po/adapters/scannable.tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "morpheus/application/po/options.hpp"
21
#include "morpheus/application/po/adapters/scannable.hpp"
2+
#include "morpheus/application/po/options.hpp"
33
#include "morpheus/application/version.hpp"
44
#include "morpheus/core/conformance/scan.hpp"
55
#include "morpheus/logging.hpp"
@@ -70,7 +70,7 @@ TEST_CASE_METHOD(LoggingFixture, "Test parsing of scannable as options", "[morph
7070
return location.coordinates;
7171
};
7272

73-
REQUIRE(getCoordinates("[1, 97]") == Coordinates {1.0, 97.0});
73+
REQUIRE(getCoordinates("[1, 97]") == Coordinates{1.0, 97.0});
7474
}
7575
SECTION("Ensure invalid value parse correctly")
7676
{

libraries/application/tests/po/adapters/std/chrono.tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "morpheus/application/po/options.hpp"
21
#include "morpheus/application/po/adapters/std/chrono.hpp"
2+
#include "morpheus/application/po/options.hpp"
33
#include "morpheus/application/version.hpp"
44
#include "morpheus/core/conformance/date.hpp"
55
#include "morpheus/core/serialisation/adapters/std/chrono.hpp"
@@ -14,8 +14,8 @@
1414
#include <functional>
1515
#include <optional>
1616
#include <ostream>
17-
#include <string_view>
1817
#include <string>
18+
#include <string_view>
1919

2020
namespace morpheus::application::po
2121
{

libraries/application/tests/po/adapters/std/optional.tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "morpheus/application/po/options.hpp"
21
#include "morpheus/application/po/adapters/std/optional.hpp" // IWYU pragma: keep
2+
#include "morpheus/application/po/options.hpp"
33
#include "morpheus/application/version.hpp"
44
#include "morpheus/logging.hpp"
55

libraries/core/mocking/morpheus/core/serialisation/mock/reader.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
#include <gmock/gmock.h>
66

7-
#include <cstdint>
87
#include <cstddef>
8+
#include <cstdint>
99
#include <optional>
1010
#include <span>
11-
#include <string_view>
1211
#include <string>
12+
#include <string_view>
1313
#include <vector>
1414

1515
namespace morpheus::serialisation::mock
@@ -70,14 +70,15 @@ class Reader
7070
/// Reads a std::string type from the serialisation.
7171
MOCK_METHOD(std::string, read, (std::string), ());
7272
/// Reads a string literal type from the serialisation.
73-
MOCK_METHOD(std::string, read, (char const * const), ());
73+
MOCK_METHOD(std::string, read, (char const* const), ());
7474
/// Reads a blob of bytes from the serialisation.
7575
MOCK_METHOD(std::vector<std::byte>, read, (std::vector<std::byte>), ());
7676
///@}
7777

7878
/// Template wrapper around read which dispatches to the correct concrete read method based on the type T.
79-
template<typename T>
80-
T read() requires requires(Reader r) { r.read(T{}); }
79+
template <typename T>
80+
T read()
81+
requires requires(Reader r) { r.read(T{}); }
8182
{
8283
return read(T{});
8384
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include "morpheus/core/serialisation/mock/writer.hpp"
43
#include "morpheus/core/serialisation/mock/reader.hpp"
4+
#include "morpheus/core/serialisation/mock/writer.hpp"
55
#include "morpheus/core/serialisation/read_serialiser.hpp"
66
#include "morpheus/core/serialisation/write_serialiser.hpp"
77

@@ -11,4 +11,4 @@ namespace morpheus::serialisation
1111
using MockedWriteSerialiser = WriteSerialiser<mock::Writer>;
1212
using MockedReadSerialiser = ReadSerialiser<mock::Reader>;
1313

14-
}
14+
} // namespace morpheus::serialisation

libraries/core/src/morpheus/core/base/compiler.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
and version.
66
@{
77
*/
8-
8+
// clang-format off
99
#if !defined(MORPHEUS_COMPILER)
1010

1111
/*! \def MORPHEUS_CLANG_COMPILER
@@ -120,4 +120,5 @@
120120
(MORPHEUS_COMPILER == MORPHEUS_VISUALSTUDIO_COMPILER) || (MORPHEUS_INTEL_COMPILER_FOR_WINDOWS)
121121

122122
#endif // !defined ( MORPHEUS_COMPILER )
123+
// clang-format on
123124
/// @}

libraries/core/src/morpheus/core/base/platform.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
\def MORPHEUS_BUILD_PLATFORM
1111
Macro describing the current build platform of the build.
1212
*/
13+
// clang-format off
1314
#if !defined(MORPHEUS_BUILD_PLATFORM)
1415

1516
/*! \def MORPHEUS_TARGET_PLATFORM_PC_WINDOWS
@@ -46,12 +47,12 @@
4647

4748
#endif
4849
#endif
50+
// clang-format on
4951
/// @}
5052

5153
/*! \def MORPHEUS_COMPILER_DEAD_CODE_ELIMINATION
5254
Macro present when dead code elimination is enabled in the build.
5355
*/
54-
#if (MORPHEUS_IS_GCC_COMPATIBLE_COMPILER && __OPTIMIZE__) || \
55-
(MORPHEUS_IS_VISUALSTUDIO_COMPATIBLE_COMPILER && !defined __MSVC_RUNTIME_CHECKS && defined NDEBUG)
56+
#if (MORPHEUS_IS_GCC_COMPATIBLE_COMPILER && __OPTIMIZE__) || (MORPHEUS_IS_VISUALSTUDIO_COMPATIBLE_COMPILER && !defined __MSVC_RUNTIME_CHECKS && defined NDEBUG)
5657
#define MORPHEUS_COMPILER_DEAD_CODE_ELIMINATION
5758
#endif

libraries/core/src/morpheus/core/cpu.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ using CpuidLeafs = std::vector<CpuidResults>;
3434
/// This type stores information about the capabilities of the central processing unit of the current target
3535
/// system.
3636
///
37-
class MORPHEUSCORE_EXPORT Cpu {
37+
class MORPHEUSCORE_EXPORT Cpu
38+
{
3839
public:
3940
//! Default constructor.
4041
Cpu();
@@ -46,10 +47,10 @@ class MORPHEUSCORE_EXPORT Cpu {
4647
[[nodiscard]] auto const& getBrandId() const noexcept { return mBrandId; }
4748

4849
private:
49-
std::uint32_t mMaxLeaf; //!< Maximum available leaf function for the cpuid instruction.
50+
std::uint32_t mMaxLeaf; //!< Maximum available leaf function for the cpuid instruction.
5051
std::uint32_t mMaxExtendedLeaf; //!< Maximum available extended leaf function for the cpuid instruction.
51-
CpuidLeafs mLeafs; //!< Cached results of executing the standard cpuid leaf functions.
52-
CpuidLeafs mExtendedLeafs; //!< Cached results of executing the extended cpuid leaf functions.
52+
CpuidLeafs mLeafs; //!< Cached results of executing the standard cpuid leaf functions.
53+
CpuidLeafs mExtendedLeafs; //!< Cached results of executing the extended cpuid leaf functions.
5354
std::string mVendorId;
5455
std::string mBrandId;
5556
};

0 commit comments

Comments
 (0)