From: Marcelo M. <mar...@us...> - 2004-12-21 20:07:26
|
Update of /cvsroot/swig/SWIG/Lib/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2313/Lib/python Modified Files: pyptrtypes.swg Log Message: fix varin for ptr types Index: pyptrtypes.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pyptrtypes.swg,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pyptrtypes.swg 19 Dec 2004 22:48:33 -0000 1.12 --- pyptrtypes.swg 21 Dec 2004 20:07:15 -0000 1.13 *************** *** 44,54 **** int res = asptr_meth($input, &ptr); if (!res) { ! if (!PyErr_Occurred()) SWIG_type_error("$basetype", $input); ! SWIG_append_msg(" C/C++ variable '$name'"); return 1; } else if (!ptr) { SWIG_null_ref("$basetype"); ! SWIG_append_msg(" C/C++ variable '$name'"); return 1; } --- 44,55 ---- int res = asptr_meth($input, &ptr); if (!res) { ! if (!PyErr_Occurred()) { SWIG_type_error("$basetype", $input); ! } ! SWIG_append_errmsg(" C/C++ variable '$name'"); return 1; } else if (!ptr) { SWIG_null_ref("$basetype"); ! SWIG_append_errmsg(" C/C++ variable '$name'"); return 1; } *************** *** 70,73 **** --- 71,75 ---- if (res == SWIG_NEWOBJ) delete ptr; } + %typemap(directorout,fragment=pyfrag) Type { Type *ptr = 0; *************** *** 78,82 **** if (res == SWIG_NEWOBJ) delete ptr; } ! %typemap(directorout,fragment=pyfrag,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& { Type *ptr = 0; int res = $input ? asptr_meth($input, &ptr) : 0; --- 80,85 ---- if (res == SWIG_NEWOBJ) delete ptr; } ! ! %typemap(directorout,fragment=pyfrag,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& { Type *ptr = 0; int res = $input ? asptr_meth($input, &ptr) : 0; *************** *** 93,97 **** --- 96,102 ---- } } + %typemap(directorout,fragment=pyfrag) Type &DIRECTOROUT = Type + %enddef |