Differential D545 Diff 1919 source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
| Show All 19 Lines | |||||
| /** \file source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp | /** \file source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp | ||||
| * \ingroup freestyle | * \ingroup freestyle | ||||
| */ | */ | ||||
| #include "BPy_Interface0DIterator.h" | #include "BPy_Interface0DIterator.h" | ||||
| #include "../BPy_Convert.h" | #include "../BPy_Convert.h" | ||||
| #include "../BPy_Interface1D.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| /////////////////////////////////////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////////////////////////////////////// | ||||
| //------------------------INSTANCE METHODS ---------------------------------- | //------------------------INSTANCE METHODS ---------------------------------- | ||||
| Show All 29 Lines | if (!nested_it) | ||||
| return 0; | return 0; | ||||
| *((Interface0DIteratorNested **)v) = nested_it; | *((Interface0DIteratorNested **)v) = nested_it; | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *args, PyObject *kwds) | static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *args, PyObject *kwds) | ||||
| { | { | ||||
| static const char *kwlist_1[] = {"it", NULL}; | static const char *kwlist_1[] = {"it", NULL}; | ||||
| static const char *kwlist_2[] = {"brother", NULL}; | static const char *kwlist_2[] = {"inter", NULL}; | ||||
kjym3: The keyword argument name could be `inter`. Not really an issue but the camel case name seems… | |||||
| static const char *kwlist_3[] = {"brother", NULL}; | |||||
| Interface0DIteratorNested *nested_it; | Interface0DIteratorNested *nested_it; | ||||
| PyObject *brother; | PyObject *brother, *inter; | ||||
| if (PyArg_ParseTupleAndKeywords(args, kwds, "O&", (char **)kwlist_1, convert_nested_it, &nested_it)) { | if (PyArg_ParseTupleAndKeywords(args, kwds, "O&", (char **)kwlist_1, convert_nested_it, &nested_it)) { | ||||
Not Done Inline ActionsLooks like I forgot to point out this redundant call of PyErr_Clear(). kjym3: Looks like I forgot to point out this redundant call of `PyErr_Clear()`. | |||||
| self->if0D_it = new Interface0DIterator(nested_it->copy()); | self->if0D_it = new Interface0DIterator(nested_it->copy()); | ||||
| self->at_start = true; | self->at_start = true; | ||||
| self->reversed = false; | self->reversed = false; | ||||
| } | } | ||||
| else if (PyErr_Clear(), | else if (PyErr_Clear(), | ||||
| PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Interface0DIterator_Type, &brother)) | PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Interface1D_Type, &inter)) | ||||
| { | |||||
| self->if0D_it = new Interface0DIterator(((BPy_Interface1D *)inter)->if1D->verticesBegin()); | |||||
| self->at_start = true; | |||||
| self->reversed = false; | |||||
| } | |||||
| else if (PyErr_Clear(), | |||||
| PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_3, &Interface0DIterator_Type, &brother)) | |||||
| { | { | ||||
| self->if0D_it = new Interface0DIterator(*(((BPy_Interface0DIterator *)brother)->if0D_it)); | self->if0D_it = new Interface0DIterator(*(((BPy_Interface0DIterator *)brother)->if0D_it)); | ||||
| self->at_start = ((BPy_Interface0DIterator *)brother)->at_start; | self->at_start = ((BPy_Interface0DIterator *)brother)->at_start; | ||||
| self->reversed = ((BPy_Interface0DIterator *)brother)->reversed; | self->reversed = ((BPy_Interface0DIterator *)brother)->reversed; | ||||
| } | } | ||||
| else { | else { | ||||
| PyErr_SetString(PyExc_TypeError, "invalid argument(s)"); | PyErr_SetString(PyExc_TypeError, "invalid argument(s)"); | ||||
| return -1; | return -1; | ||||
| ▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines | |||||
The keyword argument name could be inter. Not really an issue but the camel case name seems unusual.