@@ -149,15 +149,17 @@ extern "C"
149149 static PyObject* iternext_handler (PyObject*);
150150
151151 // Sequence methods
152- static int sequence_length_handler (PyObject*);
152+ static Py_ssize_t sequence_length_handler (PyObject*);
153153 static PyObject* sequence_concat_handler (PyObject*,PyObject*);
154- static PyObject* sequence_repeat_handler (PyObject*, int );
155- static PyObject* sequence_item_handler (PyObject*, int );
156- static PyObject* sequence_slice_handler (PyObject*, int , int );
157- static int sequence_ass_item_handler (PyObject*, int , PyObject*);
158- static int sequence_ass_slice_handler (PyObject*, int , int , PyObject*);
154+ static PyObject* sequence_repeat_handler (PyObject*, Py_ssize_t);
155+ static PyObject* sequence_item_handler (PyObject*, Py_ssize_t);
156+ static PyObject* sequence_slice_handler (PyObject*, Py_ssize_t,
157+ Py_ssize_t);
158+ static int sequence_ass_item_handler (PyObject*, Py_ssize_t, PyObject*);
159+ static int sequence_ass_slice_handler (PyObject*, Py_ssize_t,
160+ Py_ssize_t, PyObject*);
159161 // Mapping
160- static int mapping_length_handler (PyObject*);
162+ static Py_ssize_t mapping_length_handler (PyObject*);
161163 static PyObject* mapping_subscript_handler (PyObject*, PyObject*);
162164 static int mapping_ass_subscript_handler (PyObject*, PyObject*, PyObject*);
163165
@@ -186,9 +188,9 @@ extern "C"
186188 static PyObject* number_power_handler (PyObject*, PyObject*, PyObject*);
187189
188190 // Buffer
189- static int buffer_getreadbuffer_handler (PyObject*, int , void **);
190- static int buffer_getwritebuffer_handler (PyObject*, int , void **);
191- static int buffer_getsegcount_handler (PyObject*, int *);
191+ static Py_ssize_t buffer_getreadbuffer_handler (PyObject*, Py_ssize_t , void **);
192+ static Py_ssize_t buffer_getwritebuffer_handler (PyObject*, Py_ssize_t , void **);
193+ static Py_ssize_t buffer_getsegcount_handler (PyObject*, Py_ssize_t *);
192194 };
193195
194196
@@ -599,7 +601,7 @@ extern "C" PyObject* iternext_handler( PyObject *self )
599601
600602
601603// Sequence methods
602- extern " C" int sequence_length_handler ( PyObject *self )
604+ extern " C" Py_ssize_t sequence_length_handler ( PyObject *self )
603605 {
604606 try
605607 {
@@ -625,7 +627,7 @@ extern "C" PyObject* sequence_concat_handler( PyObject *self, PyObject *other )
625627 }
626628 }
627629
628- extern " C" PyObject* sequence_repeat_handler ( PyObject *self, int count )
630+ extern " C" PyObject* sequence_repeat_handler ( PyObject *self, Py_ssize_t count )
629631 {
630632 try
631633 {
@@ -638,7 +640,7 @@ extern "C" PyObject* sequence_repeat_handler( PyObject *self, int count )
638640 }
639641 }
640642
641- extern " C" PyObject* sequence_item_handler ( PyObject *self, int index )
643+ extern " C" PyObject* sequence_item_handler ( PyObject *self, Py_ssize_t index )
642644 {
643645 try
644646 {
@@ -651,7 +653,8 @@ extern "C" PyObject* sequence_item_handler( PyObject *self, int index )
651653 }
652654 }
653655
654- extern " C" PyObject* sequence_slice_handler ( PyObject *self, int first, int last )
656+ extern " C" PyObject* sequence_slice_handler ( PyObject *self, Py_ssize_t first,
657+ Py_ssize_t last )
655658 {
656659 try
657660 {
@@ -664,7 +667,7 @@ extern "C" PyObject* sequence_slice_handler( PyObject *self, int first, int last
664667 }
665668 }
666669
667- extern " C" int sequence_ass_item_handler ( PyObject *self, int index, PyObject *value )
670+ extern " C" int sequence_ass_item_handler ( PyObject *self, Py_ssize_t index, PyObject *value )
668671 {
669672 try
670673 {
@@ -677,7 +680,7 @@ extern "C" int sequence_ass_item_handler( PyObject *self, int index, PyObject *v
677680 }
678681 }
679682
680- extern " C" int sequence_ass_slice_handler ( PyObject *self, int first, int last, PyObject *value )
683+ extern " C" int sequence_ass_slice_handler ( PyObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *value )
681684 {
682685 try
683686 {
@@ -691,7 +694,7 @@ extern "C" int sequence_ass_slice_handler( PyObject *self, int first, int last,
691694 }
692695
693696// Mapping
694- extern " C" int mapping_length_handler ( PyObject *self )
697+ extern " C" Py_ssize_t mapping_length_handler ( PyObject *self )
695698 {
696699 try
697700 {
@@ -1018,7 +1021,7 @@ extern "C" PyObject* number_power_handler( PyObject *self, PyObject *x1, PyObjec
10181021 }
10191022
10201023// Buffer
1021- extern " C" int buffer_getreadbuffer_handler ( PyObject *self, int index, void **pp )
1024+ extern " C" Py_ssize_t buffer_getreadbuffer_handler ( PyObject *self, Py_ssize_t index, void **pp )
10221025 {
10231026 try
10241027 {
@@ -1031,7 +1034,7 @@ extern "C" int buffer_getreadbuffer_handler( PyObject *self, int index, void **p
10311034 }
10321035 }
10331036
1034- extern " C" int buffer_getwritebuffer_handler ( PyObject *self, int index, void **pp )
1037+ extern " C" Py_ssize_t buffer_getwritebuffer_handler ( PyObject *self, Py_ssize_t index, void **pp )
10351038 {
10361039 try
10371040 {
@@ -1044,7 +1047,7 @@ extern "C" int buffer_getwritebuffer_handler( PyObject *self, int index, void **
10441047 }
10451048 }
10461049
1047- extern " C" int buffer_getsegcount_handler ( PyObject *self, int *count )
1050+ extern " C" Py_ssize_t buffer_getsegcount_handler ( PyObject *self, Py_ssize_t *count )
10481051 {
10491052 try
10501053 {
@@ -1212,13 +1215,13 @@ Py::Object PythonExtensionBase::number_power( const Py::Object &, const Py::Obje
12121215
12131216
12141217// Buffer
1215- int PythonExtensionBase::buffer_getreadbuffer ( int , void ** )
1218+ Py_ssize_t PythonExtensionBase::buffer_getreadbuffer ( Py_ssize_t , void ** )
12161219 { missing_method ( buffer_getreadbuffer ); return -1 ; }
12171220
1218- int PythonExtensionBase::buffer_getwritebuffer ( int , void ** )
1221+ Py_ssize_t PythonExtensionBase::buffer_getwritebuffer ( Py_ssize_t , void ** )
12191222 { missing_method ( buffer_getwritebuffer ); return -1 ; }
12201223
1221- int PythonExtensionBase::buffer_getsegcount ( int * )
1224+ Py_ssize_t PythonExtensionBase::buffer_getsegcount ( Py_ssize_t * )
12221225 { missing_method ( buffer_getsegcount ); return -1 ; }
12231226
12241227// --------------------------------------------------------------------------------
0 commit comments