changeset 22402:fa53d66b45a8

parsers: use correct type for file offset Now using Py_ssize_t instead of long to denote offset in file whose length is already measured using Py_ssize_t. Length and offset are now consistent. Based on warning from Microsoft Visual C++ 2008.
author Henrik Stuart <hg@hstuart.dk>
date Mon, 08 Sep 2014 20:22:10 +0200
parents 9ba8a93e55f5
children 41e9d58ec56f
files mercurial/parsers.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/parsers.c	Mon Sep 08 20:20:17 2014 +0200
+++ b/mercurial/parsers.c	Mon Sep 08 20:22:10 2014 +0200
@@ -681,10 +681,9 @@
 {
 	PyObject *obj;
 	char *node;
-	long offset;
-	Py_ssize_t len, nodelen;
+	Py_ssize_t offset, len, nodelen;
 
-	if (!PyArg_ParseTuple(args, "lO", &offset, &obj))
+	if (!PyArg_ParseTuple(args, "nO", &offset, &obj))
 		return NULL;
 
 	if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 8) {