changeset 24032:c53bc2e52514

parsers: use k instead of n for PyArg_ParseTuple because python 2.4 is awful
author Augie Fackler <augie@google.com>
date Wed, 04 Feb 2015 11:38:30 -0500
parents fe1abb5d92f6
children ed5e8a9598ce
files mercurial/parsers.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/parsers.c	Wed Feb 04 21:37:06 2015 +0900
+++ b/mercurial/parsers.c	Wed Feb 04 11:38:30 2015 -0500
@@ -2262,10 +2262,13 @@
 
 static PyObject *fm1readmarkers(PyObject *self, PyObject *args) {
 	const char *data;
-	Py_ssize_t datalen, offset, stop;
+	Py_ssize_t datalen;
+	/* only unsigned long because python 2.4, should be Py_ssize_t */
+	unsigned long offset, stop;
 	PyObject *markers = NULL;
 
-	if (!PyArg_ParseTuple(args, "s#nn", &data, &datalen, &offset, &stop)) {
+	/* replace kk with nn when we drop Python 2.4 */
+	if (!PyArg_ParseTuple(args, "s#kk", &data, &datalen, &offset, &stop)) {
 		return NULL;
 	}
 	data += offset;