Director typemap cleanup and return by value
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4989 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c64a331078
commit
ce452b8b8d
2 changed files with 13 additions and 9 deletions
|
|
@ -453,12 +453,11 @@
|
|||
|
||||
%typemap(inv, parse="O") PyObject* "";
|
||||
|
||||
/*
|
||||
%typemap(inv, parse="s") SWIGTYPE {
|
||||
|
||||
/* // this is rather dangerous
|
||||
%typemap(inv) SWIGTYPE {
|
||||
{
|
||||
$&1_ltype resultptr;
|
||||
resultptr = new $1_ltype(($1_ltype &) $1);
|
||||
$result = SWIG_NewPointerObj((void *) resultptr, $&1_descriptor, 1);
|
||||
$input = SWIG_NewPointerObj((void *) &$1_name, $&1_descriptor, $owner);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
@ -480,13 +479,11 @@
|
|||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
%typemap(inv, parse="s") void "0";
|
||||
*/
|
||||
/*
|
||||
/* // not currently needed, see python.cxx
|
||||
%typemap(inv) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
||||
}
|
||||
%typemap(inv, parse="s") void "0";
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -518,6 +515,9 @@ OUTV_TYPEMAP(bool, PyInt_AsLong);
|
|||
OUTV_TYPEMAP(PyObject *, );
|
||||
OUTV_TYPEMAP(char *, PyString_AsString);
|
||||
|
||||
/* Object returned by value. Convert from a pointer */
|
||||
%typemap(outv) SWIGTYPE ($<ype argp)
|
||||
"if ((SWIG_ConvertPtr($input,(void **) &argp, $&descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\"); $result = *argp;";
|
||||
|
||||
%typemap(outv) SWIGTYPE *,
|
||||
SWIGTYPE &,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue