# HG changeset patch # User Henrik Stuart # Date 2014-09-08 18:20:17 # Node ID 9ba8a93e55f54e0a1d8d0d6436fa0f3fe4d3292b # Parent 888bc106de8361f2605d53704b46632a2ee30c3e parsers: ensure correct return type for inline_scan The returned data type for inline_scan should be Py_ssize_t rather than long. 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 @@ -524,7 +524,7 @@ static Py_ssize_t index_length(const ind static PyObject *nullentry; static const char nullid[20]; -static long inline_scan(indexObject *self, const char **offsets); +static Py_ssize_t inline_scan(indexObject *self, const char **offsets); #if LONG_MAX == 0x7fffffffL static char *tuple_format = "Kiiiiiis#"; @@ -1853,7 +1853,7 @@ static int index_assign_subscript(indexO * Find all RevlogNG entries in an index that has inline data. Update * the optional "offsets" table with those entries. */ -static long inline_scan(indexObject *self, const char **offsets) +static Py_ssize_t inline_scan(indexObject *self, const char **offsets) { const char *data = PyString_AS_STRING(self->data); Py_ssize_t pos = 0; @@ -1913,7 +1913,7 @@ static int index_init(indexObject *self, Py_INCREF(self->data); if (self->inlined) { - long len = inline_scan(self, NULL); + Py_ssize_t len = inline_scan(self, NULL); if (len == -1) goto bail; self->raw_length = len;