fixed missing casts found with msvc /Wall

This commit is contained in:
goldsimon 2015-04-22 13:38:10 +02:00
parent 5410838793
commit f468c492b9
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

@ -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. */