##// END OF EJS Templates
parser: use PyInt_FromSsize_t in index_stats...
Adrian Buehlmann -
r16629:1435866c default
parent child Browse files
Show More
@@ -508,13 +508,13 b' static PyObject *index_stats(indexObject'
508 508 return NULL;
509 509
510 510 #define istat(__n, __d) \
511 if (PyDict_SetItemString(obj, __d, PyInt_FromLong(self->__n)) == -1) \
511 if (PyDict_SetItemString(obj, __d, PyInt_FromSsize_t(self->__n)) == -1) \
512 512 goto bail;
513 513
514 514 if (self->added) {
515 515 Py_ssize_t len = PyList_GET_SIZE(self->added);
516 516 if (PyDict_SetItemString(obj, "index entries added",
517 PyInt_FromLong(len)) == -1)
517 PyInt_FromSsize_t(len)) == -1)
518 518 goto bail;
519 519 }
520 520
@@ -109,6 +109,7 b''
109 109 typedef int Py_ssize_t;
110 110 typedef Py_ssize_t (*lenfunc)(PyObject *);
111 111 typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
112 #define PyInt_FromSsize_t PyInt_FromLong
112 113
113 114 #if !defined(PY_SSIZE_T_MIN)
114 115 #define PY_SSIZE_T_MAX INT_MAX
General Comments 0
You need to be logged in to leave comments. Login now