]> 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>
Tue, 28 Feb 2023 09:22:22 +0000 (09:22 +0000)
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 d5efb241222d3339dfa638ec0c4b7572075216d3..361d065b6d81070b06577a038c2c642c73afc0d7 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 82d4304d18d47244d704496ef794a0338a5832d2..d29a50545ffceabd77422b98006918a3355cffb0 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;
                }
        }