From 7a6edf8b820ef80bbb5361bdf1e4c33e7c92f145 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 15 Sep 2016 01:41:20 +0200 Subject: [PATCH] Remove nonsensical typemaps for SWIGTYPE** It's not clear why they were defined in the first place, but they broke li_std_vector_ptr unit test, which now uses "T**", after the latest merge with master, so just remove them to let the test pass again. --- Lib/c/c.swg | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Lib/c/c.swg b/Lib/c/c.swg index 4447e9fa8..171c7786b 100644 --- a/Lib/c/c.swg +++ b/Lib/c/c.swg @@ -119,7 +119,6 @@ same_macro_all_primitive_types_but_void(cref_as_value,ctype); %typemap(ctype) SWIGTYPE *& "$resolved_type**" %typemap(ctype) SWIGTYPE [ANY] "/*SWIGTYPE [ANY]*/ $1_ltype **" %typemap(ctype) SWIGTYPE * [ANY] "/*SWIGTYPE *[ANY] */ $1_ltype **" -%typemap(ctype) SWIGTYPE ** "/*SWIGTYPE ** */ $1_ltype **" %typemap(ctype) enum SWIGTYPE "int" %typemap(ctype) enum SWIGTYPE &, enum SWIGTYPE * "int *" @@ -156,11 +155,6 @@ same_action_all_primitive_types(in, "$1 = ($1_ltype) $input;", "$1 = &$input;") $1 = ($1_ltype) $input; } -%typemap(in) SWIGTYPE ** { - if ($input) - $1 = ($1_ltype) $input; -} - %typemap(in) SWIGTYPE *[ANY] { if ($input) { $1 = ($1_ltype) malloc($1_dim0 * sizeof($1_basetype)); @@ -192,7 +186,7 @@ same_action_all_primitive_types(in, "$1 = ($1_ltype) $input;", "$1 = &$input;") $1 = ($1_ltype) 0; } -%typemap(freearg) SWIGTYPE * [ANY], SWIGTYPE * [ANY][ANY], SWIGTYPE **, SWIGTYPE *** { +%typemap(freearg) SWIGTYPE * [ANY], SWIGTYPE * [ANY][ANY] { if ($input) free($input); } @@ -227,7 +221,7 @@ same_action_all_primitive_types(out, "$result = $1;", "$result = *$1;") *($&1_ltype) &$result = $1; } -%typemap(out) SWIGTYPE *&, SWIGTYPE ** { +%typemap(out) SWIGTYPE *& { static SwigObj* _ptr = (SwigObj*) $1; $result = &_ptr; } @@ -274,7 +268,6 @@ same_macro_all_primitive_types_but_void(cref_as_ptr,cppouttype); %typemap(cppouttype) SWIGTYPE *& "$1_ltype" %typemap(cppouttype) SWIGTYPE [ANY] "$1_ltype" %typemap(cppouttype) SWIGTYPE * [ANY] "/*SWIGTYPE *[ANY] */ $1_ltype" -%typemap(cppouttype) SWIGTYPE ** "/*SWIGTYPE ** */ $1_basetype **" %typemap(cppouttype, retobj="1") enum SWIGTYPE "int" %typemap(cppouttype) enum SWIGTYPE &, enum SWIGTYPE * "int *" %typemap(cppouttype) SWIGTYPE (CLASS::*) "$1_ltype"