From: Travis Cross Date: Sun, 3 Feb 2013 19:50:18 +0000 (+0000) Subject: Resolve -Wunused-but-set-variable warnings X-Git-Tag: v0.83~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=856dcdff9ffcf94dfb56ca8f227bbc75f01fb752;p=thirdparty%2Fmtr.git Resolve -Wunused-but-set-variable warnings --- diff --git a/curses.c b/curses.c index 3a3f8c5..7f47676 100644 --- a/curses.c +++ b/curses.c @@ -77,12 +77,14 @@ extern float WaitTime; extern int af; extern int mtrtype; +static int __unused_int; + void pwcenter(char *str) { - int maxx, maxy; + int maxx; int cx; - getmaxyx(stdscr, maxy, maxx); + getmaxyx(stdscr, __unused_int, maxx); cx = (signed)(maxx - strlen(str)) / 2; while(cx-- > 0) printw(" "); @@ -293,7 +295,7 @@ void mtr_curses_hosts(int startstat) int at; struct mplslen *mpls, *mplss; ip_t *addr, *addrs; - int y, x; + int y; char *name; int i, j, k; @@ -318,7 +320,7 @@ void mtr_curses_hosts(int startstat) } attroff(A_BOLD); - getyx(stdscr, y, x); + getyx(stdscr, y, __unused_int); move(y, startstat); /* net_xxx returns times in usecs. Just display millisecs */ @@ -465,7 +467,7 @@ void mtr_fill_graph(int at, int cols) void mtr_curses_graph(int startstat, int cols) { - int max, at, y, x; + int max, at, y; ip_t * addr; char* name; @@ -490,7 +492,7 @@ void mtr_curses_graph(int startstat, int cols) } attroff(A_BOLD); - getyx(stdscr, y, x); + getyx(stdscr, y, __unused_int); move(y, startstat); printw(" "); @@ -502,7 +504,7 @@ void mtr_curses_graph(int startstat, int cols) void mtr_curses_redraw(void) { - int maxx, maxy; + int maxx; int startstat; int rowstat; time_t t; @@ -514,7 +516,7 @@ void mtr_curses_redraw(void) erase(); - getmaxyx(stdscr, maxy, maxx); + getmaxyx(stdscr, __unused_int, maxx); rowstat = 5; diff --git a/mtr.c b/mtr.c index 5f1b651..d73ccfd 100644 --- a/mtr.c +++ b/mtr.c @@ -324,7 +324,6 @@ void parse_mtr_options (char *string) int main(int argc, char **argv) { - ip_t * traddr; struct hostent * host = NULL; int net_preopen_result; #ifdef ENABLE_IPV6 @@ -445,8 +444,6 @@ int main(int argc, char **argv) af = host->h_addrtype; #endif - traddr = (ip_t *) host->h_addr; - if (net_open(host) != 0) { fprintf(stderr, "mtr: Unable to start net module.\n"); exit(1); diff --git a/net.c b/net.c index bd7ee41..0487af4 100644 --- a/net.c +++ b/net.c @@ -295,7 +295,7 @@ void net_send_query(int index) /*ok int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + datasize;*/ int rv; static int first=1; - int ttl, iphsize = 0, echotype = 0, salen = 0, udphsize = 0; + int ttl, iphsize = 0, echotype = 0, salen = 0; ttl = index + 1; @@ -369,7 +369,6 @@ void net_send_query(int index) case IPPROTO_UDP: udp = (struct UDPHeader *)(packet + iphsize); - udphsize = sizeof (struct UDPHeader); udp->checksum = 0; mypid = (uint16)getpid(); if (mypid < MinPort)