From 74d7e2305692868d8e328c5bd91b25a9cd90a880 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 24 Sep 2020 21:02:22 +0200 Subject: [PATCH] Style fixes. --- src/Assert.hpp | 3 +-- src/Exception.hpp | 6 ++++-- src/Memory/BorrowedPtr.hpp | 2 +- src/Memory/UniquePtrList.hpp | 12 ++++++++---- src/SignalHandling.hpp | 1 - src/String/StringView.hpp | 3 ++- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Assert.hpp b/src/Assert.hpp index 19bfe7d..9e390e5 100644 --- a/src/Assert.hpp +++ b/src/Assert.hpp @@ -7,8 +7,7 @@ #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) /// \defgroup Asserts Asserts -/// \brief Group of non-editable strings with faster hashing. - +/// \brief A set of assertion macros. #ifndef NO_ASSERT /// @brief Asserts an expression is true. Throws an exception if the assertion fails. diff --git a/src/Exception.hpp b/src/Exception.hpp index 697d671..be70c8c 100644 --- a/src/Exception.hpp +++ b/src/Exception.hpp @@ -44,7 +44,8 @@ namespace ArbUt { /// @brief Returns the stacktrace of the exception. /// @param depth The max number of stacks it should retrieve. - /// @param include_addr Whether or not the address should be shown if the line information could not be retrieved. + /// @param include_addr Whether or not the address should be shown if the line information could not be + /// retrieved. [[nodiscard]] std::string GetStacktrace([[maybe_unused]] size_t depth = 6, [[maybe_unused]] bool include_addr = true) const { #if !WINDOWS @@ -58,7 +59,8 @@ namespace ArbUt { /// @brief Builds a string from a given stack. /// @param stack The stack to build the string from. /// @param depth The max number of stacks it should retrieve. - /// @param include_addr Whether or not the address should be shown if the line information could not be retrieved. + /// @param include_addr Whether or not the address should be shown if the line information could not be + /// retrieved. static std::string BuildStacktraceFromStack(const backward::StackTrace& stack, size_t depth = 6, bool include_addr = true) { if (stack.size() == 0) { diff --git a/src/Memory/BorrowedPtr.hpp b/src/Memory/BorrowedPtr.hpp index 9430e70..a3961bb 100644 --- a/src/Memory/BorrowedPtr.hpp +++ b/src/Memory/BorrowedPtr.hpp @@ -27,7 +27,7 @@ namespace ArbUt { /// @brief Copy operator. inline BorrowedPtr& operator=(const BorrowedPtr& rhs) noexcept { - if(this == &rhs) + if (this == &rhs) return *this; _raw = rhs._raw; return *this; diff --git a/src/Memory/UniquePtrList.hpp b/src/Memory/UniquePtrList.hpp index b6fd7d3..693526a 100644 --- a/src/Memory/UniquePtrList.hpp +++ b/src/Memory/UniquePtrList.hpp @@ -8,7 +8,8 @@ #include "BorrowedPtr.hpp" namespace ArbUt { - /// @brief Collection of pointers that is owned by the list. When the list exits scope, the destructor on all pointers will be called. + /// @brief Collection of pointers that is owned by the list. When the list exits scope, the destructor on all + /// pointers will be called. template class UniquePtrList { private: std::vector _vector; @@ -20,7 +21,8 @@ namespace ArbUt { /// @brief Initialises a UniquePtrList from a std::vector of raw pointers. /// @param vec A std::vector of raw pointers. inline UniquePtrList(const std::vector& vec) noexcept : _vector(vec) {} - /// @brief Initialises a UniquePtrList with a certain capacity reserved for use. This does not set immediate size. + /// @brief Initialises a UniquePtrList with a certain capacity reserved for use. This does not set immediate + /// size. /// @param capacity The desired capacity. explicit inline UniquePtrList(size_t capacity) : _vector() { _vector.reserve(capacity); } /// @brief Initialises a UniquePtrList from a initialiser_list. @@ -55,7 +57,8 @@ namespace ArbUt { #endif return _vector[index]; } - /// @brief Returns a raw pointer at an index, and releases ownership. Proper handling of the memory is assumed to be done by the taker. + /// @brief Returns a raw pointer at an index, and releases ownership. Proper handling of the memory is assumed + /// to be done by the taker. /// @param index The index to get the pointer from. /// @return A raw pointer. ValueT* TakeOwnership(size_t index) { @@ -71,7 +74,8 @@ namespace ArbUt { _vector[indexA] = _vector[indexB]; _vector[indexB] = temp; } - /// @brief Sets a pointer to a certain index. If an item already existed at that index, it's destructor will be called. + /// @brief Sets a pointer to a certain index. If an item already existed at that index, it's destructor will be + /// called. /// @param index The index to set the pointer to. /// @param ptr The pointer to store. void Set(size_t index, ValueT* ptr) { diff --git a/src/SignalHandling.hpp b/src/SignalHandling.hpp index 7f6acef..1e037c2 100644 --- a/src/SignalHandling.hpp +++ b/src/SignalHandling.hpp @@ -176,5 +176,4 @@ namespace ArbUt { /// @fn ArbUt::SignalHandling::loaded() /// @brief Whether or not the signal handler is loaded - #endif // ARBUTILS_SIGNALHANDLING_HPP diff --git a/src/String/StringView.hpp b/src/String/StringView.hpp index 722d286..6f936fb 100644 --- a/src/String/StringView.hpp +++ b/src/String/StringView.hpp @@ -62,7 +62,8 @@ namespace ArbUt { /// @brief Copy operator /// @param other Other StringView StringView(const StringView& other) noexcept : BasicStringView(other._length, other._hash), _str(other._str) {} - /// @brief Special constructor of stringview, specifically designed for use of conversion from StringViewLiteral to StringView. + /// @brief Special constructor of stringview, specifically designed for use of conversion from StringViewLiteral + /// to StringView. /// @param other Other StringView /// @param c A null-terminated C string. /// @param length The length of the C string.