From c5440a6b044de78bee086d2527cd067ea99f546b Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Thu, 16 Jul 2009 20:35:56 -0400 Subject: Minor cleanups --- src/dillo.cc | 4 ++-- src/dns.c | 5 +---- src/dns.h | 6 +++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/dillo.cc b/src/dillo.cc index 3e663a4d..45a98de6 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -205,8 +205,8 @@ static DilloUrl *makeStartUrl(char *str, bool local) */ int main(int argc, char **argv) { - uint opt_id; - uint options_got = 0; + uint_t opt_id; + uint_t options_got = 0; uint32_t xid = 0; int idx = 1; int xpos = PREFS_GEOMETRY_DEFAULT_XPOS, ypos = PREFS_GEOMETRY_DEFAULT_YPOS, diff --git a/src/dns.c b/src/dns.c index cc17b0cd..2cee0e85 100644 --- a/src/dns.c +++ b/src/dns.c @@ -87,7 +87,6 @@ static GDnsCache *dns_cache; static int dns_cache_size, dns_cache_size_max; static GDnsQueue *dns_queue; static int dns_queue_size, dns_queue_size_max; -static bool_t ipv6_enabled; /* ---------------------------------------------------------------------- @@ -200,16 +199,14 @@ void a_Dns_init(void) #endif } - /* IPv6 test */ - ipv6_enabled = FALSE; #ifdef ENABLE_IPV6 + /* IPv6 test */ { /* If the IPv6 address family is not available there is no point wasting time trying to connect to v6 addresses. */ int fd = socket(AF_INET6, SOCK_STREAM, 0); if (fd >= 0) { close(fd); - ipv6_enabled = TRUE; } } #endif diff --git a/src/dns.h b/src/dns.h index fca28727..78f8cf18 100644 --- a/src/dns.h +++ b/src/dns.h @@ -14,7 +14,11 @@ void a_Dns_init (void); void a_Dns_freeall(void); void a_Dns_resolve(const char *hostname, DnsCallback_t cb_func, void *cb_data); -#define DILLO_ADDR_MAX sizeof(struct in6_addr) +#ifdef ENABLE_IPV6 +# define DILLO_ADDR_MAX sizeof(struct in6_addr) +#else +# define DILLO_ADDR_MAX sizeof(struct in_addr) +#endif typedef struct _DilloHost { -- cgit v1.2.3