diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2017-03-16 21:04:38 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2017-03-16 21:04:38 +0000 |
commit | 72ba741d1c82fe24dfe94354117db0477636c63c (patch) | |
tree | 8e9d855d33316f8068de6dd9c9c1401c477d182e /Examples | |
parent | cf7d53599cd6c6742903d9bfe604947a0a9a0309 (diff) | |
download | swig-72ba741d1c82fe24dfe94354117db0477636c63c.tar.gz |
Fix wrapping of references/pointers and qualifiers to member pointers
Also fix Go wrapping of member const function pointers.
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/member_funcptr_galore.i | 8 | ||||
-rw-r--r-- | Examples/test-suite/member_pointer.i | 6 | ||||
-rw-r--r-- | Examples/test-suite/member_pointer_const.i | 10 |
3 files changed, 6 insertions, 18 deletions
diff --git a/Examples/test-suite/member_funcptr_galore.i b/Examples/test-suite/member_funcptr_galore.i index 2592ae563..27d7a386a 100644 --- a/Examples/test-suite/member_funcptr_galore.i +++ b/Examples/test-suite/member_funcptr_galore.i @@ -1,5 +1,11 @@ %module member_funcptr_galore +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) extra2; +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) extra3; +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) pp2; +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) pp3; +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) pp5; + %{ #if defined(__SUNPRO_CC) #pragma error_messages (off, badargtype2w) /* Formal argument ... is being passed extern "C" ... */ @@ -185,7 +191,6 @@ int MemberFuncPtrs::qqq5(short (Funcs::* & qq5)(bool)) const { return 0; } int MemberFuncPtrs::qqq6(short (Funcs::* const qq6)(bool)) const { return 0; } int MemberFuncPtrs::qqq7(short (Funcs::* const& qq7)(bool)) const { return 0; } -#if !defined(SWIGGO) // member function pointer variables short (Funcs::* pp1)(bool) = &Funcs::FF; @@ -199,5 +204,4 @@ short (Funcs::* *const& pp4)(bool) = extra4; short (Funcs::* & pp5)(bool) = pp1; short (Funcs::* const pp6)(bool) = &Funcs::FF; short (Funcs::* const& pp7)(bool) = pp1; -#endif %} diff --git a/Examples/test-suite/member_pointer.i b/Examples/test-suite/member_pointer.i index 0784d0e3b..e3b4f85ab 100644 --- a/Examples/test-suite/member_pointer.i +++ b/Examples/test-suite/member_pointer.i @@ -48,24 +48,18 @@ public: typedef double (Shape::*PerimeterFunc_td)(void); extern double do_op(Shape *s, double (Shape::*m)(void)); -#if !defined(SWIGGO) extern double do_op_td(Shape *s, PerimeterFunc_td m); -#endif /* Functions that return member pointers */ extern double (Shape::*areapt())(void); extern double (Shape::*perimeterpt())(void); -#if !defined(SWIGGO) extern PerimeterFunc_td perimeterpt_td(); -#endif /* Global variables that are member pointers */ extern double (Shape::*areavar)(void); extern double (Shape::*perimetervar)(void); -#if !defined(SWIGGO) extern PerimeterFunc_td perimetervar_td; -#endif %} %{ diff --git a/Examples/test-suite/member_pointer_const.i b/Examples/test-suite/member_pointer_const.i index 20299f5f5..4af712f7f 100644 --- a/Examples/test-suite/member_pointer_const.i +++ b/Examples/test-suite/member_pointer_const.i @@ -49,24 +49,18 @@ public: typedef double (Shape::*PerimeterFunc_td)(void) const; extern double do_op(Shape *s, double (Shape::*m)(void) const); -#if !defined(SWIGGO) extern double do_op_td(Shape *s, PerimeterFunc_td m); -#endif /* Functions that return member pointers */ extern double (Shape::*areapt())(void) const; extern double (Shape::*perimeterpt())(void) const; -#if !defined(SWIGGO) extern PerimeterFunc_td perimeterpt_td(); -#endif /* Global variables that are member pointers */ extern double (Shape::*areavar)(void) const; extern double (Shape::*perimetervar)(void) const; -#if !defined(SWIGGO) extern PerimeterFunc_td perimetervar_td; -#endif %} %{ @@ -124,11 +118,9 @@ PerimeterFunc_td perimetervar_td = &Shape::perimeter; /* Some constants */ -#if !defined(SWIGGO) %constant double (Shape::*AREAPT)(void) const = &Shape::area; %constant double (Shape::*PERIMPT)(void) const = &Shape::perimeter; %constant double (Shape::*NULLPT)(void) const = 0; -#endif /* %inline %{ @@ -152,8 +144,6 @@ int call1(int (Funktions::*d)(const int &, int) const, int a, int b) { Funktions //int call3(int & (Funktions::*d)(const int &, int) const, int a, int b) { Funktions f; return (f.*d)(a, b); } %} -#if !defined(SWIGGO) %constant int (Funktions::*ADD_BY_VALUE)(const int &, int) const = &Funktions::addByValue; -#endif //%constant int * (Funktions::*ADD_BY_POINTER)(const int &, int) const = &Funktions::addByPointer; //%constant int & (Funktions::*ADD_BY_REFERENCE)(const int &, int) const = &Funktions::addByReference; |