aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-01-06 15:59:51 +0100
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commit0e7355e8b83a2a3dd4b01e18ef0044e509084035 (patch)
treea845d027df03d3244749c0bfb041cbb46c98f33d /src/string_utils.h
parentbda9843d122d49e3a438709a57ffa6391d756dd1 (diff)
downloadserd-0e7355e8b83a2a3dd4b01e18ef0044e509084035.tar.gz
serd-0e7355e8b83a2a3dd4b01e18ef0044e509084035.tar.bz2
serd-0e7355e8b83a2a3dd4b01e18ef0044e509084035.zip
Fix various sign conversion warnings
Diffstat (limited to 'src/string_utils.h')
-rw-r--r--src/string_utils.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/string_utils.h b/src/string_utils.h
index 717cfda5..ff55a1d0 100644
--- a/src/string_utils.h
+++ b/src/string_utils.h
@@ -132,9 +132,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] & ((1 << (8 - size)) - 1);
+ uint32_t c = utf8[0] & ((1U << (8 - 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;
@@ -148,7 +148,8 @@ parse_utf8_char(const uint8_t* utf8, size_t* size)
case 1: case 2: case 3: case 4:
return parse_counted_utf8_char(utf8, *size);
default:
- return *size = 0;
+ *size = 0;
+ return 0U;
}
}