From f468c492b963be549e5d78a8003c759e7544fa70 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 22 Apr 2015 13:38:10 +0200 Subject: [PATCH] fixed missing casts found with msvc /Wall --- src/core/ipv4/ip4.c | 2 +- src/core/snmp/msg_out.c | 2 +- src/core/tcp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index 4e33d054..d60afdd9 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -866,7 +866,7 @@ err_t ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_add chk_sum = (chk_sum >> 16) + (chk_sum & 0xFFFF); chk_sum = (chk_sum >> 16) + chk_sum; chk_sum = ~chk_sum; - iphdr->_chksum = chk_sum; /* network order */ + iphdr->_chksum = (u16_t)chk_sum; /* network order */ #else /* CHECKSUM_GEN_IP_INLINE */ IPH_CHKSUM_SET(iphdr, 0); #if CHECKSUM_GEN_IP diff --git a/src/core/snmp/msg_out.c b/src/core/snmp/msg_out.c index b3c2eff2..1a915931 100644 --- a/src/core/snmp/msg_out.c +++ b/src/core/snmp/msg_out.c @@ -404,7 +404,7 @@ snmp_trap_header_sum(struct snmp_msg_trap *m_trap, u16_t vb_len) snmp_asn1_enc_length_cnt(thl->pdulen, &thl->pdulenlen); tot_len += 1 + thl->pdulenlen; - thl->comlen = strlen(snmp_community_trap); + thl->comlen = (u16_t)strlen(snmp_community_trap); snmp_asn1_enc_length_cnt(thl->comlen, &thl->comlenlen); tot_len += 1 + thl->comlenlen + thl->comlen; diff --git a/src/core/tcp.c b/src/core/tcp.c index a730cbdc..6638a4fd 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -340,7 +340,7 @@ tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx) case SYN_RCVD: case ESTABLISHED: case CLOSE_WAIT: - return tcp_close_shutdown(pcb, shut_rx); + return tcp_close_shutdown(pcb, (u8_t)shut_rx); default: /* Not (yet?) connected, cannot shutdown the TX side as that would bring us into CLOSED state, where the PCB is deallocated. */