]> granicus.if.org Git - libevent/commitdiff
test/regress_dns: fix compilation warnings (-Wmissing-field-initializers/for)
authorAzat Khuzhin <a3at.mail@gmail.com>
Thu, 8 Oct 2015 22:43:52 +0000 (01:43 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Thu, 8 Oct 2015 22:47:44 +0000 (01:47 +0300)
I don't have an error for loop because gcc5 have --std=gnu11 by default.
We need some options-consistency for all versions/compilers and build systems
to avoid such patches.

Fixes: https://travis-ci.org/libevent/libevent/jobs/84403473
Fixes: https://travis-ci.org/libevent/libevent/builds/84403463
test/regress_dns.c

index 6be22d71d368be74a6c10b312edf1c26b440c09c..ecce34d15075b20134bd67c675529ff5e326ca18 100644 (file)
@@ -513,20 +513,20 @@ generic_dns_callback(int result, char type, int count, int ttl, void *addresses,
 }
 
 static struct regress_dns_server_table search_table[] = {
-       { "host.a.example.com", "err", "3", 0 },
-       { "host.b.example.com", "err", "3", 0 },
-       { "host.c.example.com", "A", "11.22.33.44", 0 },
-       { "host2.a.example.com", "err", "3", 0 },
-       { "host2.b.example.com", "A", "200.100.0.100", 0 },
-       { "host2.c.example.com", "err", "3", 0 },
-       { "hostn.a.example.com", "errsoa", "0", 0 },
-       { "hostn.b.example.com", "errsoa", "3", 0 },
-       { "hostn.c.example.com", "err", "0", 0 },
-
-       { "host", "err", "3", 0 },
-       { "host2", "err", "3", 0 },
-       { "*", "err", "3", 0 },
-       { NULL, NULL, NULL, 0 }
+       { "host.a.example.com", "err", "3", 0, 0 },
+       { "host.b.example.com", "err", "3", 0, 0 },
+       { "host.c.example.com", "A", "11.22.33.44", 0, 0 },
+       { "host2.a.example.com", "err", "3", 0, 0 },
+       { "host2.b.example.com", "A", "200.100.0.100", 0, 0 },
+       { "host2.c.example.com", "err", "3", 0, 0 },
+       { "hostn.a.example.com", "errsoa", "0", 0, 0 },
+       { "hostn.b.example.com", "errsoa", "3", 0, 0 },
+       { "hostn.c.example.com", "err", "0", 0, 0 },
+
+       { "host", "err", "3", 0, 0 },
+       { "host2", "err", "3", 0, 0 },
+       { "*", "err", "3", 0, 0 },
+       { NULL, NULL, NULL, 0, 0 }
 };
 static void
 dns_search_test_impl(void *arg, int lower)
@@ -539,8 +539,9 @@ dns_search_test_impl(void *arg, int lower)
        char buf[64];
 
        struct generic_dns_callback_result r[8];
+       size_t i;
 
-       for (size_t i = 0; i < ARRAY_SIZE(table); ++i) {
+       for (i = 0; i < ARRAY_SIZE(table); ++i) {
                table[i] = search_table[i];
                table[i].lower = lower;
        }
@@ -793,13 +794,13 @@ static struct regress_dns_server_table internal_error_table[] = {
 
           XXXX we should reissue under a much wider set of circumstances!
         */
-       { "foof.example.com", "err", "4", 0 },
-       { NULL, NULL, NULL, 0 }
+       { "foof.example.com", "err", "4", 0, 0 },
+       { NULL, NULL, NULL, 0, 0 }
 };
 
 static struct regress_dns_server_table reissue_table[] = {
-       { "foof.example.com", "A", "240.15.240.15", 0 },
-       { NULL, NULL, NULL, 0 }
+       { "foof.example.com", "A", "240.15.240.15", 0, 0 },
+       { NULL, NULL, NULL, 0, 0 }
 };
 
 static void