From: Timo Sirainen Date: Fri, 24 Feb 2023 12:02:01 +0000 (+0200) Subject: global: Remove dead code X-Git-Tag: 2.3.21~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c22f4dc1f9809cec5b3287e7110b7725f19645d;p=thirdparty%2Fdovecot%2Fcore.git global: Remove dead code --- diff --git a/src/lib-dict/test-dict-client.c b/src/lib-dict/test-dict-client.c index a70f4a41d0..4d4ca68df5 100644 --- a/src/lib-dict/test-dict-client.c +++ b/src/lib-dict/test-dict-client.c @@ -43,7 +43,6 @@ int main(int argc, char *argv[]) struct dict_op_settings opset; struct ioloop *ioloop; const char *error; - unsigned int i; char key[1000], value[100]; lib_init(); @@ -65,7 +64,7 @@ int main(int argc, char *argv[]) if (dict_init(uri, &set, &dict, &error) < 0) i_fatal("dict_init(%s) failed: %s", argv[1], error); - for (i = 0; !stop; i++) { + while (!stop) { i_snprintf(key, sizeof(key), "%s/%02x", prefix, i_rand_limit(0xff)); i_snprintf(value, sizeof(value), "%04x", i_rand_limit(0xffff)); diff --git a/src/lib-master/test-event-stats.c b/src/lib-master/test-event-stats.c index 565118b4d5..2308619fdb 100644 --- a/src/lib-master/test-event-stats.c +++ b/src/lib-master/test-event-stats.c @@ -248,7 +248,7 @@ static bool compare_test_stats_data_lines(const char *actual, const char *refere { const char *const *lines_ref = t_strsplit(reference, "\n"); const char *const *lines_act = t_strsplit(actual, "\n"); - for(size_t i = 0; *lines_ref != NULL && *lines_act != NULL; i++, lines_ref++, lines_act++) { + for(; *lines_ref != NULL && *lines_act != NULL; lines_ref++, lines_act++) { if (!compare_test_stats_data_line(*lines_ref, *lines_act)) return FALSE; } diff --git a/src/lib/test-mempool-allocfree.c b/src/lib/test-mempool-allocfree.c index 6fd69dc001..0eb330b5f6 100644 --- a/src/lib/test-mempool-allocfree.c +++ b/src/lib/test-mempool-allocfree.c @@ -24,7 +24,6 @@ void test_mempool_allocfree(void) unsigned int i; size_t last_alloc = 0; size_t used = 0; - size_t count = 0; void *mem = NULL; test_begin("mempool_allocfree"); @@ -36,7 +35,6 @@ void test_mempool_allocfree(void) if (mem != NULL) { test_assert_idx(mem_has_bytes(mem, last_alloc, SENSE), i); used -= last_alloc; - count--; } last_alloc = 0; p_free(pool, mem); @@ -44,8 +42,6 @@ void test_mempool_allocfree(void) } else if ((i % 5) == 0) { if (mem != NULL) used -= last_alloc; - else - count++; mem = p_realloc(pool, mem, last_alloc, i*2); if (last_alloc > 0) test_assert_idx(mem_has_bytes(mem, last_alloc, SENSE), i); @@ -56,8 +52,6 @@ void test_mempool_allocfree(void) } else if ((i % 7) == 0) { if (mem != NULL) used -= last_alloc; - else - count++; mem = p_realloc(pool, mem, last_alloc, i-2); if (last_alloc > 0) test_assert_idx(mem_has_bytes(mem, i-2, SENSE), i); @@ -70,7 +64,6 @@ void test_mempool_allocfree(void) /* fill it with sense marker */ memset(mem, SENSE, i); used += i; - count++; last_alloc = i; } }