mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 09:33:44 +08:00
bug #26523: Compiler Warnings
This commit is contained in:
@@ -282,7 +282,9 @@ dhcp_select(struct netif *netif)
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
p = (const char*)netif->hostname;
|
||||
if (p != NULL) {
|
||||
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, strlen(p));
|
||||
u8_t namelen = (u8_t)strlen(p);
|
||||
LWIP_ASSERT("DHCP: hostname is too long!", namelen < 255);
|
||||
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, namelen);
|
||||
while (*p) {
|
||||
dhcp_option_byte(dhcp, *p++);
|
||||
}
|
||||
@@ -990,7 +992,9 @@ dhcp_renew(struct netif *netif)
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
p = (const char*)netif->hostname;
|
||||
if (p != NULL) {
|
||||
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, strlen(p));
|
||||
u8_t namelen = (u8_t)strlen(p);
|
||||
LWIP_ASSERT("DHCP: hostname is too long!", namelen < 255);
|
||||
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, namelen);
|
||||
while (*p) {
|
||||
dhcp_option_byte(dhcp, *p++);
|
||||
}
|
||||
@@ -1056,7 +1060,9 @@ dhcp_rebind(struct netif *netif)
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
p = (const char*)netif->hostname;
|
||||
if (p != NULL) {
|
||||
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, strlen(p));
|
||||
u8_t namelen = (u8_t)strlen(p);
|
||||
LWIP_ASSERT("DHCP: hostname is too long!", namelen < 255);
|
||||
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, namelen);
|
||||
while (*p) {
|
||||
dhcp_option_byte(dhcp, *p++);
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ dns_send(u8_t numdns, const char* name, u8_t id)
|
||||
MEMCPY( query, &qry, SIZEOF_DNS_QUERY);
|
||||
|
||||
/* resize pbuf to the exact dns query */
|
||||
pbuf_realloc(p, (query + SIZEOF_DNS_QUERY) - ((char*)(p->payload)));
|
||||
pbuf_realloc(p, (u16_t)((query + SIZEOF_DNS_QUERY) - ((char*)(p->payload))));
|
||||
|
||||
/* connect to the server for faster receiving */
|
||||
udp_connect(dns_pcb, &dns_servers[numdns], DNS_SERVER_PORT);
|
||||
@@ -741,12 +741,12 @@ dns_check_entries(void)
|
||||
static void
|
||||
dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
|
||||
{
|
||||
u8_t i;
|
||||
u16_t i;
|
||||
char *pHostname;
|
||||
struct dns_hdr *hdr;
|
||||
struct dns_answer ans;
|
||||
struct dns_table_entry *pEntry;
|
||||
u8_t nquestions, nanswers;
|
||||
u16_t nquestions, nanswers;
|
||||
#if (DNS_USES_STATIC_BUF == 0)
|
||||
u8_t dns_payload[DNS_MSG_SIZE];
|
||||
#endif /* (DNS_USES_STATIC_BUF == 0) */
|
||||
|
||||
@@ -181,7 +181,7 @@ lwip_standard_chksum(void *dataptr, int len)
|
||||
sum = SWAP_BYTES_IN_WORD(sum);
|
||||
}
|
||||
|
||||
return sum;
|
||||
return (u16_t)sum;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -263,7 +263,7 @@ lwip_standard_chksum(void *dataptr, int len)
|
||||
sum = SWAP_BYTES_IN_WORD(sum);
|
||||
}
|
||||
|
||||
return sum;
|
||||
return (u16_t)sum;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -155,7 +155,8 @@ ip_reass_tmr(void)
|
||||
static int
|
||||
ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
|
||||
{
|
||||
int pbufs_freed = 0;
|
||||
u16_t pbufs_freed = 0;
|
||||
u8_t clen;
|
||||
struct pbuf *p;
|
||||
struct ip_reass_helper *iprh;
|
||||
|
||||
@@ -175,7 +176,9 @@ ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *p
|
||||
/* Then, copy the original header into it. */
|
||||
SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
|
||||
icmp_time_exceeded(p, ICMP_TE_FRAG);
|
||||
pbufs_freed += pbuf_clen(p);
|
||||
clen = pbuf_clen(p);
|
||||
LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff);
|
||||
pbufs_freed += clen;
|
||||
pbuf_free(p);
|
||||
}
|
||||
#endif /* LWIP_ICMP */
|
||||
@@ -189,8 +192,10 @@ ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *p
|
||||
pcur = p;
|
||||
/* get the next pointer before freeing */
|
||||
p = iprh->next_pbuf;
|
||||
pbufs_freed += pbuf_clen(pcur);
|
||||
pbuf_free(pcur);
|
||||
clen = pbuf_clen(pcur);
|
||||
LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff);
|
||||
pbufs_freed += clen;
|
||||
pbuf_free(pcur);
|
||||
}
|
||||
/* Then, unchain the struct ip_reassdata from the list and free it. */
|
||||
ip_reass_dequeue_datagram(ipr, prev);
|
||||
|
||||
@@ -234,10 +234,10 @@ snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap)
|
||||
/* lookup current source address for this dst */
|
||||
dst_if = ip_route(&td->dip);
|
||||
dst_ip.addr = ntohl(dst_if->ip_addr.addr);
|
||||
trap_msg.sip_raw[0] = dst_ip.addr >> 24;
|
||||
trap_msg.sip_raw[1] = dst_ip.addr >> 16;
|
||||
trap_msg.sip_raw[2] = dst_ip.addr >> 8;
|
||||
trap_msg.sip_raw[3] = dst_ip.addr;
|
||||
trap_msg.sip_raw[0] = (u8_t)(dst_ip.addr >> 24);
|
||||
trap_msg.sip_raw[1] = (u8_t)(dst_ip.addr >> 16);
|
||||
trap_msg.sip_raw[2] = (u8_t)(dst_ip.addr >> 8);
|
||||
trap_msg.sip_raw[3] = (u8_t)dst_ip.addr;
|
||||
trap_msg.gen_trap = generic_trap;
|
||||
trap_msg.spc_trap = specific_trap;
|
||||
if (generic_trap == SNMP_GENTRAP_ENTERPRISESPC)
|
||||
|
||||
@@ -422,7 +422,9 @@ u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
|
||||
pcb->rcv_ann_wnd = 0;
|
||||
} else {
|
||||
/* keep the right edge of window constant */
|
||||
pcb->rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt;
|
||||
u32_t new_rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt;
|
||||
LWIP_ASSERT("new_rcv_ann_wnd <= 0xffff", new_rcv_ann_wnd <= 0xffff);
|
||||
pcb->rcv_ann_wnd = (u16_t)new_rcv_ann_wnd;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);
|
||||
|
||||
static struct tcp_hdr *
|
||||
tcp_output_set_header(struct tcp_pcb *pcb, struct pbuf *p, int optlen,
|
||||
tcp_output_set_header(struct tcp_pcb *pcb, struct pbuf *p, u16_t optlen,
|
||||
u32_t seqno_be /* already in network byte order */)
|
||||
{
|
||||
struct tcp_hdr *tcphdr = p->payload;
|
||||
|
||||
Reference in New Issue
Block a user