From: Roger Wolff Date: Tue, 13 Jul 2010 00:00:00 +0000 (+0000) Subject: mtr v0.80 X-Git-Tag: v0.80^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2d0342ad94f0303700509b97f48c894a3d0ea8c;p=thirdparty%2Fmtr.git mtr v0.80 - Some compilation fixes for BSD by Jeremy Chadwick source: ftp://ftp.bitwizard.nl/mtr/mtr-0.80.tar.gz --- diff --git a/NEWS b/NEWS index caacb87..fad9f11 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ WHAT'S NEW? + V0.80 Some compilation fixes for BSD by Jeremy Chadwick + V0.78/0.79 some compilation fixes for BSD&others by Thomas Klausner V0.76 display load sharing hosts in --raw output. diff --git a/configure.in b/configure.in index d9d29b5..0c8f966 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.79) +AM_INIT_AUTOMAKE(mtr, 0.80) AC_SUBST(GTK_OBJ) diff --git a/dns.c b/dns.c index d40ff9a..512da97 100644 --- a/dns.c +++ b/dns.c @@ -310,12 +310,12 @@ char nullstring[] = ""; int use_dns = 1; #ifdef res_ninit -#define RES_INIT() res_ninit(&myres); +#define MY_RES_INIT() res_ninit(&myres); #define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ res_nmkquery(&myres, a, b, c, d, e, f, g, h, i) struct __res_state myres; #else -#define RES_INIT() res_init(); +#define MY_RES_INIT() res_init(); #define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ res_mkquery(a, b, c, d, e, f, g, h, i) #define myres _res @@ -495,7 +495,7 @@ void dns_open(void) int option,i; if (!dns) return; - RES_INIT(); + MY_RES_INIT(); if (!myres.nscount) { fprintf(stderr,"No nameservers defined.\n"); exit(-1); diff --git a/gtk.c b/gtk.c index 3aa2132..e42f4f6 100644 --- a/gtk.c +++ b/gtk.c @@ -303,6 +303,14 @@ enum { N_COLS }; +// Trick to cast a pointer to integer..... +// We are mis-using a pointer as a single integer. On 64-bit +// architectures, the pointer is 64 bits and the integer only 32. +// The compiler warns us of loss of precision. However we know we +// casted a normal 32-bit integer into this pointer a few microseconds +// earlier, so it is ok. Nothing to worry about.... -- REW. +#define POINTER_TO_INT(p) ((int)(long)(p)) + void float_formatter(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, @@ -311,7 +319,7 @@ void float_formatter(GtkTreeViewColumn *tree_column, { gfloat f; gchar text[64]; - gtk_tree_model_get(tree_model, iter, (gint)data, &f, -1); + gtk_tree_model_get(tree_model, iter, POINTER_TO_INT(data), &f, -1); sprintf(text, "%.2f", f); g_object_set(cell, "text", text, NULL); } @@ -324,7 +332,7 @@ void percent_formatter(GtkTreeViewColumn *tree_column, { gfloat f; gchar text[64]; - gtk_tree_model_get(tree_model, iter, (gint)data, &f, -1); + gtk_tree_model_get(tree_model, iter, POINTER_TO_INT(data), &f, -1); sprintf(text, "%.1f%%", f); g_object_set(cell, "text", text, NULL); } diff --git a/net.c b/net.c index 1e2ebb6..4609da8 100644 --- a/net.c +++ b/net.c @@ -297,8 +297,10 @@ void net_send_query(int index) ttl = index + 1; +#ifdef ENABLE_IPV6 /* offset for ipv6 checksum calculation */ int offset = 6; +#endif if ( packetsize < MINPACKET ) packetsize = MINPACKET; if ( packetsize > MAXPACKET ) packetsize = MAXPACKET;