From bd86f95512ceb91e0d7bf607331593f41f9f7ad7 Mon Sep 17 00:00:00 2001 From: christiaans Date: Wed, 25 Oct 2006 07:51:17 +0000 Subject: [PATCH] Cold case #9191 fixes for NC30 compiler for the M16 mcu, reported by Bjorn Sundman. --- src/include/ipv4/lwip/ip.h | 2 +- src/netif/ppp/ppp.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/include/ipv4/lwip/ip.h b/src/include/ipv4/lwip/ip.h index 1c991caa..796b1880 100644 --- a/src/include/ipv4/lwip/ip.h +++ b/src/include/ipv4/lwip/ip.h @@ -139,7 +139,7 @@ PACK_STRUCT_END #define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) #define IPH_ID_SET(hdr, id) (hdr)->_id = (id) #define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) -#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = (htons(IPH_PROTO(hdr) | ((ttl) << 8))) +#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = (htons(IPH_PROTO(hdr) | ((u16_t)(ttl) << 8))) #define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = (htons((proto) | (IPH_TTL(hdr) << 8))) #define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index dbe12171..25cea83f 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -180,8 +180,8 @@ enum NPmode { #define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ + (s) = *(cp); (cp)++; (s) << 8; \ + (s) |= *(cp); (cp)++; \ } #define PUTSHORT(s, cp) { \ *(cp)++ = (u_char) ((s) >> 8); \ @@ -189,10 +189,10 @@ enum NPmode { } #define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ + (l) = *(cp); (cp)++; (l) << 8; \ + (l) |= *(cp); (cp)++; (l) <<= 8; \ + (l) |= *(cp); (cp)++; (l) <<= 8; \ + (l) |= *(cp); (cp)++; \ } #define PUTLONG(l, cp) { \ *(cp)++ = (u_char) ((l) >> 24); \