parsers: fix typing issue when constructing Python integer object
authorHenrik Stuart <hg@hstuart.dk>
Thu, 11 Sep 2014 12:05:23 -0500
changeset 22400 888bc106de83
parent 22399 9f490afcb067
child 22401 9ba8a93e55f5
parsers: fix typing issue when constructing Python integer object The passed variable is a Py_ssize_t, not a long, and consequently should use PyInt_FromSsize_t rather than PyInt-FromLong. Fixed based on warning from Microsoft Visual C++ 2008.
mercurial/parsers.c
--- a/mercurial/parsers.c	Mon Sep 08 20:06:52 2014 +0200
+++ b/mercurial/parsers.c	Thu Sep 11 12:05:23 2014 -0500
@@ -881,7 +881,7 @@
 
 		if (nothead[i])
 			continue;
-		head = PyInt_FromLong(i);
+		head = PyInt_FromSsize_t(i);
 		if (head == NULL || PyList_Append(heads, head) == -1) {
 			Py_XDECREF(head);
 			goto bail;