diff options
author | David Robillard <d@drobilla.net> | 2021-03-01 19:15:24 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-08 23:23:06 -0500 |
commit | 15485f61df8cbd922907db39fcc864abb002eea3 (patch) | |
tree | 3ea4979ab93405925589d18414a5004e8b46286f /src/string_utils.h | |
parent | 468f7dc4294905d19f55c58c47ba91cd23bf357b (diff) | |
download | serd-15485f61df8cbd922907db39fcc864abb002eea3.tar.gz serd-15485f61df8cbd922907db39fcc864abb002eea3.tar.bz2 serd-15485f61df8cbd922907db39fcc864abb002eea3.zip |
Fix various warnings and conversion issues
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 08ba530c..0e9eee43 100644 --- a/src/string_utils.h +++ b/src/string_utils.h @@ -84,7 +84,7 @@ is_print(const int c) } static inline bool -is_base64(const char c) +is_base64(const int c) { return is_alpha(c) || is_digit(c) || c == '+' || c == '/' || c == '='; } @@ -143,9 +143,9 @@ utf8_num_bytes(const uint8_t c) static inline uint32_t parse_counted_utf8_char(const uint8_t* utf8, size_t size) { - uint32_t c = utf8[0] & ((1u << (8 - size)) - 1); + uint32_t c = utf8[0] & ((1u << (8u - size)) - 1u); for (size_t i = 1; i < size; ++i) { - const uint8_t in = utf8[i] & 0x3F; + const uint8_t in = utf8[i] & 0x3Fu; c = (c << 6) | in; } return c; @@ -163,7 +163,7 @@ parse_utf8_char(const uint8_t* utf8, size_t* size) return parse_counted_utf8_char(utf8, *size); default: *size = 0; - return 0; + return 0u; } } |