aboutsummaryrefslogtreecommitdiffstats
path: root/epan/in_cksum.c
diff options
context:
space:
mode:
authorAnders <anders.broman@ericsson.com>2015-06-08 09:57:35 +0200
committerAnders Broman <a.broman58@gmail.com>2015-06-08 11:13:23 +0000
commit049fc494d0eb0597715553bc74cc60b901484332 (patch)
treeb7f0d2316d8776b56385b7c91d6411985faa6d7c /epan/in_cksum.c
parent922356799340700e5642a6193e861fa0ebcf47f0 (diff)
Fix MSCV 2015RC Warning in_cksum.c(92): warning C4311: 'type cast':
pointer truncation from 'const guint16 *' to 'unsigned long'. Even if we only require GLIB 2.16 this will fix the Windows build as we do have a newer Glib on Windows. Change-Id: Ie0644536783e8b298de59094fec240e249c9b27f Reviewed-on: https://code.wireshark.org/review/8833 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/in_cksum.c')
-rw-r--r--epan/in_cksum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/in_cksum.c b/epan/in_cksum.c
index fa645a2985..62c24a4766 100644
--- a/epan/in_cksum.c
+++ b/epan/in_cksum.c
@@ -89,7 +89,11 @@ in_cksum(const vec_t *vec, int veclen)
/*
* Force to even boundary.
*/
+#if GLIB_CHECK_VERSION(2,18,0)
+ if ((1 & (gintptr)w) && (mlen > 0)) {
+#else
if ((1 & (unsigned long) w) && (mlen > 0)) {
+#endif /* GLIB_CHECK_VERSION(2,18,0) */
REDUCE;
sum <<= 8;
s_util.c[0] = *(const guint8 *)w;