diff options
author | David Robillard <d@drobilla.net> | 2023-04-03 09:00:21 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-05 09:45:15 -0400 |
commit | 92f7c078250df898b24fce3af1ed6a9ae7d0c029 (patch) | |
tree | b05d5310404a54363b6c85313b377bff0ecbd708 | |
parent | 6afca7558bd9b074957aec421fd22868c5b6698e (diff) | |
download | serd-92f7c078250df898b24fce3af1ed6a9ae7d0c029.tar.gz serd-92f7c078250df898b24fce3af1ed6a9ae7d0c029.tar.bz2 serd-92f7c078250df898b24fce3af1ed6a9ae7d0c029.zip |
Fix sign conversion warnings
-rw-r--r-- | meson/suppressions/meson.build | 5 | ||||
-rw-r--r-- | src/base64.c | 2 | ||||
-rw-r--r-- | src/node.c | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build index dcf9c60f..0fabf3bf 100644 --- a/meson/suppressions/meson.build +++ b/meson/suppressions/meson.build @@ -1,4 +1,4 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> +# Copyright 2020-2023 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC # Project-specific warning suppressions. @@ -25,7 +25,6 @@ if is_variable('cc') '-Wno-nullability-extension', '-Wno-nullable-to-nonnull-conversion', '-Wno-padded', - '-Wno-sign-conversion', ] if host_machine.system() == 'freebsd' @@ -49,7 +48,6 @@ if is_variable('cc') '-Wno-format-nonliteral', '-Wno-inline', '-Wno-padded', - '-Wno-sign-conversion', '-Wno-switch-default', '-Wno-unsuffixed-float-constants', '-Wno-unused-const-variable', @@ -64,7 +62,6 @@ if is_variable('cc') elif cc.get_id() == 'msvc' c_suppressions += [ '/wd4061', # enumerator in switch is not explicitly handled - '/wd4365', # signed/unsigned mismatch '/wd4514', # unreferenced inline function has been removed '/wd4710', # function not inlined '/wd4711', # function selected for automatic inline expansion diff --git a/src/base64.c b/src/base64.c index 02ca828b..ce8fe74d 100644 --- a/src/base64.c +++ b/src/base64.c @@ -90,7 +90,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* @@ -350,7 +350,7 @@ serd_node_new_decimal(const double d, const unsigned frac_digits) SerdNode serd_node_new_integer(const int64_t i) { - uint64_t abs_i = (i < 0) ? -i : i; + uint64_t abs_i = (uint64_t)((i < 0) ? -i : i); const unsigned digits = serd_digits((double)abs_i); char* buf = (char*)calloc(digits + 2, 1); SerdNode node = {(const uint8_t*)buf, 0, 0, 0, SERD_LITERAL}; |