fixed some more missing casts...

This commit is contained in:
goldsimon 2015-04-22 14:18:54 +02:00
parent 634c438b50
commit f5077dc982
3 changed files with 8 additions and 8 deletions

View File

@ -694,8 +694,8 @@ dns_send(struct dns_table_entry* entry)
LWIP_ASSERT("dns server has no IP address set", !ip_addr_isany(&dns_servers[entry->server_idx]));
/* if here, we have either a new query or a retry on a previous query to process */
p = pbuf_alloc(PBUF_TRANSPORT, SIZEOF_DNS_HDR + strlen(entry->name) + 2 +
SIZEOF_DNS_QUERY, PBUF_RAM);
p = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(SIZEOF_DNS_HDR + strlen(entry->name) + 2 +
SIZEOF_DNS_QUERY), PBUF_RAM);
if (p != NULL) {
/* fill dns header */
memset(&hdr, 0, SIZEOF_DNS_HDR);
@ -714,7 +714,7 @@ dns_send(struct dns_table_entry* entry)
for(n = 0; *hostname != '.' && *hostname != 0; ++hostname) {
++n;
}
copy_len = hostname - hostname_part;
copy_len = (u16_t)(hostname - hostname_part);
pbuf_put_at(p, query_idx, n);
pbuf_take_at(p, hostname_part, copy_len, query_idx + 1);
query_idx += n + 1;
@ -759,7 +759,7 @@ dns_alloc_random_port(void)
return NULL;
}
do {
u16_t port = DNS_RAND_TXID();
u16_t port = (u16_t)DNS_RAND_TXID();
if (!DNS_PORT_ALLOWED(port)) {
/* this port is not allowed, try again */
err = ERR_USE;
@ -875,7 +875,7 @@ dns_create_txid(void)
u8_t i;
again:
txid = DNS_RAND_TXID();
txid = (u16_t)DNS_RAND_TXID();
/* check whether the ID is unique */
for (i = 0; i < DNS_TABLE_SIZE; i++) {

View File

@ -1596,7 +1596,7 @@ tcp_receive(struct tcp_pcb *pcb)
TCPH_FLAGS_SET(next->next->tcphdr, TCPH_FLAGS(next->next->tcphdr) &~ TCP_FIN);
}
/* Adjust length of segment to fit in the window. */
next->next->len = pcb->rcv_nxt + pcb->rcv_wnd - seqno;
next->next->len = (u16_t)(pcb->rcv_nxt + pcb->rcv_wnd - seqno);
pbuf_realloc(next->next->p, next->next->len);
tcplen = TCP_TCPLEN(next->next);
LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n",
@ -1657,7 +1657,7 @@ static u8_t tcp_getoptbyte(void)
u8_t* opts = (u8_t *)tcphdr + TCP_HLEN;
return opts[tcp_optidx++];
} else {
u8_t idx = tcp_optidx++ - tcphdr_opt1len;
u8_t idx = (u8_t)(tcp_optidx++ - tcphdr_opt1len);
return tcphdr_opt2[idx];
}
}

View File

@ -97,7 +97,7 @@ PACK_STRUCT_END
#define IPH_PROTO(hdr) ((hdr)->_proto)
#define IPH_CHKSUM(hdr) ((hdr)->_chksum)
#define IPH_VHL_SET(hdr, v, hl) (hdr)->_v_hl = (((v) << 4) | (hl))
#define IPH_VHL_SET(hdr, v, hl) (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl)))
#define IPH_TOS_SET(hdr, tos) (hdr)->_tos = (tos)
#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len)
#define IPH_ID_SET(hdr, id) (hdr)->_id = (id)