From f7eede23de6f78b2b33b477b2b4c5451141825d5 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Wed, 2 Oct 2024 19:51:41 -0500 Subject: Add setup for coverage and cppcheck. --- include/fud_utf8.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include/fud_utf8.hpp') 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 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& data) + static constexpr FudUtf8 makeUtf8(const Array& 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; -- cgit v1.2.3