From 7932bf483b61a059412bd7fcd8028e89d819a7a9 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 11 Apr 2007 19:39:24 +0000 Subject: [PATCH] Ongoing fix to patch #5822: converted more statements like (void)arg; into LWIP_UNUSED_ARG(arg); --- src/api/tcpip.c | 2 +- src/core/tcp.c | 6 +++--- src/netif/ppp/auth.c | 12 +++++------ src/netif/ppp/ipcp.c | 8 +++---- src/netif/ppp/lcp.c | 4 ++-- src/netif/ppp/pap.c | 8 +++---- src/netif/ppp/ppp.c | 50 ++++++++++++++++++++++---------------------- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/api/tcpip.c b/src/api/tcpip.c index c349d52b..1bce3cbf 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -57,7 +57,7 @@ static int tcpip_tcp_timer_active = 0; static void tcpip_tcp_timer(void *arg) { - (void)arg; + LWIP_UNUSED_ARG(arg); /* call TCP timer handler */ tcp_tmr(); diff --git a/src/core/tcp.c b/src/core/tcp.c index 567d03cc..3bc87f98 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -283,9 +283,9 @@ tcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port) static err_t tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) { - (void)arg; - (void)pcb; - (void)err; + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(err); return ERR_ABRT; } diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index 33349640..00d8b345 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -747,7 +747,7 @@ static void check_idle(void *arg) struct ppp_idle idle; u_short itime; - (void)arg; + LWIP_UNUSED_ARG(arg); if (!get_idle_time(0, &idle)) return; itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); @@ -765,7 +765,7 @@ static void check_idle(void *arg) */ static void connect_time_expired(void *arg) { - (void)arg; + LWIP_UNUSED_ARG(arg); AUTHDEBUG((LOG_INFO, "Connect time expired\n")); lcp_close(0, "Connect time expired"); /* Close connection */ @@ -804,7 +804,7 @@ static void logout(void) */ static int null_login(int unit) { - (void)unit; + LWIP_UNUSED_ARG(unit); /* XXX Fail until we decide that we want to support logins. */ return 0; } @@ -850,9 +850,9 @@ static int have_pap_secret(void) */ static int have_chap_secret(char *client, char *server, u32_t remote) { - (void)client; - (void)server; - (void)remote; + LWIP_UNUSED_ARG(client); + LWIP_UNUSED_ARG(server); + LWIP_UNUSED_ARG(remote); /* XXX Fail until we set up our passwords. */ return 0; } diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index d5b25188..9b8ce9ab 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -1321,10 +1321,10 @@ static int ipcp_printpkt( void *arg ) { - (void)p; - (void)plen; - (void)printer; - (void)arg; + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(plen); + LWIP_UNUSED_ARG(printer); + LWIP_UNUSED_ARG(arg); return 0; } diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index 6a988d6d..ee90f441 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -457,7 +457,7 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) */ static void lcp_protrej(int unit) { - (void)unit; + LWIP_UNUSED_ARG(unit); /* * Can't reject LCP! */ @@ -1908,7 +1908,7 @@ static void lcp_received_echo_reply (fsm *f, int id, u_char *inp, int len) { u32_t magic; - (void)id; + LWIP_UNUSED_ARG(id); /* Check the magic number - don't count replies from ourselves. */ if (len < 4) { diff --git a/src/netif/ppp/pap.c b/src/netif/ppp/pap.c index 23e438ff..41faf537 100644 --- a/src/netif/ppp/pap.c +++ b/src/netif/ppp/pap.c @@ -596,10 +596,10 @@ static int upap_printpkt( void *arg ) { - (void)p; - (void)plen; - (void)printer; - (void)arg; + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(plen); + LWIP_UNUSED_ARG(printer); + LWIP_UNUSED_ARG(arg); return 0; } #endif diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 532845ce..41b63ee1 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -546,7 +546,7 @@ static err_t pppifOutput(struct netif *netif, struct pbuf *pb, struct ip_addr *i struct pbuf *headMB = NULL, *tailMB = NULL, *p; u_char c; - (void)ipaddr; + LWIP_UNUSED_ARG(ipaddr); /* Validate parameters. */ /* We let any protocol value go through - it can't hurt us @@ -865,9 +865,9 @@ void ppp_recv_config( PPPControl *pc = &pppControl[unit]; int i; - (void)accomp; - (void)pcomp; - (void)mru; + LWIP_UNUSED_ARG(accomp); + LWIP_UNUSED_ARG(pcomp); + LWIP_UNUSED_ARG(mru); /* Load the ACCM bits for the 32 control codes. */ for (i = 0; i < 32 / 8; i++) @@ -920,8 +920,8 @@ int ccp_fatal_error(int unit) int get_idle_time(int u, struct ppp_idle *ip) { /* XXX */ - (void)u; - (void)ip; + LWIP_UNUSED_ARG(u); + LWIP_UNUSED_ARG(ip); return 0; } @@ -1029,9 +1029,9 @@ int sifup(int pd) */ int sifnpmode(int u, int proto, enum NPmode mode) { - (void)u; - (void)proto; - (void)mode; + LWIP_UNUSED_ARG(u); + LWIP_UNUSED_ARG(proto); + LWIP_UNUSED_ARG(mode); return 0; } @@ -1097,17 +1097,17 @@ int cifaddr( PPPControl *pc = &pppControl[pd]; int st = 1; - (void)o; - (void)h; + LWIP_UNUSED_ARG(o); + LWIP_UNUSED_ARG(h); if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG((LOG_WARNING, "sifup[%d]: bad parms\n", pd)); } else { - IP4_ADDR(&pc->addrs.our_ipaddr, 0,0,0,0); - IP4_ADDR(&pc->addrs.his_ipaddr, 0,0,0,0); - IP4_ADDR(&pc->addrs.netmask, 255,255,255,0); - IP4_ADDR(&pc->addrs.dns1, 0,0,0,0); - IP4_ADDR(&pc->addrs.dns2, 0,0,0,0); + IP4_ADDR(&pc->addrs.our_ipaddr, 0,0,0,0); + IP4_ADDR(&pc->addrs.his_ipaddr, 0,0,0,0); + IP4_ADDR(&pc->addrs.netmask, 255,255,255,0); + IP4_ADDR(&pc->addrs.dns1, 0,0,0,0); + IP4_ADDR(&pc->addrs.dns2, 0,0,0,0); } return st; } @@ -1120,13 +1120,13 @@ int sifdefaultroute(int pd, u32_t l, u32_t g) PPPControl *pc = &pppControl[pd]; int st = 1; - (void)l; - (void)g; + LWIP_UNUSED_ARG(l); + LWIP_UNUSED_ARG(g); if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG((LOG_WARNING, "sifup[%d]: bad parms\n", pd)); } else { - netif_set_default(&pc->netif); + netif_set_default(&pc->netif); } /* TODO: check how PPP handled the netMask, previously not set by ipSetDefault */ @@ -1142,13 +1142,13 @@ int cifdefaultroute(int pd, u32_t l, u32_t g) PPPControl *pc = &pppControl[pd]; int st = 1; - (void)l; - (void)g; + LWIP_UNUSED_ARG(l); + LWIP_UNUSED_ARG(g); if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG((LOG_WARNING, "sifup[%d]: bad parms\n", pd)); } else { - netif_set_default(NULL); + netif_set_default(NULL); } return st; @@ -1157,8 +1157,8 @@ int cifdefaultroute(int pd, u32_t l, u32_t g) void pppMainWakeup(int pd) { - PPPDEBUG((LOG_DEBUG, "pppMainWakeup: unit %d\n", pd)); - sio_read_abort(pppControl[pd].fd); + PPPDEBUG((LOG_DEBUG, "pppMainWakeup: unit %d\n", pd)); + sio_read_abort(pppControl[pd].fd); } /* these callbacks are necessary because lcp_* functions @@ -1172,7 +1172,7 @@ pppStartCB(void *arg) { int pd = (int)arg; - PPPDEBUG((LOG_DEBUG, "pppStartCB: unit %d\n", pd)); + PPPDEBUG((LOG_DEBUG, "pppStartCB: unit %d\n", pd)); lcp_lowerup(pd); lcp_open(pd); /* Start protocol */ }