]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use uintptr_t to look at the bits of a pointer.
authorGuy Harris <[email protected]>
Tue, 15 Dec 2015 19:22:19 +0000 (11:22 -0800)
committerGuy Harris <[email protected]>
Tue, 15 Dec 2015 19:22:19 +0000 (11:22 -0800)
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.

in_cksum.c

index 8ceaf104446eda7fb49b41c52518c96a8f982f93..e9bed2287ae626f9e263e09c51170a6738f7fea7 100644 (file)
@@ -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;