From e1f49d990b46e7df29a2fbacc9d701e0b60a442f Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 25 Nov 2007 13:57:05 +0000 Subject: [PATCH] Fix some warnings discovered by compiling the unixsim under cygwin (gcc pedantic) --- src/api/sockets.c | 8 ++++---- src/core/pbuf.c | 3 ++- src/core/snmp/mib2.c | 6 +++--- src/core/sys.c | 6 +++--- src/include/lwip/api_msg.h | 3 +-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index 6b02a46c..5d9acece 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -469,7 +469,7 @@ lwip_recvfrom(int s, void *mem, int len, unsigned int flags, return -1; do { - LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: top while sock->lastdata=%p\n", sock->lastdata)); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: top while sock->lastdata=%p\n", (void*)sock->lastdata)); /* Check if there is data left from the last recv operation. */ if (sock->lastdata) { buf = sock->lastdata; @@ -484,7 +484,7 @@ lwip_recvfrom(int s, void *mem, int len, unsigned int flags, /* No data was left from the previous operation, so we try to get some from the network. */ sock->lastdata = buf = netconn_recv(sock->conn); - LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: netconn_recv netbuf=%p\n", buf)); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: netconn_recv netbuf=%p\n", (void*)buf)); if (!buf) { /* We should really do some error checking here. */ @@ -528,11 +528,11 @@ lwip_recvfrom(int s, void *mem, int len, unsigned int flags, if ((sock->conn->type == NETCONN_TCP) && (buflen - copylen > 0)) { sock->lastdata = buf; sock->lastoffset += copylen; - LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: lastdata now netbuf=%p\n", buf)); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: lastdata now netbuf=%p\n", (void*)buf)); } else { sock->lastdata = NULL; sock->lastoffset = 0; - LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: deleting netbuf=%p\n", buf)); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: deleting netbuf=%p\n", (void*)buf)); netbuf_delete(buf); } } else { diff --git a/src/core/pbuf.c b/src/core/pbuf.c index f766fb7d..1442f243 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -678,7 +678,8 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from) { u16_t offset_to=0, offset_from=0, len; - LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_copy(%p, %p)\n", p_to, p_from)); + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_copy(%p, %p)\n", + (void*)p_to, (void*)p_from)); /* is the target big enough to hold the source? */ LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) && diff --git a/src/core/snmp/mib2.c b/src/core/snmp/mib2.c index c27bea75..b170eefe 100644 --- a/src/core/snmp/mib2.c +++ b/src/core/snmp/mib2.c @@ -2502,16 +2502,16 @@ ifentry_get_value(struct obj_def *od, u16_t len, void *value) { if (netif_is_link_up(netif)) { - *sint_ptr = 1; // up + *sint_ptr = 1; /* up */ } else { - *sint_ptr = 7; // lowerLayerDown + *sint_ptr = 7; /* lowerLayerDown */ } } else { - *sint_ptr = 2; // down + *sint_ptr = 2; /* down */ } } break; diff --git a/src/core/sys.c b/src/core/sys.c index d207e75a..c5a643b9 100644 --- a/src/core/sys.c +++ b/src/core/sys.c @@ -97,7 +97,7 @@ sys_mbox_fetch(sys_mbox_t mbox, void **msg) arg = tmptimeout->arg; memp_free(MEMP_SYS_TIMEOUT, tmptimeout); if (h != NULL) { - LWIP_DEBUGF(SYS_DEBUG, ("smf calling h=%p(%p)\n", h, (void *)arg)); + LWIP_DEBUGF(SYS_DEBUG, ("smf calling h=%p(%p)\n", (void*)&h, arg)); h(arg); } @@ -154,7 +154,7 @@ sys_sem_wait(sys_sem_t sem) arg = tmptimeout->arg; memp_free(MEMP_SYS_TIMEOUT, tmptimeout); if (h != NULL) { - LWIP_DEBUGF(SYS_DEBUG, ("ssw h=%p(%p)\n", h, (void *)arg)); + LWIP_DEBUGF(SYS_DEBUG, ("ssw h=%p(%p)\n", (void*)&h, (void *)arg)); h(arg); } @@ -203,7 +203,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg) timeouts = sys_arch_timeouts(); LWIP_DEBUGF(SYS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p\n", - (void *)timeout, msecs, h, (void *)arg)); + (void *)timeout, msecs, (void*)&h, (void *)arg)); if (timeouts == NULL) { LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL); diff --git a/src/include/lwip/api_msg.h b/src/include/lwip/api_msg.h index 4f5d292b..ce19b40f 100644 --- a/src/include/lwip/api_msg.h +++ b/src/include/lwip/api_msg.h @@ -39,13 +39,12 @@ #include "lwip/ip_addr.h" #include "lwip/err.h" #include "lwip/sys.h" +#include "lwip/igmp.h" #ifdef __cplusplus extern "C" { #endif -enum netconn_igmp; - /* IP addresses and port numbers are expected to be in * the same byte order as in the corresponding pcb. */