xdiff: silence a 32-bit shift warning on Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 09 Mar 2018 21:42:33 -0500
changeset 36915 651c80720eed
parent 36914 d255744de97a
child 36916 1b9f6440506b
xdiff: silence a 32-bit shift warning on Windows It's probably harmless, but: warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) Adding a 'ULL' suffix to 1 also works, but I doubt that's portable.
mercurial/thirdparty/xdiff/xprepare.c
--- a/mercurial/thirdparty/xdiff/xprepare.c	Fri Mar 09 21:31:57 2018 -0500
+++ b/mercurial/thirdparty/xdiff/xprepare.c	Fri Mar 09 21:42:33 2018 -0500
@@ -71,7 +71,7 @@
 	cf->flags = flags;
 
 	cf->hbits = xdl_hashbits(size);
-	cf->hsize = 1 << cf->hbits;
+	cf->hsize = ((uint64_t)1) << cf->hbits;
 
 	if (xdl_cha_init(&cf->ncha, sizeof(xdlclass_t), size / 4 + 1) < 0) {
 
@@ -263,7 +263,7 @@
 
 	{
 		hbits = xdl_hashbits(narec);
-		hsize = 1 << hbits;
+		hsize = ((uint64_t)1) << hbits;
 		if (!(rhash = (xrecord_t **) xdl_malloc(hsize * sizeof(xrecord_t *))))
 			goto abort;
 		memset(rhash, 0, hsize * sizeof(xrecord_t *));