From c858aa5686ccd72879cb9bfc498d7537c5891d84 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 14 Feb 2010 11:40:13 +0000 Subject: [PATCH] Fixed compiler warnings for checksum algorithms 2 and 3 --- src/core/ipv4/inet_chksum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/ipv4/inet_chksum.c b/src/core/ipv4/inet_chksum.c index 5fbd3004..4883bfda 100644 --- a/src/core/ipv4/inet_chksum.c +++ b/src/core/ipv4/inet_chksum.c @@ -148,7 +148,7 @@ lwip_standard_chksum(void *dataptr, int len) u8_t *pb = dataptr; u16_t *ps, t = 0; u32_t sum = 0; - int odd = ((u32_t)pb & 1); + int odd = ((mem_ptr_t)pb & 1); /* Get aligned to u16_t */ if (odd && len > 0) { @@ -165,7 +165,7 @@ lwip_standard_chksum(void *dataptr, int len) /* Consume left-over byte, if any */ if (len > 0) { - ((u8_t *)&t)[0] = *(u8_t *)ps;; + ((u8_t *)&t)[0] = *(u8_t *)ps; } /* Add end bytes */ @@ -206,7 +206,7 @@ lwip_standard_chksum(void *dataptr, int len) u32_t *pl; u32_t sum = 0, tmp; /* starts at odd byte address? */ - int odd = ((u32_t)pb & 1); + int odd = ((mem_ptr_t)pb & 1); if (odd && len > 0) { ((u8_t *)&t)[1] = *pb++; @@ -215,7 +215,7 @@ lwip_standard_chksum(void *dataptr, int len) ps = (u16_t *)pb; - if (((u32_t)ps & 3) && len > 1) { + if (((mem_ptr_t)ps & 3) && len > 1) { sum += *ps++; len -= 2; }