inet.c Modify (acc >> 16) test to ((acc >> 16) != 0) to help buggy

compiler (Paradigm C++)
This commit is contained in:
kieranm 2007-08-24 14:31:53 +00:00
parent 261af8dc07
commit 7c90cc6aac
2 changed files with 6 additions and 2 deletions

View File

@ -271,6 +271,10 @@ HISTORY
++ Bug fixes: ++ Bug fixes:
2007-08-24 Kieran Mansley
* inet.c Modify (acc >> 16) test to ((acc >> 16) != 0) to help buggy
compiler (Paradigm C++)
2007-08-09 Frédéric Bernon, Bill Florac 2007-08-09 Frédéric Bernon, Bill Florac
* stats.h, stats.c, igmp.h, igmp.c, opt.h: Fix for bug #20503 : IGMP Improvement. * stats.h, stats.c, igmp.h, igmp.c, opt.h: Fix for bug #20503 : IGMP Improvement.
Introduce IGMP_STATS to centralize statistics management. Introduce IGMP_STATS to centralize statistics management.

View File

@ -270,7 +270,7 @@ inet_chksum_pseudo(struct pbuf *p,
(void *)q, (void *)q->next)); (void *)q, (void *)q->next));
acc += LWIP_CHKSUM(q->payload, q->len); acc += LWIP_CHKSUM(q->payload, q->len);
/*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/ /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/
while (acc >> 16) { while ((acc >> 16) != 0) {
acc = (acc & 0xffffUL) + (acc >> 16); acc = (acc & 0xffffUL) + (acc >> 16);
} }
if (q->len % 2 != 0) { if (q->len % 2 != 0) {
@ -290,7 +290,7 @@ inet_chksum_pseudo(struct pbuf *p,
acc += (u32_t)htons((u16_t)proto); acc += (u32_t)htons((u16_t)proto);
acc += (u32_t)htons(proto_len); acc += (u32_t)htons(proto_len);
while (acc >> 16) { while ((acc >> 16) != 0) {
acc = (acc & 0xffffUL) + (acc >> 16); acc = (acc & 0xffffUL) + (acc >> 16);
} }
LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc)); LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc));