Patchwork [2,of,5] cext: fix Windows warning about implicit conversion of 32-bit shift to 64 bit

login
register
mail settings
Submitter Matt Harbison
Date Aug. 10, 2018, 5:01 a.m.
Message ID <87d4715a29768208e034.1533877276@Envy>
Download mbox | patch
Permalink /patch/33628/
State Accepted
Headers show

Comments

Matt Harbison - Aug. 10, 2018, 5:01 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1533873165 14400
#      Thu Aug 09 23:52:45 2018 -0400
# Node ID 87d4715a29768208e0345cc6314ad267c8711df6
# Parent  36b8875f1f317742e3914b1dacde6af73a15a045
cext: fix Windows warning about implicit conversion of 32-bit shift to 64 bit

    mercurial/cext/revlog.c(1541) : warning C4334: '<<' : result of 32-bit shift
        implicitly converted to 64 bits (was 64-bit shift int ended?)

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1538,7 +1538,7 @@  static PyObject *find_deepest(indexObjec
 		goto bail;
 	}
 
-	interesting = calloc(sizeof(*interesting), 1 << revcount);
+	interesting = calloc(sizeof(*interesting), ((size_t)1) << revcount);
 	if (interesting == NULL) {
 		PyErr_NoMemory();
 		goto bail;