From 5d20e690fddbc40d8063e10d8fead6287f9739e5 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 8 Mar 2010 12:17:29 +0000 Subject: [PATCH] Added/corrected casts --- src/api/api_lib.c | 6 +++--- src/api/sockets.c | 4 ++-- src/core/tcp_out.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/api_lib.c b/src/api/api_lib.c index 25106d60..b334dca9 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -418,7 +418,7 @@ netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf) LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL) && netconn_type(conn) == NETCONN_TCP, return ERR_ARG;); - return netconn_recv_data(conn, new_buf); + return netconn_recv_data(conn, (void **)new_buf); } /** @@ -451,7 +451,7 @@ netconn_recv(struct netconn *conn, struct netbuf **new_buf) return ERR_MEM; } - err = netconn_recv_data(conn, &p); + err = netconn_recv_data(conn, (void **)&p); if (err != ERR_OK) { memp_free(MEMP_NETBUF, buf); return err; @@ -468,7 +468,7 @@ netconn_recv(struct netconn *conn, struct netbuf **new_buf) #endif /* LWIP_TCP */ } else { #if (LWIP_UDP || LWIP_RAW) - return netconn_recv_data(conn, new_buf); + return netconn_recv_data(conn, (void **)new_buf); #endif /* (LWIP_UDP || LWIP_RAW) */ } } diff --git a/src/api/sockets.c b/src/api/sockets.c index 988437e8..a67c4772 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -578,9 +578,9 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, /* No data was left from the previous operation, so we try to get some from the network. */ if (netconn_type(sock->conn) == NETCONN_TCP) { - err = netconn_recv_tcp_pbuf(sock->conn, &(struct pbuf *)buf); + err = netconn_recv_tcp_pbuf(sock->conn, (struct pbuf **)&buf); } else { - err = netconn_recv(sock->conn, &(struct netbuf *)buf); + err = netconn_recv(sock->conn, (struct netbuf **)&buf); } LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: netconn_recv err=%d, netbuf=%p\n", err, buf)); diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 6f244736..4118a253 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -124,7 +124,7 @@ tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, struct tcp_seg *seg; u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags); - if ((seg = memp_malloc(MEMP_TCP_SEG)) == NULL) { + if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) { LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no memory.\n")); pbuf_free(p); return NULL; @@ -142,7 +142,7 @@ tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, tcp_seg_free(seg); return NULL; } - seg->tcphdr = seg->p->payload; + seg->tcphdr = (struct tcp_hdr *)seg->p->payload; seg->tcphdr->src = htons(pcb->local_port); seg->tcphdr->dest = htons(pcb->remote_port); seg->tcphdr->seqno = htonl(seqno);