From: W.C.A. Wijngaards Date: Fri, 20 May 2022 13:32:27 +0000 (+0200) Subject: - Fix some lint type warnings. X-Git-Tag: release-1.16.0rc1~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11d077c826c94aa5f20b91382eec3f6e08e59177;p=thirdparty%2Funbound.git - Fix some lint type warnings. --- diff --git a/doc/Changelog b/doc/Changelog index 9cb712bd8..c6ec89811 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,7 @@ - Fix to silence test for ede error output to the console from the test setup script. - Fix ede test to not use default pidfile, and use local interface. + - Fix some lint type warnings. 18 May 2022: George - Fix typos in config_set_option for the 'num-threads' and diff --git a/services/outside_network.c b/services/outside_network.c index 4578bf8fc..ec37a4a80 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -2297,7 +2297,7 @@ reuse_tcp_select_id(struct reuse_tcp* reuse, struct outside_network* outnet) node = rbtree_first(&reuse->tree_by_id); log_assert(node && node != RBTREE_NULL); /* tree not empty */ /* see if select is before first node */ - if(select < tree_by_id_get_id(node)) + if(select < (unsigned)tree_by_id_get_id(node)) return select; count += tree_by_id_get_id(node); /* perhaps select is between nodes */ diff --git a/services/rpz.c b/services/rpz.c index e2642033c..77b6266fe 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -1560,7 +1560,9 @@ rpz_local_encode(struct module_env* env, struct query_info* qinfo, } static struct local_rrset* -rpz_find_synthesized_rrset(int qtype, struct clientip_synthesized_rr* data) { +rpz_find_synthesized_rrset(uint16_t qtype, + struct clientip_synthesized_rr* data) +{ struct local_rrset* cursor = data->data; while( cursor != NULL) { struct packed_rrset_key* packed_rrset = &cursor->rrset->rk; diff --git a/sldns/str2wire.c b/sldns/str2wire.c index 3cfff4bde..303d49ba6 100644 --- a/sldns/str2wire.c +++ b/sldns/str2wire.c @@ -1598,12 +1598,12 @@ static int sldns_str2wire_svcparam_buf(const char* str, uint8_t* rd, size_t* rd_ if (*val_in == '"') { val_in++; while (*val_in != '"' - && (unsigned)(val_out - unescaped_val + 1) < sizeof(unescaped_val) + && (size_t)(val_out - unescaped_val + 1) < sizeof(unescaped_val) && sldns_parse_char( (uint8_t*) val_out, &val_in)) { val_out++; } } else { - while ((unsigned)(val_out - unescaped_val + 1) < sizeof(unescaped_val) + while ((size_t)(val_out - unescaped_val + 1) < sizeof(unescaped_val) && sldns_parse_char( (uint8_t*) val_out, &val_in)) { val_out++; } diff --git a/testcode/unitldns.c b/testcode/unitldns.c index 6397f29db..d226ee203 100644 --- a/testcode/unitldns.c +++ b/testcode/unitldns.c @@ -243,28 +243,28 @@ b64_test(void) memset(target, 0, sizeof(target)); result = sldns_b64_pton(p1, (uint8_t*)target, tarsize); - unit_assert(result == strlen("hello") && strcmp(target, "hello") == 0); + unit_assert(result == (int)strlen("hello") && strcmp(target, "hello") == 0); memset(target, 0, sizeof(target)); result = sldns_b64_pton(p2, (uint8_t*)target, tarsize); - unit_assert(result == strlen("hello>") && strcmp(target, "hello>") == 0); + unit_assert(result == (int)strlen("hello>") && strcmp(target, "hello>") == 0); memset(target, 0, sizeof(target)); result = sldns_b64_pton(p3, (uint8_t*)target, tarsize); - unit_assert(result == strlen("hello?!") && strcmp(target, "hello?!") == 0); + unit_assert(result == (int)strlen("hello?!") && strcmp(target, "hello?!") == 0); memset(target, 0, sizeof(target)); result = sldns_b64_pton(p4, (uint8_t*)target, tarsize); /* when padding is used everything that is not a block of 4 will be * ignored */ - unit_assert(result == strlen("hel") && strcmp(target, "hel") == 0); + unit_assert(result == (int)strlen("hel") && strcmp(target, "hel") == 0); memset(target, 0, sizeof(target)); result = sldns_b64url_pton(u1, strlen(u1), (uint8_t*)target, tarsize); - unit_assert(result == strlen("hello") && strcmp(target, "hello") == 0); + unit_assert(result == (int)strlen("hello") && strcmp(target, "hello") == 0); memset(target, 0, sizeof(target)); result = sldns_b64url_pton(u2, strlen(u2), (uint8_t*)target, tarsize); - unit_assert(result == strlen("hello>") && strcmp(target, "hello>") == 0); + unit_assert(result == (int)strlen("hello>") && strcmp(target, "hello>") == 0); memset(target, 0, sizeof(target)); result = sldns_b64url_pton(u3, strlen(u3), (uint8_t*)target, tarsize); - unit_assert(result == strlen("hello+/") && strcmp(target, "hello?!") == 0); + unit_assert(result == (int)strlen("hello+/") && strcmp(target, "hello?!") == 0); /* one item in block of four is not allowed */ memset(target, 0, sizeof(target)); result = sldns_b64url_pton(u4, strlen(u4), (uint8_t*)target, tarsize); diff --git a/util/netevent.c b/util/netevent.c index 4cbf3573e..841e09787 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -2485,7 +2485,7 @@ http_nonchunk_segment(struct comm_point* c) remainbufferlen = sldns_buffer_capacity(c->buffer) - sldns_buffer_limit(c->buffer); if(remainbufferlen+got_now >= c->tcp_byte_count || - remainbufferlen >= (c->ssl?16384:2048)) { + remainbufferlen >= (size_t)(c->ssl?16384:2048)) { size_t total = sldns_buffer_limit(c->buffer); sldns_buffer_clear(c->buffer); sldns_buffer_set_position(c->buffer, total); diff --git a/validator/validator.h b/validator/validator.h index a97eab25b..694e4c895 100644 --- a/validator/validator.h +++ b/validator/validator.h @@ -93,7 +93,7 @@ struct val_env { int32_t skew_max; /** max number of query restarts, number of IPs to probe */ - int32_t max_restart; + int max_restart; /** TTL for bogus data; used instead of untrusted TTL from data. * Bogus data will not be verified more often than this interval.