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>
This commit is contained in:
Anders 2015-06-08 09:57:35 +02:00 committed by Anders Broman
parent 9223567993
commit 049fc494d0
1 changed files with 4 additions and 0 deletions

View File

@ -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;