diff --git a/CHANGELOG b/CHANGELOG index 190d97ab..34473b35 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,9 @@ HISTORY ++ New features: + 2007-04-04 Simon Goldschmidt + * arch.h, dhcp.c, : + 2007-03-28 Frédéric Bernon * opt.h, netif.h, dhcp.h, dhcp.c: New configuration option LWIP_NETIF_HOSTNAME allow to define a hostname in netif struct (this is just a pointer, so, you can use a hardcoded diff --git a/src/api/api_msg.c b/src/api/api_msg.c index 39ad6e02..031cc752 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -47,7 +47,8 @@ recv_raw(void *arg, struct raw_pcb *pcb, struct pbuf *p, struct netconn *conn; conn = arg; - if (!conn) return 0; + if (!conn) + return 0; if (conn->recvmbox != SYS_MBOX_NULL) { if (!(buf = memp_malloc(MEMP_NETBUF))) { @@ -78,7 +79,7 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct netbuf *buf; struct netconn *conn; - pcb = pcb; /* Remove warning */ + LWIP_UNUSED_ARG(pcb); conn = arg; @@ -115,7 +116,7 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) struct netconn *conn; u16_t len; - pcb = pcb; /* Remove warning */ + LWIP_UNUSED_ARG(pcb); conn = arg; @@ -147,7 +148,7 @@ poll_tcp(void *arg, struct tcp_pcb *pcb) { struct netconn *conn; - pcb = pcb; /* Remove warning */ + LWIP_UNUSED_ARG(pcb); conn = arg; @@ -164,7 +165,7 @@ sent_tcp(void *arg, struct tcp_pcb *pcb, u16_t len) { struct netconn *conn; - pcb = pcb; /* Remove warning */ + LWIP_UNUSED_ARG(pcb); conn = arg; @@ -445,7 +446,7 @@ do_connected(void *arg, struct tcp_pcb *pcb, err_t err) { struct netconn *conn; - pcb = pcb; /* Remove warning */ + LWIP_UNUSED_ARG(pcb); conn = arg; diff --git a/src/api/sockets.c b/src/api/sockets.c index 5188dfa8..02afc7da 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -323,6 +323,9 @@ lwip_listen(int s, int backlog) struct lwip_socket *sock; err_t err; + /* This does no harm. If debugging is off, backlog is unused. */ + LWIP_UNUSED_ARG(backlog); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d, backlog=%d)\n", s, backlog)); sock = get_socket(s); if (!sock) diff --git a/src/core/dhcp.c b/src/core/dhcp.c index 949834eb..a3548208 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -1197,7 +1197,9 @@ static void dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_ LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->len = %"U16_F"\n", p->len)); LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->tot_len = %"U16_F"\n", p->tot_len)); /* prevent warnings about unused arguments */ - (void)pcb; (void)addr; (void)port; + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(addr); + LWIP_UNUSED_ARG(port); dhcp->p = p; /* TODO: check packet length before reading them */ if (reply_msg->op != DHCP_BOOTREPLY) { diff --git a/src/core/snmp/msg_in.c b/src/core/snmp/msg_in.c index 71daffad..d4f82d77 100644 --- a/src/core/snmp/msg_in.c +++ b/src/core/snmp/msg_in.c @@ -801,7 +801,7 @@ snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, struct udp_hdr *udphdr; /* suppress unused argument warning */ - if (arg); + LWIP_UNUSED_ARG(arg); /* peek in the UDP header (goto IP payload) */ if(pbuf_header(p, UDP_HLEN)){ LWIP_ASSERT("Can't move to UDP header", 0); diff --git a/src/include/lwip/arch.h b/src/include/lwip/arch.h index 3713bba4..9f9803d8 100644 --- a/src/include/lwip/arch.h +++ b/src/include/lwip/arch.h @@ -55,6 +55,10 @@ #endif /* PACK_STRUCT_FIELD */ +#ifndef LWIP_UNUSED_ARG +#define LWIP_UNUSED_ARG(x) (void)x +#endif /* LWIP_UNUSED_ARG */ + #ifdef LWIP_PROVIDE_ERRNO