mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 23:25:58 +00:00
Minor fix (warnings on unused args, wrong type, cast u32_t to u16_t...)
This commit is contained in:
parent
083134bc12
commit
fdc4c25e67
@ -610,10 +610,12 @@ lwip_socket(int domain, int type, int protocol)
|
|||||||
struct netconn *conn;
|
struct netconn *conn;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
LWIP_UNUSED_ARG(domain);
|
||||||
|
|
||||||
/* create a netconn */
|
/* create a netconn */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SOCK_RAW:
|
case SOCK_RAW:
|
||||||
conn = netconn_new_with_proto_and_callback(NETCONN_RAW, protocol, event_callback);
|
conn = netconn_new_with_proto_and_callback(NETCONN_RAW, (u8_t)protocol, event_callback);
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_RAW, %d) = ",
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_RAW, %d) = ",
|
||||||
domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol));
|
domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol));
|
||||||
break;
|
break;
|
||||||
@ -852,6 +854,8 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
|
|||||||
struct lwip_socket *sock;
|
struct lwip_socket *sock;
|
||||||
struct lwip_select_cb *scb;
|
struct lwip_select_cb *scb;
|
||||||
|
|
||||||
|
LWIP_UNUSED_ARG(len);
|
||||||
|
|
||||||
/* Get socket */
|
/* Get socket */
|
||||||
if (conn) {
|
if (conn) {
|
||||||
s = conn->socket;
|
s = conn->socket;
|
||||||
@ -923,6 +927,7 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
|
|||||||
|
|
||||||
int lwip_shutdown(int s, int how)
|
int lwip_shutdown(int s, int how)
|
||||||
{
|
{
|
||||||
|
LWIP_UNUSED_ARG(how);
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_shutdown(%d, how=%d)\n", s, how));
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_shutdown(%d, how=%d)\n", s, how));
|
||||||
return lwip_close(s); /* XXX temporary hack until proper implementation */
|
return lwip_close(s); /* XXX temporary hack until proper implementation */
|
||||||
}
|
}
|
||||||
@ -993,7 +998,7 @@ int lwip_getsockname(int s, struct sockaddr *name, socklen_t *namelen)
|
|||||||
|
|
||||||
int lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
|
int lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
|
||||||
{
|
{
|
||||||
int err = ERR_OK;
|
err_t err = ERR_OK;
|
||||||
struct lwip_socket *sock = get_socket(s);
|
struct lwip_socket *sock = get_socket(s);
|
||||||
struct lwip_setgetsockopt_data data;
|
struct lwip_setgetsockopt_data data;
|
||||||
|
|
||||||
|
@ -1120,7 +1120,7 @@ tcp_receive(struct tcp_pcb *pcb)
|
|||||||
next = cseg->next;
|
next = cseg->next;
|
||||||
if (TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) {
|
if (TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) {
|
||||||
/* We need to trim the incoming segment. */
|
/* We need to trim the incoming segment. */
|
||||||
cseg->len = next->tcphdr->seqno - seqno;
|
cseg->len = (u16_t)(next->tcphdr->seqno - seqno);
|
||||||
pbuf_realloc(cseg->p, cseg->len);
|
pbuf_realloc(cseg->p, cseg->len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user