Added/corrected casts

This commit is contained in:
goldsimon 2010-03-08 12:17:29 +00:00
parent 1c23bfdc7f
commit 5d20e690fd
3 changed files with 7 additions and 7 deletions

View File

@ -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) */
}
}

View File

@ -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));

View File

@ -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);