From 0e7355e8b83a2a3dd4b01e18ef0044e509084035 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 6 Jan 2019 15:59:51 +0100 Subject: Fix various sign conversion warnings --- src/string_utils.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/string_utils.h') 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; } } -- cgit v1.2.1