# HG changeset patch # User Henrik Stuart # Date 2014-09-08 18:22:10 # Node ID fa53d66b45a8254246d15c9c10f860c4feaf1fdc # Parent 9ba8a93e55f54e0a1d8d0d6436fa0f3fe4d3292b 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. diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -681,10 +681,9 @@ static PyObject *index_insert(indexObjec { 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) {