diff mercurial/thirdparty/xdiff/xprepare.c @ 36825:f1ef0e53e628

xdiff: use int64 for hash table size Follow-up of the previous "long" -> "int64" change. Now xdiff only uses int for return values and small integers (ex. booleans, shifting score, bits in hash table size, etc) so it should be able to handle large input. Differential Revision: https://phab.mercurial-scm.org/D2765
author Jun Wu <quark@fb.com>
date Fri, 09 Mar 2018 14:47:29 -0800
parents f0d9811dda8e
children 651c80720eed
line wrap: on
line diff
--- a/mercurial/thirdparty/xdiff/xprepare.c	Fri Mar 09 14:39:35 2018 -0800
+++ b/mercurial/thirdparty/xdiff/xprepare.c	Fri Mar 09 14:47:29 2018 -0800
@@ -70,7 +70,7 @@
 static int xdl_init_classifier(xdlclassifier_t *cf, int64_t size, int64_t flags) {
 	cf->flags = flags;
 
-	cf->hbits = xdl_hashbits((unsigned int) size);
+	cf->hbits = xdl_hashbits(size);
 	cf->hsize = 1 << cf->hbits;
 
 	if (xdl_cha_init(&cf->ncha, sizeof(xdlclass_t), size / 4 + 1) < 0) {
@@ -262,7 +262,7 @@
 		goto abort;
 
 	{
-		hbits = xdl_hashbits((unsigned int) narec);
+		hbits = xdl_hashbits(narec);
 		hsize = 1 << hbits;
 		if (!(rhash = (xrecord_t **) xdl_malloc(hsize * sizeof(xrecord_t *))))
 			goto abort;