Fix some warnings discovered by compiling the unixsim under cygwin (gcc pedantic)

This commit is contained in:
goldsimon 2007-11-25 13:57:05 +00:00
parent 1b208d0954
commit e1f49d990b
5 changed files with 13 additions and 13 deletions

View File

@ -469,7 +469,7 @@ lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
return -1; return -1;
do { 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. */ /* Check if there is data left from the last recv operation. */
if (sock->lastdata) { if (sock->lastdata) {
buf = 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 /* No data was left from the previous operation, so we try to get
some from the network. */ some from the network. */
sock->lastdata = buf = netconn_recv(sock->conn); 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) { if (!buf) {
/* We should really do some error checking here. */ /* 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)) { if ((sock->conn->type == NETCONN_TCP) && (buflen - copylen > 0)) {
sock->lastdata = buf; sock->lastdata = buf;
sock->lastoffset += copylen; 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 { } else {
sock->lastdata = NULL; sock->lastdata = NULL;
sock->lastoffset = 0; 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); netbuf_delete(buf);
} }
} else { } else {

View File

@ -678,7 +678,8 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
{ {
u16_t offset_to=0, offset_from=0, len; 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? */ /* is the target big enough to hold the source? */
LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) && LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&

View File

@ -2502,16 +2502,16 @@ ifentry_get_value(struct obj_def *od, u16_t len, void *value)
{ {
if (netif_is_link_up(netif)) if (netif_is_link_up(netif))
{ {
*sint_ptr = 1; // up *sint_ptr = 1; /* up */
} }
else else
{ {
*sint_ptr = 7; // lowerLayerDown *sint_ptr = 7; /* lowerLayerDown */
} }
} }
else else
{ {
*sint_ptr = 2; // down *sint_ptr = 2; /* down */
} }
} }
break; break;

View File

@ -97,7 +97,7 @@ sys_mbox_fetch(sys_mbox_t mbox, void **msg)
arg = tmptimeout->arg; arg = tmptimeout->arg;
memp_free(MEMP_SYS_TIMEOUT, tmptimeout); memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
if (h != NULL) { 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); h(arg);
} }
@ -154,7 +154,7 @@ sys_sem_wait(sys_sem_t sem)
arg = tmptimeout->arg; arg = tmptimeout->arg;
memp_free(MEMP_SYS_TIMEOUT, tmptimeout); memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
if (h != NULL) { 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); h(arg);
} }
@ -203,7 +203,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
timeouts = sys_arch_timeouts(); timeouts = sys_arch_timeouts();
LWIP_DEBUGF(SYS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p\n", 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) { if (timeouts == NULL) {
LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL); LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);

View File

@ -39,13 +39,12 @@
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/err.h" #include "lwip/err.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/igmp.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
enum netconn_igmp;
/* IP addresses and port numbers are expected to be in /* IP addresses and port numbers are expected to be in
* the same byte order as in the corresponding pcb. * the same byte order as in the corresponding pcb.
*/ */