aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-05-29 14:03:32 -0400
committerDavid Robillard <d@drobilla.net>2021-05-31 11:29:16 -0400
commit0ea841d621f81240241fc36a0e6153f57ab88020 (patch)
treeb2260c8df5cc0ce2ddac45ef285eb07a6a066a0f /src/string_utils.h
parent10c6dcff8d28ca2a05d2ebcfa9bb47e24e5a9d64 (diff)
downloadserd-0ea841d621f81240241fc36a0e6153f57ab88020.tar.gz
serd-0ea841d621f81240241fc36a0e6153f57ab88020.tar.bz2
serd-0ea841d621f81240241fc36a0e6153f57ab88020.zip
Fix some conversion warnings
Diffstat (limited to 'src/string_utils.h')
-rw-r--r--src/string_utils.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string_utils.h b/src/string_utils.h
index ac2b40c5..a5dad100 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 uint8_t c)
+is_base64(const int c)
{
return is_alpha(c) || is_digit(c) || c == '+' || c == '/' || c == '=';
}
@@ -146,9 +146,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;
@@ -166,7 +166,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;
}
}