From a2e89ff0c1ccf47cb5e73f46baf4a993abb917ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 4 Jul 2019 11:17:16 +0200 Subject: [PATCH] Get rid of DNS_GEOIP_DATABASE_INIT explicit initializer for geoip dbs Instead of the explicit struct initializer with all member, rely on the fact that static variables are explicitly initialized to 0 if not explicitly initialized. --- bin/named/geoip.c | 2 +- lib/dns/include/dns/geoip.h | 2 -- lib/dns/tests/geoip_test.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/named/geoip.c b/bin/named/geoip.c index 83fbd96e67..5e5d586986 100644 --- a/bin/named/geoip.c +++ b/bin/named/geoip.c @@ -24,7 +24,7 @@ #include #include -static dns_geoip_databases_t geoip_table = DNS_GEOIP_DATABASE_INIT; +static dns_geoip_databases_t geoip_table; #if defined(HAVE_GEOIP2) static MMDB_s geoip_country, geoip_city, geoip_as, geoip_isp, geoip_domain; diff --git a/lib/dns/include/dns/geoip.h b/lib/dns/include/dns/geoip.h index 0b7a99ec19..4dc3291c62 100644 --- a/lib/dns/include/dns/geoip.h +++ b/lib/dns/include/dns/geoip.h @@ -92,8 +92,6 @@ struct dns_geoip_databases { void *domain; /* GeoIP2-Domain */ void *isp; /* GeoIP2-ISP */ void *as; /* GeoIP2-ASN or GeoLite2-ASN */ -#define DNS_GEOIP_DATABASE_INIT \ - { NULL, NULL, NULL, NULL, NULL } }; /*** diff --git a/lib/dns/tests/geoip_test.c b/lib/dns/tests/geoip_test.c index 317032d6ea..2ede4fda01 100644 --- a/lib/dns/tests/geoip_test.c +++ b/lib/dns/tests/geoip_test.c @@ -38,7 +38,7 @@ /* Use GeoIP2 databases from the 'geoip2' system test */ #define TEST_GEOIP_DATA "../../../bin/tests/system/geoip2/data" -static dns_geoip_databases_t geoip = DNS_GEOIP_DATABASE_INIT; +static dns_geoip_databases_t geoip; static MMDB_s geoip_country, geoip_city, geoip_as, geoip_isp, geoip_domain;