]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Remove dead code
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 24 Feb 2023 12:02:01 +0000 (14:02 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 23 Aug 2023 06:23:27 +0000 (09:23 +0300)
src/lib-dict/test-dict-client.c
src/lib-master/test-event-stats.c
src/lib/test-mempool-allocfree.c

index a70f4a41d011265b01c00fa9a2c73a88d6722ac6..4d4ca68df5625b047d57c3eeb910a230b8852c06 100644 (file)
@@ -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));
index 565118b4d57b8524b9d26972fe238798afb72c53..2308619fdb7aafee43901c9f7fb57b615753ab03 100644 (file)
@@ -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;
        }
index 6fd69dc0014cefa43058d36322ea8036eaa11bab..0eb330b5f6e04dfe08f12e714b744658df603aa8 100644 (file)
@@ -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;
                }
        }