From 2c00856aa594eeb19dbca5b783815edbd2b282fe Mon Sep 17 00:00:00 2001 From: David Robillard <d@drobilla.net> Date: Thu, 13 Aug 2020 17:25:47 +0200 Subject: Fix Wno-implicit-int-conversion warnings --- test/dict_bench.c | 4 ++-- wscript | 1 - zix/tree.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/dict_bench.c b/test/dict_bench.c index 92f2e5e..b75ffc7 100644 --- a/test/dict_bench.c +++ b/test/dict_bench.c @@ -67,7 +67,7 @@ main(int argc, char** argv) char* buf = (char*)calloc(1, 1); size_t buf_len = 1; size_t this_str_len = 0; - for (char c; (c = fgetc(fd)) != EOF;) { + for (int c; (c = fgetc(fd)) != EOF;) { if (isspace(c)) { if (this_str_len == 0) { continue; @@ -87,7 +87,7 @@ main(int argc, char** argv) buf_len = this_str_len + 1; buf = (char*)realloc(buf, buf_len); } - buf[this_str_len - 1] = c; + buf[this_str_len - 1] = (char)c; buf[this_str_len] = '\0'; } } diff --git a/wscript b/wscript index fc6bdad..e48bc56 100644 --- a/wscript +++ b/wscript @@ -42,7 +42,6 @@ def configure(conf): 'clang': [ '-Wno-bad-function-cast', '-Wno-cast-align', - '-Wno-implicit-int-conversion', '-Wno-padded', '-Wno-reserved-id-macro', '-Wno-sign-conversion', diff --git a/zix/tree.c b/zix/tree.c index ab23614..4dd0897 100644 --- a/zix/tree.c +++ b/zix/tree.c @@ -566,10 +566,10 @@ zix_tree_remove(ZixTree* t, ZixTreeIter* ti) if (i->parent) { if (i == i->parent->left) { - d_balance = height_change * -1; + d_balance = (uint8_t)height_change * -1; } else { assert(i == i->parent->right); - d_balance = height_change; + d_balance = (uint8_t)height_change; } } } -- cgit v1.2.1