diff options
author | David Robillard <d@drobilla.net> | 2019-10-27 17:26:43 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-10-27 22:40:28 +0100 |
commit | f0c5278f57b1ba231568f8b8fd6ff355b9622a09 (patch) | |
tree | 33cf03f882ed76172144051586f42ff757f02c4a /src/string.c | |
parent | bbe5313c31386366175222cde3055b63848ebb4c (diff) | |
download | serd-f0c5278f57b1ba231568f8b8fd6ff355b9622a09.tar.gz serd-f0c5278f57b1ba231568f8b8fd6ff355b9622a09.tar.bz2 serd-f0c5278f57b1ba231568f8b8fd6ff355b9622a09.zip |
Fix integer conversion warnings
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/string.c b/src/string.c index cde82134..0869bc23 100644 --- a/src/string.c +++ b/src/string.c @@ -170,7 +170,11 @@ static const char b64_unmap[] = "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"; -static inline uint8_t unmap(const uint8_t in) { return b64_unmap[in] - 47; } +static inline uint8_t +unmap(const uint8_t in) +{ + return (uint8_t)(b64_unmap[in] - 47); +} /** Decode 4 base64 characters to 3 raw bytes. @@ -181,7 +185,7 @@ decode_chunk(const uint8_t in[4], uint8_t out[3]) out[0] = (uint8_t)(((unmap(in[0]) << 2)) | unmap(in[1]) >> 4); out[1] = (uint8_t)(((unmap(in[1]) << 4) & 0xF0) | unmap(in[2]) >> 2); out[2] = (uint8_t)(((unmap(in[2]) << 6) & 0xC0) | unmap(in[3])); - return 1 + (in[2] != '=') + ((in[2] != '=') && (in[3] != '=')); + return 1u + (in[2] != '=') + ((in[2] != '=') && (in[3] != '=')); } void* |