Commit graph

14 commits

Author SHA1 Message Date
Vadim Zeitlin
fd3e763656 Streamline and fix returning objects by value
Remove the code related to "_result_ref" which was confusing and plain
wrong, as it generated something that compiled but crashed during
run-time due to the use of a pointer to an already destroyed stack
object.

Instead, correct the "out" typemap to create a new copy of the object,
which mostly works fine on its own, except that it depends on using
SwigValueWrapper if necessary, so add the call to cplus_value_type()
does this. This also required removing the code resolving typedefs in
the "type" attribute because it confused the base class logic and still
needs an explicit cast to the actual return type due to the use of (and
probable bug in) get_wrapper_func_return_type().

These changes mean that "cppouttype" typemap is not used any longer, so
remove it too.

A couple more tests pass now.
2019-08-06 02:35:25 +02:00
Vadim Zeitlin
8cae88dd39 Get rid of separate cmodtype typemap
Use the same ctype for wrapper declarations and definitions and just expand
$resolved_type differently in the two cases.

This simplifies the typemaps and ensures that the declarations and definitions
use the same types, at least for all non-object parameters.
2016-04-21 18:58:32 +02:00
Leif Middelschulte
d906d3c73e Reuse 'cmodtype' typemap and remove 'couttype' typemap completely.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13681 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-20 13:23:18 +00:00
Leif Middelschulte
5aa23f9bdb Reuse 'ctype' typemap and remove 'proxycouttype' typemap.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13680 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-20 13:23:03 +00:00
Leif Middelschulte
a894545c9a Rename 'proxy' to 'ctype' as it's the typemap used for the C API.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13679 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-20 13:22:48 +00:00
Leif Middelschulte
fcecbf17a2 Rename 'ctype' typemap to 'cmodtype' since it's only used for internal (wrapper) stuff.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13678 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-20 13:22:33 +00:00
Leif Middelschulte
7a0a1022f8 Remove leftovers of removed 'wrap_call' typemap.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13677 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-20 13:22:18 +00:00
Leif Middelschulte
0e75ebbc34 Update to reflect changes (additional typemaps) in the C backend.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13481 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-01 12:52:17 +00:00
Maciej Drwal
32e03aa13d Many major improvements. Almost all testsuite compiles now.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11189 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-04-15 23:30:16 +00:00
Maciej Drwal
a2dc2756c8 Several major fixes for: arrays, static members, member func.ptrs., exceptions, ... Lots of tests runs ok now.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11188 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-04-13 21:23:07 +00:00
Maciej Drwal
8c04b766d4 Fix for warning on return by value. Fix for std_string.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11184 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-04-08 20:32:30 +00:00
Maciej Drwal
4acb01b741 Fix for returning objects.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11109 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-02-04 16:10:07 +00:00
Maciej Drwal
ea556b565d Some function return cases fixed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10748 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-08-09 20:14:41 +00:00
Maciej Drwal
dcec3c3fb0 Added std_string support. Renamed SWIG_exception to SWIG_exc to avoid name collision with macro in Lib/exception.i.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10720 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-07-30 22:09:02 +00:00