changeset 36921:651c80720eed

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 09 Mar 2018 21:42:33 -0500
parents d255744de97a
children 1b9f6440506b
files mercurial/thirdparty/xdiff/xprepare.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 *));