diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-02 19:51:41 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-02 19:51:41 -0500 |
commit | f7eede23de6f78b2b33b477b2b4c5451141825d5 (patch) | |
tree | d698a92272b8e4a8428b82d9a21f3e98ed267a6d /include/fud_utf8.hpp | |
parent | 32c722d50943bbdeba65a77d5e94f8692cf75f3c (diff) |
Add setup for coverage and cppcheck.
Diffstat (limited to 'include/fud_utf8.hpp')
-rw-r--r-- | include/fud_utf8.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/fud_utf8.hpp b/include/fud_utf8.hpp index 99766d4..5b84a3a 100644 --- a/include/fud_utf8.hpp +++ b/include/fud_utf8.hpp @@ -19,7 +19,6 @@ #define FUD_UTF8_HPP #include "fud_array.hpp" -#include "fud_memory.hpp" #include "fud_status.hpp" #include "fud_unique_array.hpp" @@ -62,7 +61,7 @@ constexpr bool validUtf8MB(utf8 code) noexcept struct Ascii { Array<utf8, 1> characters; - constexpr Ascii() noexcept = default; + constexpr Ascii() noexcept = default; // cppcheck-suppress uninitMemberVar constexpr explicit Ascii(utf8 chr) noexcept : characters{{chr}} { @@ -252,10 +251,10 @@ struct FudUtf8 { static constexpr Ascii invalidAsciiCode{Ascii{0xFF}}; static FudUtf8 fromString(const String& fudString, size_t index) noexcept; - static FudUtf8 fromStringView(StringView&& fudView, size_t index) noexcept; - static FudUtf8 fromStringView(const StringView& fudView, size_t index) noexcept; + static FudUtf8 fromStringView(StringView&& view, size_t index) noexcept; + static FudUtf8 fromStringView(const StringView& view, size_t index) noexcept; - static constexpr FudUtf8 makeUtf8(Array<utf8, 4>& data) + static constexpr FudUtf8 makeUtf8(const Array<utf8, 4>& data) { FudUtf8 unicode{}; if (Ascii::valid(data[0])) { @@ -367,10 +366,10 @@ struct FudUtf8 { [[nodiscard]] constexpr int64_t hash() const noexcept { - using fud::Utf8Type; using fud::Utf82Byte; using fud::Utf83Byte; using fud::Utf84Byte; + using fud::Utf8Type; if (!valid()) { return -1; |