mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
Introduced #define LWIP_UNUSED_ARG(x) use this for and architecture-independent form to tell the compiler you intentionally are not using this variable. Can be overriden in cc.h.
This commit is contained in:
parent
f8aa14d402
commit
f6bdd2cae4
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user