diff options
Diffstat (limited to 'src/string_utils.h')
-rw-r--r-- | src/string_utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string_utils.h b/src/string_utils.h index 564c58ad..8f7ea083 100644 --- a/src/string_utils.h +++ b/src/string_utils.h @@ -104,7 +104,7 @@ serd_strncasecmp(const char* s1, const char* s2, size_t n) return 0; } -static inline uint32_t +static inline uint8_t utf8_num_bytes(const uint8_t leading) { return ((leading & 0x80U) == 0x00U) ? 1U // Starts with `0' @@ -114,7 +114,7 @@ utf8_num_bytes(const uint8_t leading) : 0U; // Invalid } -static inline unsigned +static inline uint8_t utf8_num_bytes_for_codepoint(const uint32_t code) { return (code < 0x00000080) ? 1U @@ -126,7 +126,7 @@ utf8_num_bytes_for_codepoint(const uint32_t code) /// Return the code point of a UTF-8 character with known length static inline uint32_t -parse_counted_utf8_char(const uint8_t* const utf8, const size_t size) +parse_counted_utf8_char(const uint8_t* const utf8, const uint8_t size) { uint32_t c = utf8[0] & ((1U << (8U - size)) - 1U); @@ -139,7 +139,7 @@ parse_counted_utf8_char(const uint8_t* const utf8, const size_t size) /// Parse a UTF-8 character, set *size to the length, and return the code point static inline uint32_t -parse_utf8_char(const uint8_t* const utf8, size_t* const size) +parse_utf8_char(const uint8_t* const utf8, uint8_t* const size) { switch (*size = utf8_num_bytes(utf8[0])) { case 1: |