Mercurial > public > mercurial-scm > hg
comparison mercurial/parsers.c @ 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 |
comparison
equal
deleted
inserted
replaced
22401:9ba8a93e55f5 | 22402:fa53d66b45a8 |
---|---|
679 | 679 |
680 static PyObject *index_insert(indexObject *self, PyObject *args) | 680 static PyObject *index_insert(indexObject *self, PyObject *args) |
681 { | 681 { |
682 PyObject *obj; | 682 PyObject *obj; |
683 char *node; | 683 char *node; |
684 long offset; | 684 Py_ssize_t offset, len, nodelen; |
685 Py_ssize_t len, nodelen; | 685 |
686 | 686 if (!PyArg_ParseTuple(args, "nO", &offset, &obj)) |
687 if (!PyArg_ParseTuple(args, "lO", &offset, &obj)) | |
688 return NULL; | 687 return NULL; |
689 | 688 |
690 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 8) { | 689 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 8) { |
691 PyErr_SetString(PyExc_TypeError, "8-tuple required"); | 690 PyErr_SetString(PyExc_TypeError, "8-tuple required"); |
692 return NULL; | 691 return NULL; |