From 6ba34d18b55bedbddb750e5231a2aec9a1fbbac0 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sat, 14 Mar 2009 13:27:41 +0000 Subject: Fixed incorrect argument checking. --- .../python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp | 4 ++-- .../UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f') diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp index e8421277bf2..2976ca213a5 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp @@ -104,12 +104,12 @@ int Normal2DF1D___init__( BPy_Normal2DF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O", &obj) ) { + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { cout << "ERROR: Normal2DF1D___init__" << endl; return -1; } - IntegrationType t = ( obj && BPy_IntegrationType_Check(obj) ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_vec2f.uf1D_vec2f = new Functions1D::Normal2DF1D(t); return 0; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp index b6e69b80bce..f2494af27e3 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp @@ -104,12 +104,12 @@ int Orientation2DF1D___init__( BPy_Orientation2DF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O", &obj) ) { + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { cout << "ERROR: Orientation2DF1D___init__" << endl; return -1; } - IntegrationType t = ( obj && BPy_IntegrationType_Check(obj) ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_vec2f.uf1D_vec2f = new Functions1D::Orientation2DF1D(t); return 0; -- cgit v1.2.3