diff options
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp | 2 | ||||
-rw-r--r-- | source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp index 6bca6db2cb7..722e1d376ae 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp @@ -134,7 +134,7 @@ PyTypeObject Stroke_Type = { /*** Added in release 2.2 ***/ /* Iterators */ - Stroke___iter__, /* getiterfunc tp_iter; */ + (getiterfunc)Stroke___iter__, /* getiterfunc tp_iter; */ NULL, /* iternextfunc tp_iternext; */ /*** Attribute descriptor and subclassing stuff ***/ diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp index 7f36856f359..c6240b527d0 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp @@ -11,7 +11,7 @@ extern "C" { /*--------------- Python API function prototypes for StrokeVertexIterator instance -----------*/ static int StrokeVertexIterator___init__(BPy_StrokeVertexIterator *self, PyObject *args); -static PyObject * StrokeVertexIterator_iternext( PyObject *obj ); +static PyObject * StrokeVertexIterator_iternext( BPy_StrokeVertexIterator *self ); static PyObject * StrokeVertexIterator_t( BPy_StrokeVertexIterator *self ); static PyObject * StrokeVertexIterator_u( BPy_StrokeVertexIterator *self ); static PyObject * StrokeVertexIterator_castToInterface0DIterator( BPy_StrokeVertexIterator *self ); @@ -141,17 +141,20 @@ int StrokeVertexIterator___init__(BPy_StrokeVertexIterator *self, PyObject *args return 0; } -PyObject * StrokeVertexIterator_iternext( PyObject *obj ) { - BPy_StrokeVertexIterator *self = (BPy_StrokeVertexIterator *)obj; +PyObject * StrokeVertexIterator_iternext( BPy_StrokeVertexIterator *self ) { StrokeVertex *sv; if (self->reversed) { - if (self->sv_it->isBegin()) + if (self->sv_it->isBegin()) { + PyErr_SetNone(PyExc_StopIteration); return NULL; + } self->sv_it->decrement(); sv = self->sv_it->operator->(); } else { - if (self->sv_it->isEnd()) + if (self->sv_it->isEnd()) { + PyErr_SetNone(PyExc_StopIteration); return NULL; + } sv = self->sv_it->operator->(); self->sv_it->increment(); } |