From fb333f36419cb3c32211d1c811c1d718d213419a Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 6 Jan 2002 14:34:14 +0000 Subject: [PATCH] Bug fix: convertability checks were missed in one case [SVN r12229] --- include/boost/python/detail/returning.hpp | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/include/boost/python/detail/returning.hpp b/include/boost/python/detail/returning.hpp index ed107d37..87aecac5 100644 --- a/include/boost/python/detail/returning.hpp +++ b/include/boost/python/detail/returning.hpp @@ -359,8 +359,9 @@ struct returning static PyObject* call(R (*pf)(), PyObject*, PyObject* /* keywords */ ) { // find the result converter - wrap r; - return r( (*pf)() ); + wrap c0; + if (!c0) return 0; + return c0( (*pf)() ); } template static PyObject* call(R (*pf)(A0), PyObject* args, PyObject* /* keywords */ ) @@ -369,9 +370,9 @@ struct returning unwrap c0(PyTuple_GET_ITEM(args, 0)); // find the result converter - wrap_more r(c0); + wrap_more c1(c0); if (!c0) return 0; - return r( (*pf)(*c0) ); + return c1( (*pf)(*c0) ); } template static PyObject* call(R (*pf)(A0, A1), PyObject* args, PyObject* /* keywords */ ) @@ -381,9 +382,9 @@ struct returning unwrap_more c1(PyTuple_GET_ITEM(args, 1), c0); // find the result converter - wrap_more r(c1); + wrap_more c2(c1); if (!c0) return 0; - return r( (*pf)(*c0, *c1) ); + return c2( (*pf)(*c0, *c1) ); } template static PyObject* call(R (*pf)(A0, A1, A2), PyObject* args, PyObject* /* keywords */ ) @@ -394,9 +395,9 @@ struct returning unwrap_more c2(PyTuple_GET_ITEM(args, 2), c1); // find the result converter - wrap_more r(c2); + wrap_more c3(c2); if (!c0) return 0; - return r( (*pf)(*c0, *c1, *c2) ); + return c3( (*pf)(*c0, *c1, *c2) ); } template static PyObject* call(R (*pf)(A0, A1, A2, A3), PyObject* args, PyObject* /* keywords */ ) @@ -408,9 +409,9 @@ struct returning unwrap_more c3(PyTuple_GET_ITEM(args, 3), c2); // find the result converter - wrap_more r(c3); + wrap_more c4(c3); if (!c0) return 0; - return r( (*pf)(*c0, *c1, *c2, *c3) ); + return c4( (*pf)(*c0, *c1, *c2, *c3) ); } template static PyObject* call(R (*pf)(A0, A1, A2, A3, A4), PyObject* args, PyObject* /* keywords */ ) @@ -423,9 +424,9 @@ struct returning unwrap_more c4(PyTuple_GET_ITEM(args, 4), c3); // find the result converter - wrap_more r(c4); + wrap_more c5(c4); if (!c0) return 0; - return r( (*pf)(*c0, *c1, *c2, *c3, *c4) ); + return c5( (*pf)(*c0, *c1, *c2, *c3, *c4) ); } template static PyObject* call(R (*pf)(A0, A1, A2, A3, A4, A5), PyObject* args, PyObject* /* keywords */ ) @@ -439,9 +440,9 @@ struct returning unwrap_more c5(PyTuple_GET_ITEM(args, 5), c4); // find the result converter - wrap_more r(c5); + wrap_more c6(c5); if (!c0) return 0; - return r( (*pf)(*c0, *c1, *c2, *c3, *c4, *c5) ); + return c6( (*pf)(*c0, *c1, *c2, *c3, *c4, *c5) ); } };