From: Guy Harris Date: Tue, 15 Dec 2015 19:22:19 +0000 (-0800) Subject: Use uintptr_t to look at the bits of a pointer. X-Git-Tag: tcpdump-4.8.0~61 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/fd2a4d9ad21d2899af182e383a2d2c70ba8832f6 Use uintptr_t to look at the bits of a pointer. We use AC_TYPE_UINTPTR_T in the configure script, so it'll be defined if we use autotools, and MSVC has supported it since at least Visual Studio .NET 2003, so we'll use it instead of "unsigned long"; "unsigned long" causes warnings on LLP64 platforms, as it's not wide enough for a pointer on those platforms. --- diff --git a/in_cksum.c b/in_cksum.c index 8ceaf104..e9bed228 100644 --- a/in_cksum.c +++ b/in_cksum.c @@ -92,7 +92,7 @@ in_cksum(const struct cksum_vec *vec, int veclen) /* * Force to even boundary. */ - if ((1 & (unsigned long) w) && (mlen > 0)) { + if ((1 & (uintptr_t) w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(const uint8_t *)w;