From: Stefan Weil Date: Sat, 10 Mar 2012 20:20:53 +0000 (+0100) Subject: slirp: Fix compiler warning for w64 X-Git-Tag: v1.1-rc0~234^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d26512b45b5236fa521c4492608fe9fb5bedf46;p=thirdparty%2Fqemu.git slirp: Fix compiler warning for w64 Casting a pointer to an integer value must use uintptr_t or intptr_t (not long) for portable code. MinGW-w64 requires this because sizeof(long) != sizeof(void *) for w64 hosts, so casting to long raises a compiler warning. I use uintptr_t instead of intptr_t because changing the sign does not matter here and casting pointers to unsigned values seems more reasonable (the unsigned value is a non negative offset. Cc: Jan Kiszka Signed-off-by: Stefan Weil Signed-off-by: Jan Kiszka --- diff --git a/slirp/cksum.c b/slirp/cksum.c index e43867da378..63286600e7c 100644 --- a/slirp/cksum.c +++ b/slirp/cksum.c @@ -75,7 +75,7 @@ int cksum(struct mbuf *m, int len) /* * Force to even boundary. */ - if ((1 & (long) w) && (mlen > 0)) { + if ((1 & (uintptr_t)w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(uint8_t *)w;