Update of /cvsroot/pure-data/externals/grill/py/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24537/source
Modified Files: pybase.cpp pybuffer.cpp pyprefix.h pysymbol.cpp Log Message: compilation fixes for Python 2.5, OSX cross-platform fixes more cross-platform and version fixes compilation fixes for Python 2.5
Index: pysymbol.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/pysymbol.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pysymbol.cpp 3 Jan 2008 16:21:04 -0000 1.9 --- pysymbol.cpp 4 Jan 2008 11:59:00 -0000 1.10 *************** *** 7,11 ****
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-03 17:20:03 +0100 (Thu, 03 Jan 2008) $ $LastChangedBy: thomas $ */ --- 7,11 ----
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-03 18:15:53 +0100 (Thu, 03 Jan 2008) $ $LastChangedBy: thomas $ */ *************** *** 92,102 ****
! static int symbol_length(pySymbol *self) { return strlen(flext::GetString(self->sym)); }
! static PyObject *symbol_item(pySymbol *self, int i) { const char *str = flext::GetString(self->sym); int len = strlen(str); --- 92,104 ----
! static Py_ssize_t symbol_length(PyObject *s) { + pySymbol *self = reinterpret_cast<pySymbol *>(s); return strlen(flext::GetString(self->sym)); }
! static PyObject *symbol_item(PyObject *s,Py_ssize_t i) { + pySymbol *self = reinterpret_cast<pySymbol *>(s); const char *str = flext::GetString(self->sym); int len = strlen(str); *************** *** 111,116 **** }
! static PyObject *symbol_slice(pySymbol *self,int ilow = 0,int ihigh = 1<<(sizeof(int)*8-2)) { const char *str = flext::GetString(self->sym); int len = strlen(str); --- 113,119 ---- }
! static PyObject *symbol_slice(PyObject *s,Py_ssize_t ilow = 0,Py_ssize_t ihigh = 1<<(sizeof(int)*8-2)) { + pySymbol *self = reinterpret_cast<pySymbol *>(s); const char *str = flext::GetString(self->sym); int len = strlen(str); *************** *** 125,131 **** }
! static PyObject *symbol_concat(pySymbol *self,PyObject *op) { ! PyObject *nobj = symbol_slice(self); // take all if(nobj) { PyObject *ret = PySequence_Concat(nobj,op); --- 128,135 ---- }
! static PyObject *symbol_concat(PyObject *s,PyObject *op) { ! pySymbol *self = reinterpret_cast<pySymbol *>(s); ! PyObject *nobj = symbol_slice(s); // take all if(nobj) { PyObject *ret = PySequence_Concat(nobj,op); *************** *** 137,143 **** }
! static PyObject *symbol_repeat(pySymbol *self,int rep) { ! PyObject *nobj = symbol_slice(self); // take all if(nobj) { PyObject *ret = PySequence_Repeat(nobj,rep); --- 141,148 ---- }
! static PyObject *symbol_repeat(PyObject *s,Py_ssize_t rep) { ! pySymbol *self = reinterpret_cast<pySymbol *>(s); ! PyObject *nobj = symbol_slice(s); // take all if(nobj) { PyObject *ret = PySequence_Repeat(nobj,rep); *************** *** 150,166 ****
static PySequenceMethods symbol_as_seq = { ! (inquiry)symbol_length, /* inquiry sq_length; __len__ */ ! (binaryfunc)symbol_concat, /* __add__ */ ! (intargfunc)symbol_repeat, /* __mul__ */ ! (intargfunc)symbol_item, /* intargfunc sq_item; __getitem__ */ ! (intintargfunc)symbol_slice, /* intintargfunc sq_slice; __getslice__ */ NULL, /* intobjargproc sq_ass_item; __setitem__ */ NULL, /* intintobjargproc sq_ass_slice; __setslice__ */ };
! static PyObject *symbol_iter(PyObject *obj) { ! pySymbol *self = (pySymbol *)obj; ! PyObject *nobj = symbol_slice(self); if(nobj) { PyObject *it = PyObject_GetIter(nobj); --- 155,171 ----
static PySequenceMethods symbol_as_seq = { ! symbol_length, /* inquiry sq_length; __len__ */ ! symbol_concat, /* __add__ */ ! symbol_repeat, /* __mul__ */ ! symbol_item, /* intargfunc sq_item; __getitem__ */ ! symbol_slice, /* intintargfunc sq_slice; __getslice__ */ NULL, /* intobjargproc sq_ass_item; __setitem__ */ NULL, /* intintobjargproc sq_ass_slice; __setslice__ */ };
! static PyObject *symbol_iter(PyObject *s) { ! pySymbol *self = reinterpret_cast<pySymbol *>(s); ! PyObject *nobj = symbol_slice(s); if(nobj) { PyObject *it = PyObject_GetIter(nobj);
Index: pyprefix.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/pyprefix.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pyprefix.h 3 Jan 2008 16:21:04 -0000 1.8 --- pyprefix.h 4 Jan 2008 11:59:00 -0000 1.9 *************** *** 7,11 ****
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-03 17:20:03 +0100 (Thu, 03 Jan 2008) $ $LastChangedBy: thomas $ */ --- 7,11 ----
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-04 12:58:11 +0100 (Fri, 04 Jan 2008) $ $LastChangedBy: thomas $ */ *************** *** 42,46 **** #include <string>
! #ifdef PY_USE_INOFFICIAL extern "C" { #include <s_stuff.h> --- 42,46 ---- #include <string>
! #if FLEXT_SYS == FLEXT_SYS_PD && defined(PY_USE_INOFFICIAL) extern "C" { #include <s_stuff.h> *************** *** 48,50 **** --- 48,54 ---- #endif
+ #if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #endif + #endif
Index: pybuffer.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/pybuffer.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pybuffer.cpp 3 Jan 2008 16:21:04 -0000 1.14 --- pybuffer.cpp 4 Jan 2008 11:59:00 -0000 1.15 *************** *** 7,11 ****
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-03 17:20:03 +0100 (Thu, 03 Jan 2008) $ $LastChangedBy: thomas $ */ --- 7,11 ----
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-04 12:24:43 +0100 (Fri, 04 Jan 2008) $ $LastChangedBy: thomas $ */ *************** *** 190,198 **** // support the buffer protocol
- #if PY_VERSION_HEX >= 0x02050000 static Py_ssize_t buffer_readbuffer(PyObject *obj, Py_ssize_t segment, void **ptrptr) - #else - static int buffer_readbuffer(PyObject *obj, int segment, void **ptrptr) - #endif { flext::buffer *b = ((pySamplebuffer *)obj)->buf; --- 190,194 ---- *************** *** 201,209 **** }
- #if PY_VERSION_HEX >= 0x02050000 static Py_ssize_t buffer_writebuffer(PyObject *obj, Py_ssize_t segment, void **ptrptr) - #else - static int buffer_writebuffer(PyObject *obj, int segment, void **ptrptr) - #endif { flext::buffer *b = ((pySamplebuffer *)obj)->buf; --- 197,201 ---- *************** *** 212,220 **** }
- #if PY_VERSION_HEX >= 0x02050000 static Py_ssize_t buffer_segcount(PyObject *obj, Py_ssize_t *lenp) - #else - static int buffer_segcount(PyObject *obj, int *lenp) - #endif { flext::buffer *b = ((pySamplebuffer *)obj)->buf; --- 204,208 ---- *************** *** 223,231 **** }
! #if PY_VERSION_HEX >= 0x02050000 ! static Py_ssize_t buffer_charbuffer(PyObject *obj, Py_ssize_t segment, char **ptrptr) ! #else ! static int buffer_charbuffer(PyObject *obj, int segment, const char **ptrptr) #endif { flext::buffer *b = ((pySamplebuffer *)obj)->buf; --- 211,219 ---- }
! static Py_ssize_t buffer_charbuffer(PyObject *obj, Py_ssize_t segment, ! #if PY_VERSION_HEX < 0x02050000 ! const #endif + char **ptrptr) { flext::buffer *b = ((pySamplebuffer *)obj)->buf; *************** *** 241,251 **** };
! static int buffer_length(pySamplebuffer *self) { return self->buf?self->buf->Frames():0; }
! static PyObject *buffer_item(pySamplebuffer *self, int i) { PyObject *ret; if(self->buf) { --- 229,241 ---- };
! static Py_ssize_t buffer_length(PyObject *s) { + pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); return self->buf?self->buf->Frames():0; }
! static PyObject *buffer_item(PyObject *s,Py_ssize_t i) { + pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); PyObject *ret; if(self->buf) { *************** *** 282,286 **** #else void *data; ! int len; int err = PyObject_AsWriteBuffer(buf,&data,&len); if(!err) { --- 272,276 ---- #else void *data; ! Py_ssize_t len; int err = PyObject_AsWriteBuffer(buf,&data,&len); if(!err) { *************** *** 302,307 **** }
! static PyObject *buffer_slice(pySamplebuffer *self,int ilow = 0,int ihigh = 1<<(sizeof(int)*8-2)) { PyObject *ret; #ifdef PY_ARRAYS --- 292,298 ---- }
! static PyObject *buffer_slice(PyObject *s,Py_ssize_t ilow = 0,Py_ssize_t ihigh = 1<<(sizeof(int)*8-2)) { + pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); PyObject *ret; #ifdef PY_ARRAYS *************** *** 337,342 **** }
! static int buffer_ass_item(pySamplebuffer *self,int i,PyObject *v) { int ret; if(self->buf) { --- 328,334 ---- }
! static int buffer_ass_item(PyObject *s,Py_ssize_t i,PyObject *v) { + pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); int ret; if(self->buf) { *************** *** 369,374 **** }
! static int buffer_ass_slice(pySamplebuffer *self,int ilow,int ihigh,PyObject *value) { int ret; #ifdef PY_ARRAYS --- 361,367 ---- }
! static int buffer_ass_slice(PyObject *s,Py_ssize_t ilow,Py_ssize_t ihigh,PyObject *value) { + pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); int ret; #ifdef PY_ARRAYS *************** *** 427,433 **** }
! static PyObject *buffer_concat(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PySequence_Concat(nobj,op); --- 420,427 ---- }
! static PyObject *buffer_concat(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PySequence_Concat(nobj,op); *************** *** 440,446 **** }
! static PyObject *buffer_repeat(pySamplebuffer *self,int rep) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PySequence_Repeat(nobj,rep); --- 434,441 ---- }
! static PyObject *buffer_repeat(PyObject *s,Py_ssize_t rep) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PySequence_Repeat(nobj,rep); *************** *** 455,471 ****
static PySequenceMethods buffer_as_seq = { ! (inquiry)buffer_length, /* inquiry sq_length; __len__ */ ! (binaryfunc)buffer_concat, /* __add__ */ ! (intargfunc)buffer_repeat, /* __mul__ */ ! (intargfunc)buffer_item, /* intargfunc sq_item; __getitem__ */ ! (intintargfunc)buffer_slice, /* intintargfunc sq_slice; __getslice__ */ ! (intobjargproc)buffer_ass_item, /* intobjargproc sq_ass_item; __setitem__ */ ! (intintobjargproc)buffer_ass_slice, /* intintobjargproc sq_ass_slice; __setslice__ */ };
! static PyObject *buffer_iter(PyObject *obj) { ! pySamplebuffer *self = (pySamplebuffer *)obj; ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *it = PyObject_GetIter(nobj); --- 450,466 ----
static PySequenceMethods buffer_as_seq = { ! buffer_length, /* inquiry sq_length; __len__ */ ! buffer_concat, /* __add__ */ ! buffer_repeat, /* __mul__ */ ! buffer_item, /* intargfunc sq_item; __getitem__ */ ! buffer_slice, /* intintargfunc sq_slice; __getslice__ */ ! buffer_ass_item, /* intobjargproc sq_ass_item; __setitem__ */ ! buffer_ass_slice, /* intintobjargproc sq_ass_slice; __setslice__ */ };
! static PyObject *buffer_iter(PyObject *s) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *it = PyObject_GetIter(nobj); *************** *** 478,484 ****
! static PyObject *buffer_add(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Add(nobj,op); --- 473,480 ----
! static PyObject *buffer_add(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Add(nobj,op); *************** *** 491,497 **** }
! static PyObject *buffer_subtract(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Subtract(nobj,op); --- 487,494 ---- }
! static PyObject *buffer_subtract(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Subtract(nobj,op); *************** *** 504,510 **** }
! static PyObject *buffer_multiply(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Multiply(nobj,op); --- 501,508 ---- }
! static PyObject *buffer_multiply(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Multiply(nobj,op); *************** *** 517,523 **** }
! static PyObject *buffer_divide(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Divide(nobj,op); --- 515,522 ---- }
! static PyObject *buffer_divide(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Divide(nobj,op); *************** *** 530,536 **** }
! static PyObject *buffer_remainder(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Remainder(nobj,op); --- 529,536 ---- }
! static PyObject *buffer_remainder(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Remainder(nobj,op); *************** *** 543,549 **** }
! static PyObject *buffer_divmod(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Divmod(nobj,op); --- 543,550 ---- }
! static PyObject *buffer_divmod(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Divmod(nobj,op); *************** *** 556,562 **** }
! static PyObject *buffer_power(pySamplebuffer *self,PyObject *op1,PyObject *op2) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Power(nobj,op1,op2); --- 557,564 ---- }
! static PyObject *buffer_power(PyObject *s,PyObject *op1,PyObject *op2) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Power(nobj,op1,op2); *************** *** 569,575 **** }
! static PyObject *buffer_negative(pySamplebuffer *self) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Negative(nobj); --- 571,578 ---- }
! static PyObject *buffer_negative(PyObject *s) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Negative(nobj); *************** *** 582,588 **** }
! static PyObject *buffer_pos(pySamplebuffer *self) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Positive(nobj); --- 585,592 ---- }
! static PyObject *buffer_pos(PyObject *s) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Positive(nobj); *************** *** 594,600 **** }
! static PyObject *buffer_absolute(pySamplebuffer *self) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_Absolute(nobj); --- 598,605 ---- }
! static PyObject *buffer_absolute(PyObject *s) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_Absolute(nobj); *************** *** 607,611 **** }
! static int buffer_coerce(pySamplebuffer **pm, PyObject **pw) { if(pySamplebuffer_Check(*pw)) { --- 612,616 ---- }
! static int buffer_coerce(PyObject **pm, PyObject **pw) { if(pySamplebuffer_Check(*pw)) { *************** *** 618,624 **** } ! static PyObject *buffer_inplace_add(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_InPlaceAdd(nobj,op); --- 623,630 ---- } ! static PyObject *buffer_inplace_add(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_InPlaceAdd(nobj,op); *************** *** 631,637 **** }
! static PyObject *buffer_inplace_subtract(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_InPlaceSubtract(nobj,op); --- 637,644 ---- }
! static PyObject *buffer_inplace_subtract(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_InPlaceSubtract(nobj,op); *************** *** 644,650 **** }
! static PyObject *buffer_inplace_multiply(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_InPlaceMultiply(nobj,op); --- 651,658 ---- }
! static PyObject *buffer_inplace_multiply(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_InPlaceMultiply(nobj,op); *************** *** 657,663 **** }
! static PyObject *buffer_inplace_divide(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_InPlaceDivide(nobj,op); --- 665,672 ---- }
! static PyObject *buffer_inplace_divide(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_InPlaceDivide(nobj,op); *************** *** 670,676 **** }
! static PyObject *buffer_inplace_remainder(pySamplebuffer *self,PyObject *op) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_InPlaceRemainder(nobj,op); --- 679,686 ---- }
! static PyObject *buffer_inplace_remainder(PyObject *s,PyObject *op) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_InPlaceRemainder(nobj,op); *************** *** 683,689 **** }
! static PyObject *buffer_inplace_power(pySamplebuffer *self,PyObject *op1,PyObject *op2) { ! PyObject *nobj = buffer_slice(self); if(nobj) { PyObject *ret = PyNumber_InPlacePower(nobj,op1,op2); --- 693,700 ---- }
! static PyObject *buffer_inplace_power(PyObject *s,PyObject *op1,PyObject *op2) { ! pySamplebuffer *self = reinterpret_cast<pySamplebuffer *>(s); ! PyObject *nobj = buffer_slice(s); if(nobj) { PyObject *ret = PyNumber_InPlacePower(nobj,op1,op2);
Index: pybase.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/pybase.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pybase.cpp 3 Jan 2008 16:21:04 -0000 1.20 --- pybase.cpp 4 Jan 2008 11:59:00 -0000 1.21 *************** *** 7,11 ****
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-03 17:20:03 +0100 (Thu, 03 Jan 2008) $ $LastChangedBy: thomas $ */ --- 7,11 ----
$LastChangedRevision: 26 $ ! $LastChangedDate: 2008-01-03 18:00:03 +0100 (Thu, 03 Jan 2008) $ $LastChangedBy: thomas $ */ *************** *** 679,683 **** if(reg) { PyObject *key; ! int pos = 0; while(PyDict_Next(reg,&pos,&key,NULL)) { pybase *th = (pybase *)PyLong_AsLong(key); --- 679,683 ---- if(reg) { PyObject *key; ! Py_ssize_t pos = 0; while(PyDict_Next(reg,&pos,&key,NULL)) { pybase *th = (pybase *)PyLong_AsLong(key); *************** *** 698,702 ****
PyObject *key; ! int pos = 0; while(PyDict_Next(reg,&pos,&key,NULL)) { pybase *th = (pybase *)PyLong_AsLong(key); --- 698,702 ----
PyObject *key; ! Py_ssize_t pos = 0; while(PyDict_Next(reg,&pos,&key,NULL)) { pybase *th = (pybase *)PyLong_AsLong(key);