##// END OF EJS Templates
parsers: fix two cases of unsigned long instead of Py_ssize_t...
Augie Fackler -
r26107:50582df9 default
parent child Browse files
Show More
@@ -1046,13 +1046,12 b' static PyObject *list_copy(PyObject *lis'
1046 return newlist;
1046 return newlist;
1047 }
1047 }
1048
1048
1049 /* arg should be Py_ssize_t but Python 2.4 do not support the n format */
1049 static int check_filter(PyObject *filter, Py_ssize_t arg) {
1050 static int check_filter(PyObject *filter, unsigned long arg) {
1051 if (filter) {
1050 if (filter) {
1052 PyObject *arglist, *result;
1051 PyObject *arglist, *result;
1053 int isfiltered;
1052 int isfiltered;
1054
1053
1055 arglist = Py_BuildValue("(k)", arg);
1054 arglist = Py_BuildValue("(n)", arg);
1056 if (!arglist) {
1055 if (!arglist) {
1057 return -1;
1056 return -1;
1058 }
1057 }
@@ -2665,12 +2664,10 b' bail:'
2665 static PyObject *fm1readmarkers(PyObject *self, PyObject *args) {
2664 static PyObject *fm1readmarkers(PyObject *self, PyObject *args) {
2666 const char *data;
2665 const char *data;
2667 Py_ssize_t datalen;
2666 Py_ssize_t datalen;
2668 /* only unsigned long because python 2.4, should be Py_ssize_t */
2667 Py_ssize_t offset, stop;
2669 unsigned long offset, stop;
2670 PyObject *markers = NULL;
2668 PyObject *markers = NULL;
2671
2669
2672 /* replace kk with nn when we drop Python 2.4 */
2670 if (!PyArg_ParseTuple(args, "s#nn", &data, &datalen, &offset, &stop)) {
2673 if (!PyArg_ParseTuple(args, "s#kk", &data, &datalen, &offset, &stop)) {
2674 return NULL;
2671 return NULL;
2675 }
2672 }
2676 data += offset;
2673 data += offset;
General Comments 0
You need to be logged in to leave comments. Login now