From 89e7497ac629277e75e101ddff69a9249e1ea8ca Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 6 Jan 2006 11:42:24 +0000 Subject: [PATCH] add support for named warning codes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8249 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 20 ++ Examples/perl5/variables/example.i | 2 +- Examples/python/operator/example.i | 2 +- Examples/python/variables/example.i | 2 +- Examples/ruby/operator/example.i | 2 +- Examples/ruby/variables/example.i | 2 +- Examples/tcl/variables/example.i | 2 +- Examples/test-suite/abstract_access.i | 2 +- Examples/test-suite/abstract_inherit.i | 4 +- Examples/test-suite/abstract_inherit_ok.i | 2 +- Examples/test-suite/abstract_signature.i | 4 +- Examples/test-suite/abstract_virtual.i | 8 +- Examples/test-suite/arrays_dimensionless.i | 4 +- Examples/test-suite/arrays_global.i | 2 +- Examples/test-suite/bloody_hell.i | 2 +- Examples/test-suite/bools.i | 4 +- Examples/test-suite/char_strings.i | 2 +- Examples/test-suite/constant_pointers.i | 2 +- Examples/test-suite/contract.i | 5 +- Examples/test-suite/cpp_basic.i | 4 +- Examples/test-suite/default_constructor.i | 12 +- Examples/test-suite/director_basic.i | 2 +- Examples/test-suite/director_detect.i | 5 +- Examples/test-suite/director_enum.i | 17 +- Examples/test-suite/director_frob.i | 2 +- Examples/test-suite/director_nested.i | 2 +- Examples/test-suite/director_string.i | 2 +- Examples/test-suite/director_wombat.i | 2 +- Examples/test-suite/director_wstring.i | 2 +- Examples/test-suite/disown.i | 2 +- Examples/test-suite/enum_plus.i | 2 +- Examples/test-suite/enum_template.i | 6 +- Examples/test-suite/enum_thorough.i | 76 +++--- Examples/test-suite/enums.i | 10 +- Examples/test-suite/evil_diamond.i | 11 +- Examples/test-suite/evil_diamond_ns.i | 11 +- Examples/test-suite/evil_diamond_prop.i | 11 +- Examples/test-suite/extend_default.i | 6 +- Examples/test-suite/features.i | 2 +- Examples/test-suite/friends.i | 2 +- Examples/test-suite/global_vars.i | 2 +- Examples/test-suite/imports_a.i | 4 +- Examples/test-suite/intermediary_classname.i | 2 +- Examples/test-suite/java_director.i | 2 +- Examples/test-suite/kind.i | 8 +- Examples/test-suite/li_carrays.i | 2 +- Examples/test-suite/li_cmalloc.i | 6 +- Examples/test-suite/li_cpointer.i | 2 +- Examples/test-suite/li_implicit.i | 2 +- Examples/test-suite/long_long.i | 12 +- Examples/test-suite/mixed_types.i | 4 +- Examples/test-suite/multiple_inheritance.i | 9 +- Examples/test-suite/name.i | 2 +- Examples/test-suite/name_cxx.i | 2 +- Examples/test-suite/name_warnings.i | 2 +- Examples/test-suite/namespace_class.i | 2 +- Examples/test-suite/namespace_extend.i | 2 +- Examples/test-suite/namespace_nested.i | 4 +- Examples/test-suite/namespace_template.i | 8 +- Examples/test-suite/operator_overload.i | 16 +- Examples/test-suite/overload_extend.i | 2 +- Examples/test-suite/pointer_reference.i | 2 +- Examples/test-suite/preproc.i | 30 +-- Examples/test-suite/primitive_types.i | 8 +- Examples/test-suite/private_assign.i | 2 +- Examples/test-suite/pure_virtual.i | 4 +- Examples/test-suite/python/director_stl.i | 2 +- Examples/test-suite/python/vector.i | 2 +- Examples/test-suite/redefined.i | 4 +- Examples/test-suite/reference_global_vars.i | 2 +- Examples/test-suite/ret_by_value.i | 2 +- Examples/test-suite/smart_pointer_extend.i | 2 +- Examples/test-suite/static_const_member_2.i | 6 +- Examples/test-suite/template.i | 6 +- Examples/test-suite/template_arg_replace.i | 2 +- Examples/test-suite/template_base_template.i | 4 +- Examples/test-suite/template_default.i | 2 +- Examples/test-suite/template_default2.i | 2 +- Examples/test-suite/template_default_arg.i | 2 +- .../test-suite/template_default_inherit.i | 2 +- .../test-suite/template_default_qualify.i | 2 +- Examples/test-suite/template_enum.i | 4 +- Examples/test-suite/template_enum_typedef.i | 2 +- Examples/test-suite/template_explicit.i | 8 +- Examples/test-suite/template_extend1.i | 4 +- Examples/test-suite/template_extend2.i | 4 +- .../test-suite/template_inherit_abstract.i | 7 +- Examples/test-suite/template_int_const.i | 4 +- Examples/test-suite/template_ns.i | 4 +- Examples/test-suite/template_ns3.i | 2 +- Examples/test-suite/template_rename.i | 4 +- .../test-suite/template_specialization_enum.i | 4 +- Examples/test-suite/template_static.i | 4 +- Examples/test-suite/template_tbase_template.i | 4 +- Examples/test-suite/template_type_namespace.i | 2 +- Examples/test-suite/template_typedef_ptr.i | 2 +- Examples/test-suite/throw_exception.i | 4 +- Examples/test-suite/typedef_funcptr.i | 4 +- Examples/test-suite/typemap_ns_using.i | 2 +- Examples/test-suite/typemap_subst.i | 2 +- Examples/test-suite/union_scope.i | 4 +- Examples/test-suite/using1.i | 2 +- Examples/test-suite/using2.i | 4 +- Examples/test-suite/using_composition.i | 4 +- Examples/test-suite/using_extend.i | 4 +- Examples/test-suite/using_namespace.i | 8 +- Examples/test-suite/virtual_poly.i | 12 +- Lib/java/enums.swg | 2 +- Lib/java/enumsimple.swg | 2 +- Lib/java/enumtypesafe.swg | 2 +- Lib/java/enumtypeunsafe.swg | 2 +- Lib/java/java.swg | 6 +- Lib/java/std_string.i | 2 +- Lib/java/std_wstring.i | 2 +- Lib/swig.swg | 66 ++++- Lib/swigwarn.swg | 252 ++++++++++++++++++ Lib/typemaps/ptrtypes.swg | 4 +- Lib/typemaps/strings.swg | 10 +- Lib/typemaps/swigtype.swg | 8 +- Lib/typemaps/valtypes.swg | 2 +- Lib/typemaps/void.swg | 2 +- Makefile.in | 18 +- Source/Preprocessor/cpp.c | 6 +- Source/Swig/error.c | 12 +- 124 files changed, 671 insertions(+), 281 deletions(-) create mode 100644 Lib/swigwarn.swg diff --git a/CHANGES.current b/CHANGES.current index 1d313cb9a..378ed5661 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,5 +1,25 @@ Version 1.3.28 (unreleased). =========================== +01/06/2006: mmatus + Add 'named' warning codes, now besides of: + + %warnfilter(813); + + you can use + + %warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE); + + just use the same code name found in Source/Include/swigwarn.h + plus the 'SWIG' prefix. + + If you add a new warning code, remember to run: + + make Lib/swigwarn.swg + + in the swig root directory and commit both files. You need + a machine with awk/echo to do that. + + 01/05/2006: wsfulton Fix for %extend and static const integral types, eg: diff --git a/Examples/perl5/variables/example.i b/Examples/perl5/variables/example.i index 1a1db2aba..9d0101cb7 100644 --- a/Examples/perl5/variables/example.i +++ b/Examples/perl5/variables/example.i @@ -4,7 +4,7 @@ #include "example.h" %} -#pragma SWIG nowarn=454 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK /* Some global variable declarations */ %inline %{ diff --git a/Examples/python/operator/example.i b/Examples/python/operator/example.i index 7968087fe..9c6221b8d 100644 --- a/Examples/python/operator/example.i +++ b/Examples/python/operator/example.i @@ -1,6 +1,6 @@ /* File : example.i */ %module example -#pragma SWIG nowarn=362 +#pragma SWIG nowarn=SWIGWARN_IGNORE_OPERATOR_EQ %{ #include "example.h" %} diff --git a/Examples/python/variables/example.i b/Examples/python/variables/example.i index 1a1db2aba..9d0101cb7 100644 --- a/Examples/python/variables/example.i +++ b/Examples/python/variables/example.i @@ -4,7 +4,7 @@ #include "example.h" %} -#pragma SWIG nowarn=454 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK /* Some global variable declarations */ %inline %{ diff --git a/Examples/ruby/operator/example.i b/Examples/ruby/operator/example.i index cfd6b512b..d0325b8bc 100644 --- a/Examples/ruby/operator/example.i +++ b/Examples/ruby/operator/example.i @@ -1,7 +1,7 @@ /* File : example.i */ %module example -%warnfilter(362); +%warnfilter(SWIGWARN_IGNORE_OPERATOR_EQ); %{ diff --git a/Examples/ruby/variables/example.i b/Examples/ruby/variables/example.i index 6accc10e9..84a150900 100644 --- a/Examples/ruby/variables/example.i +++ b/Examples/ruby/variables/example.i @@ -3,7 +3,7 @@ %{ #include "example.h" %} -#pragma SWIG nowarn=454 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK /* Some global variable declarations */ %inline %{ diff --git a/Examples/tcl/variables/example.i b/Examples/tcl/variables/example.i index 1a1db2aba..9d0101cb7 100644 --- a/Examples/tcl/variables/example.i +++ b/Examples/tcl/variables/example.i @@ -4,7 +4,7 @@ #include "example.h" %} -#pragma SWIG nowarn=454 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK /* Some global variable declarations */ %inline %{ diff --git a/Examples/test-suite/abstract_access.i b/Examples/test-suite/abstract_access.i index b35b02687..557f23154 100644 --- a/Examples/test-suite/abstract_access.i +++ b/Examples/test-suite/abstract_access.i @@ -1,6 +1,6 @@ %module abstract_access -%warnfilter(517) A; +%warnfilter(SWIGWARN_LANG_DIRECTOR_ABSTRACT) A; %inline %{ class A { diff --git a/Examples/test-suite/abstract_inherit.i b/Examples/test-suite/abstract_inherit.i index 59c6f3748..3fe1f67c0 100644 --- a/Examples/test-suite/abstract_inherit.i +++ b/Examples/test-suite/abstract_inherit.i @@ -1,7 +1,7 @@ %module abstract_inherit -%warnfilter(403) Spam; -%warnfilter(403) Bar; +%warnfilter(SWIGWARN_TYPE_ABSTRACT) Spam; +%warnfilter(SWIGWARN_TYPE_ABSTRACT) Bar; %inline %{ diff --git a/Examples/test-suite/abstract_inherit_ok.i b/Examples/test-suite/abstract_inherit_ok.i index 79657ac7b..cb40fa436 100644 --- a/Examples/test-suite/abstract_inherit_ok.i +++ b/Examples/test-suite/abstract_inherit_ok.i @@ -1,7 +1,7 @@ %module abstract_inherit_ok %feature("notabstract") Spam; -%warnfilter(403) Spam; +%warnfilter(SWIGWARN_TYPE_ABSTRACT) Spam; %inline %{ diff --git a/Examples/test-suite/abstract_signature.i b/Examples/test-suite/abstract_signature.i index 50ccbfc7a..0c1a45a49 100644 --- a/Examples/test-suite/abstract_signature.i +++ b/Examples/test-suite/abstract_signature.i @@ -1,7 +1,7 @@ %module abstract_signature -%warnfilter(801) abstract_foo; // Ruby, wrong class name -%warnfilter(801) abstract_bar; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) abstract_foo; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) abstract_bar; // Ruby, wrong class name %inline %{ class abstract_foo diff --git a/Examples/test-suite/abstract_virtual.i b/Examples/test-suite/abstract_virtual.i index 9b12ee052..94c10bec2 100644 --- a/Examples/test-suite/abstract_virtual.i +++ b/Examples/test-suite/abstract_virtual.i @@ -1,7 +1,11 @@ %module(ruby_minherit="1") abstract_virtual -%warnfilter(813,833,870) D; /* C#, Java, Php4 multiple inheritance */ -%warnfilter(813,833,870) E; /* C#, Java, Php4 multiple inheritance */ +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) D; /* C#, Java, Php4 multiple inheritance */ +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) E; /* C#, Java, Php4 multiple inheritance */ %inline %{ struct A diff --git a/Examples/test-suite/arrays_dimensionless.i b/Examples/test-suite/arrays_dimensionless.i index 05ccf678b..11dc022f7 100644 --- a/Examples/test-suite/arrays_dimensionless.i +++ b/Examples/test-suite/arrays_dimensionless.i @@ -1,8 +1,8 @@ %module arrays_dimensionless -%warnfilter(462) globalints; /* Unable to set variable of type int [] */ -%warnfilter(462) ints; /* Unable to set variable of type int [] */ +%warnfilter(SWIGWARN_TYPEMAP_VARIN_UNDEF) globalints; /* Unable to set variable of type int [] */ +%warnfilter(SWIGWARN_TYPEMAP_VARIN_UNDEF) ints; /* Unable to set variable of type int [] */ %inline %{ diff --git a/Examples/test-suite/arrays_global.i b/Examples/test-suite/arrays_global.i index f63d4df67..b0382817c 100644 --- a/Examples/test-suite/arrays_global.i +++ b/Examples/test-suite/arrays_global.i @@ -2,7 +2,7 @@ This test case tests that various types of arrays are working. */ -%warnfilter(451,462); +%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK,SWIGWARN_TYPEMAP_VARIN_UNDEF); %module arrays_global diff --git a/Examples/test-suite/bloody_hell.i b/Examples/test-suite/bloody_hell.i index 4bbb4f110..e580f0dd4 100644 --- a/Examples/test-suite/bloody_hell.i +++ b/Examples/test-suite/bloody_hell.i @@ -1,6 +1,6 @@ %module bloody_hell -%warnfilter(801) kMaxIOCTLSpaceParmsSize; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) kMaxIOCTLSpaceParmsSize; #define kMaxIOCTLSpaceParmsSize 128 diff --git a/Examples/test-suite/bools.i b/Examples/test-suite/bools.i index 0a8e02d2b..40e8989bd 100644 --- a/Examples/test-suite/bools.i +++ b/Examples/test-suite/bools.i @@ -1,7 +1,7 @@ // bool typemaps check %module bools -%warnfilter(454); /* memory leak when setting a ptr/ref variable */ -%warnfilter(801) constbool; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) constbool; /* Ruby, wrong class name */ // bool constant %constant bool constbool=false; diff --git a/Examples/test-suite/char_strings.i b/Examples/test-suite/char_strings.i index 51c87d279..fd309bcc9 100644 --- a/Examples/test-suite/char_strings.i +++ b/Examples/test-suite/char_strings.i @@ -6,7 +6,7 @@ below. %module char_strings -%warnfilter(462) global_char_array1; // Unable to set variable of type char[] +%warnfilter(SWIGWARN_TYPEMAP_VARIN_UNDEF) global_char_array1; // Unable to set variable of type char[] %{ #define OTHERLAND_MSG "Little message from the the safe world." diff --git a/Examples/test-suite/constant_pointers.i b/Examples/test-suite/constant_pointers.i index de790cb93..49c6e98d2 100644 --- a/Examples/test-suite/constant_pointers.i +++ b/Examples/test-suite/constant_pointers.i @@ -4,7 +4,7 @@ This testcase primarily test constant pointers, eg int* const. Only a getter is %module constant_pointers -%warnfilter(454); /* memory leak when setting a ptr/ref variable */ +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */ %inline %{ diff --git a/Examples/test-suite/contract.i b/Examples/test-suite/contract.i index 4e43aa916..4d4b5121a 100644 --- a/Examples/test-suite/contract.i +++ b/Examples/test-suite/contract.i @@ -1,6 +1,9 @@ %module contract -%warnfilter(802,813,833,870) C; /* Ruby, C#, Java, Php4 multiple inheritance */ +%warnfilter(SWIGWARN_RUBY_MULTIPLE_INHERITANCE, + SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) C; /* Ruby, C#, Java, Php4 multiple inheritance */ #ifdef SWIGCSHARP %ignore B::bar; // otherwise get a warning: `C.bar' no suitable methods found to override diff --git a/Examples/test-suite/cpp_basic.i b/Examples/test-suite/cpp_basic.i index 6a2b389a4..260cbeb5d 100644 --- a/Examples/test-suite/cpp_basic.i +++ b/Examples/test-suite/cpp_basic.i @@ -1,8 +1,8 @@ /* This is a basic test of proxy classes, used by chicken */ -%warnfilter(454); /* memory leak when setting a ptr/ref variable */ +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */ -%warnfilter(801) global_cint; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) global_cint; /* Ruby, wrong constant name */ %module cpp_basic diff --git a/Examples/test-suite/default_constructor.i b/Examples/test-suite/default_constructor.i index 8930ba1fb..62ad9d566 100644 --- a/Examples/test-suite/default_constructor.i +++ b/Examples/test-suite/default_constructor.i @@ -3,9 +3,15 @@ %module(ruby_minherit="1") default_constructor -%warnfilter(813,833,870) EB; /* C#, Java, Php4 multiple inheritance */ -%warnfilter(813,833,870) AD; /* C#, Java, Php4 multiple inheritance */ -%warnfilter(510) F; /* friend function */ +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) EB; /* C#, Java, Php4 multiple inheritance */ + +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) AD; /* C#, Java, Php4 multiple inheritance */ + +%warnfilter(SWIGWARN_LANG_FRIEND_IGNORE) F; /* friend function */ %inline %{ diff --git a/Examples/test-suite/director_basic.i b/Examples/test-suite/director_basic.i index 696d6cc5d..26fd29dc6 100644 --- a/Examples/test-suite/director_basic.i +++ b/Examples/test-suite/director_basic.i @@ -1,5 +1,5 @@ %module(directors="1") director_basic - #pragma SWIG nowarn=470,473 + #pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR %{ #include diff --git a/Examples/test-suite/director_detect.i b/Examples/test-suite/director_detect.i index b7e80a44a..af35d38e3 100644 --- a/Examples/test-suite/director_detect.i +++ b/Examples/test-suite/director_detect.i @@ -1,7 +1,8 @@ %module(directors="1") director_detect -#pragma SWIG nowarn=470,473 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR -%warnfilter(822, 842) cloner; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, + SWIGWARN_CSHARP_COVARIANT_RET) cloner; /* Java, C# covariant return types */ %{ #include diff --git a/Examples/test-suite/director_enum.i b/Examples/test-suite/director_enum.i index 1c190b0ac..c7932d1dc 100644 --- a/Examples/test-suite/director_enum.i +++ b/Examples/test-suite/director_enum.i @@ -1,13 +1,14 @@ %module(directors="1") director_enum -%warnfilter(801) EnumDirector::hi; /* Ruby, wrong constant name */ -%warnfilter(801) EnumDirector::hello; /* Ruby, wrong constant name */ -%warnfilter(801) EnumDirector::yo; /* Ruby, wrong constant name */ -%warnfilter(801) EnumDirector::awright; /* Ruby, wrong constant name */ -%warnfilter(801) EnumDirector::Foo::ciao; /* Ruby, wrong constant name */ -%warnfilter(801) EnumDirector::Foo::aufwiedersehen; /* Ruby, wrong constant name */ -%warnfilter(801) EnumDirector::Foo::adios; /* Ruby, wrong constant name */ -%warnfilter(470,473) EnumDirector::Foo; /* Thread/reentrant unsafe wrapping, consider returning by value instead. */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::hi; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::hello; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::yo; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::awright; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::Foo::ciao; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::Foo::aufwiedersehen; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) EnumDirector::Foo::adios; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE, + SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) EnumDirector::Foo; /* Thread/reentrant unsafe wrapping, consider returning by value instead. */ diff --git a/Examples/test-suite/director_frob.i b/Examples/test-suite/director_frob.i index 85916a33e..d8dde7d8e 100644 --- a/Examples/test-suite/director_frob.i +++ b/Examples/test-suite/director_frob.i @@ -1,5 +1,5 @@ %module(directors="1") director_frob; -#pragma SWIG nowarn=470,473 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR %header %{ #include diff --git a/Examples/test-suite/director_nested.i b/Examples/test-suite/director_nested.i index 1ad23bbcc..c4dfc328c 100644 --- a/Examples/test-suite/director_nested.i +++ b/Examples/test-suite/director_nested.i @@ -1,5 +1,5 @@ %module(directors="1",dirprot="1") director_nested -#pragma SWIG nowarn=470,473 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR %{ #include diff --git a/Examples/test-suite/director_string.i b/Examples/test-suite/director_string.i index 68392a2db..aeba2f240 100644 --- a/Examples/test-suite/director_string.i +++ b/Examples/test-suite/director_string.i @@ -7,7 +7,7 @@ %include std_string.i // Using thread unsafe wrapping -%warnfilter(470,473) A; +%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) A; %{ #include diff --git a/Examples/test-suite/director_wombat.i b/Examples/test-suite/director_wombat.i index 34ba98ee8..ab798ba09 100644 --- a/Examples/test-suite/director_wombat.i +++ b/Examples/test-suite/director_wombat.i @@ -1,5 +1,5 @@ %module(directors="1") director_wombat -#pragma SWIG nowarn=470,473 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR %feature(director) Bar; %feature(director) Foo; diff --git a/Examples/test-suite/director_wstring.i b/Examples/test-suite/director_wstring.i index 868d5ce25..5e137ac18 100644 --- a/Examples/test-suite/director_wstring.i +++ b/Examples/test-suite/director_wstring.i @@ -7,7 +7,7 @@ %include std_wstring.i // Using thread unsafe wrapping -%warnfilter(470,473) A; +%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) A; %{ #include diff --git a/Examples/test-suite/disown.i b/Examples/test-suite/disown.i index b7fbb67bc..8b3aeb0ec 100644 --- a/Examples/test-suite/disown.i +++ b/Examples/test-suite/disown.i @@ -4,7 +4,7 @@ #include %} -#pragma SWIG nowarn=453 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_APPLY_UNDEF %apply SWIGTYPE *DISOWN { A *disown }; diff --git a/Examples/test-suite/enum_plus.i b/Examples/test-suite/enum_plus.i index fcee58d96..74cc7fa27 100644 --- a/Examples/test-suite/enum_plus.i +++ b/Examples/test-suite/enum_plus.i @@ -1,6 +1,6 @@ %module enum_plus -%warnfilter(801) iFoo; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) iFoo; /* Ruby, wrong constant name */ %inline %{ struct iFoo diff --git a/Examples/test-suite/enum_template.i b/Examples/test-suite/enum_template.i index 937915cee..b84c43d14 100644 --- a/Examples/test-suite/enum_template.i +++ b/Examples/test-suite/enum_template.i @@ -1,8 +1,8 @@ %module enum_template -%warnfilter(801) eTest0; /* Ruby, wrong class name */ -%warnfilter(801) eTest1; /* Ruby, wrong class name */ -%warnfilter(801) eTest2; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) eTest0; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) eTest1; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) eTest2; /* Ruby, wrong class name */ /* From bug report 992329: diff --git a/Examples/test-suite/enum_thorough.i b/Examples/test-suite/enum_thorough.i index 8046dc814..0e271aa59 100644 --- a/Examples/test-suite/enum_thorough.i +++ b/Examples/test-suite/enum_thorough.i @@ -3,45 +3,45 @@ // Suppress warning messages from the Ruby module for all of the // following... -#pragma SWIG nowarn=314 +#pragma SWIG nowarn=SWIGWARN_PARSE_KEYWORD -%warnfilter(801); -%warnfilter(801) red; -%warnfilter(801) blue; -%warnfilter(801) green; -%warnfilter(801) SpeedClass::slow; -%warnfilter(801) SpeedClass::medium; -%warnfilter(801) SpeedClass::fast; -%warnfilter(801) SpeedClass::lightning; -%warnfilter(801) TemplateClass::einstein; -%warnfilter(801) TemplateClass::galileo; -%warnfilter(801) Name::TClass::faraday; -%warnfilter(801) Name::TClass::bell; -%warnfilter(801) argh; -%warnfilter(801) eek; -%warnfilter(801) OldNameStruct::whizz; -%warnfilter(801) OldNameStruct::kerboom; -%warnfilter(801) OldNameStruct::pop; -%warnfilter(801) OldNameStruct::simple1; -%warnfilter(801) OldNameStruct::singlename1; -%warnfilter(801) OldNameStruct::doublename1; -%warnfilter(801) TreesClass::oak; -%warnfilter(801) TreesClass::fir; -%warnfilter(801) TreesClass::pine; -%warnfilter(801) curly::greasy::HairStruct::blonde; -%warnfilter(801) curly::greasy::HairStruct::ginger; -%warnfilter(801) Obscure::one; -%warnfilter(801) Obscure::onetrail; -%warnfilter(801) Obscure::two; -%warnfilter(801) Obscure::twoagain; -%warnfilter(801) Obscure::twotrail; -%warnfilter(801) Obscure::twotrailagain; -%warnfilter(801) globalinstance1; -%warnfilter(801) globalinstance2; -%warnfilter(801) globalinstance3; -%warnfilter(801) Instances::memberinstance1; -%warnfilter(801) Instances::memberinstance2; -%warnfilter(801) Instances::memberinstance3; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME); +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) red; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) blue; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) green; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) SpeedClass::slow; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) SpeedClass::medium; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) SpeedClass::fast; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) SpeedClass::lightning; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) TemplateClass::einstein; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) TemplateClass::galileo; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Name::TClass::faraday; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Name::TClass::bell; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) argh; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) eek; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) OldNameStruct::whizz; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) OldNameStruct::kerboom; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) OldNameStruct::pop; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) OldNameStruct::simple1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) OldNameStruct::singlename1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) OldNameStruct::doublename1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) TreesClass::oak; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) TreesClass::fir; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) TreesClass::pine; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) curly::greasy::HairStruct::blonde; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) curly::greasy::HairStruct::ginger; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Obscure::one; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Obscure::onetrail; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Obscure::two; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Obscure::twoagain; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Obscure::twotrail; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Obscure::twotrailagain; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) globalinstance1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) globalinstance2; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) globalinstance3; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Instances::memberinstance1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Instances::memberinstance2; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Instances::memberinstance3; %inline %{ diff --git a/Examples/test-suite/enums.i b/Examples/test-suite/enums.i index 65adea386..8136f7f8d 100644 --- a/Examples/test-suite/enums.i +++ b/Examples/test-suite/enums.i @@ -3,11 +3,11 @@ %module "enums" /* Suppress warning messages from the Ruby module for all of the following.. */ -%warnfilter(801) boo; -%warnfilter(801) hoo; -%warnfilter(801) globalinstance1; -%warnfilter(801) globalinstance2; -%warnfilter(801) globalinstance3; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) boo; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hoo; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) globalinstance1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) globalinstance2; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) globalinstance3; %inline %{ diff --git a/Examples/test-suite/evil_diamond.i b/Examples/test-suite/evil_diamond.i index 5001aa761..33353e32e 100644 --- a/Examples/test-suite/evil_diamond.i +++ b/Examples/test-suite/evil_diamond.i @@ -1,9 +1,12 @@ %module(ruby_minherit="1") evil_diamond -%warnfilter(801) foo; // Ruby, wrong class name -%warnfilter(801) bar; // Ruby, wrong class name -%warnfilter(801) baz; // Ruby, wrong class name -%warnfilter(801,813,833,870) spam; // Ruby, wrong class name - C# & Java, Php4 multiple inheritance +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) bar; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME, + SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) spam; // Ruby, wrong class name - C# & Java, Php4 multiple inheritance %inline %{ diff --git a/Examples/test-suite/evil_diamond_ns.i b/Examples/test-suite/evil_diamond_ns.i index f88450cb8..78a764ccc 100644 --- a/Examples/test-suite/evil_diamond_ns.i +++ b/Examples/test-suite/evil_diamond_ns.i @@ -1,9 +1,12 @@ %module(ruby_minherit="1") evil_diamond_ns -%warnfilter(801) Blah::foo; // Ruby, wrong class name -%warnfilter(801) Blah::bar; // Ruby, wrong class name -%warnfilter(801) Blah::baz; // Ruby, wrong class name -%warnfilter(801,813,833,870) Blah::spam; // Ruby, wrong class name - C# & Java, Php4 multiple inheritance +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Blah::foo; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Blah::bar; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Blah::baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME, + SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) Blah::spam; // Ruby, wrong class name - C# & Java, Php4 multiple inheritance %inline %{ namespace Blah { diff --git a/Examples/test-suite/evil_diamond_prop.i b/Examples/test-suite/evil_diamond_prop.i index 82b328bae..e9fc24f4d 100644 --- a/Examples/test-suite/evil_diamond_prop.i +++ b/Examples/test-suite/evil_diamond_prop.i @@ -1,9 +1,12 @@ %module(ruby_minherit="1") evil_diamond_prop -%warnfilter(801) foo; // Ruby, wrong class name -%warnfilter(801) bar; // Ruby, wrong class name -%warnfilter(801) baz; // Ruby, wrong class name -%warnfilter(801,813,833,870) spam; // Ruby, wrong class name - C# & Java, Php4 multiple inheritance +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) bar; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME, + SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) spam; // Ruby, wrong class name - C# & Java, Php4 multiple inheritance %inline %{ diff --git a/Examples/test-suite/extend_default.i b/Examples/test-suite/extend_default.i index dabcca4a1..097b5332e 100644 --- a/Examples/test-suite/extend_default.i +++ b/Examples/test-suite/extend_default.i @@ -2,9 +2,9 @@ %module extend_default -%warnfilter(302) Override::over; -%warnfilter(302) Override::overload; -%warnfilter(302) Override::ride; +%warnfilter(SWIGWARN_PARSE_REDEFINED) Override::over; +%warnfilter(SWIGWARN_PARSE_REDEFINED) Override::overload; +%warnfilter(SWIGWARN_PARSE_REDEFINED) Override::ride; // %extend before the class definition %extend Before { diff --git a/Examples/test-suite/features.i b/Examples/test-suite/features.i index 654739451..2db51ae6b 100644 --- a/Examples/test-suite/features.i +++ b/Examples/test-suite/features.i @@ -1,6 +1,6 @@ %module features -%warnfilter(503,365); +%warnfilter(SWIGWARN_LANG_IDENTIFIER,SWIGWARN_IGNORE_OPERATOR_PLUSEQ); // This testcase checks that %feature is working for templates and non user supplied constructors/destructors and is just generally working diff --git a/Examples/test-suite/friends.i b/Examples/test-suite/friends.i index 93b30028d..e1ed53392 100644 --- a/Examples/test-suite/friends.i +++ b/Examples/test-suite/friends.i @@ -3,7 +3,7 @@ #include %} -%warnfilter(503); +%warnfilter(SWIGWARN_LANG_IDENTIFIER); %inline diff --git a/Examples/test-suite/global_vars.i b/Examples/test-suite/global_vars.i index 006f41b2f..ca387a4b5 100644 --- a/Examples/test-suite/global_vars.i +++ b/Examples/test-suite/global_vars.i @@ -1,6 +1,6 @@ %module global_vars -%warnfilter(454); /* memory leak when setting a ptr/ref variable */ +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */ %include std_string.i diff --git a/Examples/test-suite/imports_a.i b/Examples/test-suite/imports_a.i index 3fc71a12c..562a14888 100644 --- a/Examples/test-suite/imports_a.i +++ b/Examples/test-suite/imports_a.i @@ -5,8 +5,8 @@ %module imports_a -%warnfilter(801) A::MemberEnum; /* Ruby, wrong constant name */ -%warnfilter(801) GlobalEnum; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) A::MemberEnum; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) GlobalEnum; /* Ruby, wrong constant name */ %{ #include "imports_a.h" diff --git a/Examples/test-suite/intermediary_classname.i b/Examples/test-suite/intermediary_classname.i index 1810aabcd..3ea8d4e32 100644 --- a/Examples/test-suite/intermediary_classname.i +++ b/Examples/test-suite/intermediary_classname.i @@ -2,7 +2,7 @@ // This test is to check the intermediary class name can be changed (C# and Java only use intermediary classes at time of writing) %module(directors="1", jniclassname="intermediary_classname", imclassname="intermediary_classname") "intermediary_classname" -%warnfilter(470,473); +%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR); // change the access to the intermediary class for testing purposes %pragma(java) jniclassclassmodifiers="public class"; diff --git a/Examples/test-suite/java_director.i b/Examples/test-suite/java_director.i index 6a62abb8c..3cc0ffbe2 100644 --- a/Examples/test-suite/java_director.i +++ b/Examples/test-suite/java_director.i @@ -2,7 +2,7 @@ * Test Java director typemaps and features */ -%warnfilter(470,473); /* Thread/reentrant unsafe wrapping, consider returning by value instead. */ +%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR); /* Thread/reentrant unsafe wrapping, consider returning by value instead. */ %module(directors="1") java_director diff --git a/Examples/test-suite/kind.i b/Examples/test-suite/kind.i index faaf4c369..1ced522a2 100644 --- a/Examples/test-suite/kind.i +++ b/Examples/test-suite/kind.i @@ -5,10 +5,10 @@ %module kind -%warnfilter(801) foo; /* Ruby, wrong class name */ -%warnfilter(801) bar; /* Ruby, wrong class name */ -%warnfilter(801) uni; /* Ruby, wrong class name */ -%warnfilter(801) test; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) bar; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) uni; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) test; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/li_carrays.i b/Examples/test-suite/li_carrays.i index 1d76a1e4e..be658f9a4 100644 --- a/Examples/test-suite/li_carrays.i +++ b/Examples/test-suite/li_carrays.i @@ -1,6 +1,6 @@ %module li_carrays -%warnfilter(801) doubleArray; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) doubleArray; /* Ruby, wrong class name */ %include "carrays.i" diff --git a/Examples/test-suite/li_cmalloc.i b/Examples/test-suite/li_cmalloc.i index 2aaaf2230..6552230de 100644 --- a/Examples/test-suite/li_cmalloc.i +++ b/Examples/test-suite/li_cmalloc.i @@ -1,8 +1,8 @@ %module li_cmalloc -%warnfilter(801) sizeof_int; /* Ruby, wrong constant name */ -%warnfilter(801) sizeof_double; /* Ruby, wrong constant name */ -%warnfilter(801) sizeof_intp; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) sizeof_int; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) sizeof_double; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) sizeof_intp; /* Ruby, wrong constant name */ %include "cmalloc.i" diff --git a/Examples/test-suite/li_cpointer.i b/Examples/test-suite/li_cpointer.i index 7de78b5b5..c5584ce5a 100644 --- a/Examples/test-suite/li_cpointer.i +++ b/Examples/test-suite/li_cpointer.i @@ -1,6 +1,6 @@ %module li_cpointer -%warnfilter(801) doublep; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) doublep; /* Ruby, wrong class name */ %include "cpointer.i" diff --git a/Examples/test-suite/li_implicit.i b/Examples/test-suite/li_implicit.i index 82d8c43f6..0ce10dd6e 100644 --- a/Examples/test-suite/li_implicit.i +++ b/Examples/test-suite/li_implicit.i @@ -1,5 +1,5 @@ %module("nocastmode") li_implicit -#pragma SWIG nowarn=204 +#pragma SWIG nowarn=SWIGWARN_PP_CPP_WARNING %include implicit.i %inline diff --git a/Examples/test-suite/long_long.i b/Examples/test-suite/long_long.i index edda88870..74dd87a15 100644 --- a/Examples/test-suite/long_long.i +++ b/Examples/test-suite/long_long.i @@ -4,12 +4,12 @@ %module long_long -%warnfilter(801) lconst1; /* Ruby, wrong constant name */ -%warnfilter(801) lconst2; /* Ruby, wrong constant name */ -%warnfilter(801) lconst3; /* Ruby, wrong constant name */ -%warnfilter(801) lconst4; /* Ruby, wrong constant name */ -%warnfilter(801) lconst5; /* Ruby, wrong constant name */ -%warnfilter(801) lconst6; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) lconst1; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) lconst2; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) lconst3; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) lconst4; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) lconst5; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) lconst6; /* Ruby, wrong constant name */ %inline %{ void foo1(long long x) {} diff --git a/Examples/test-suite/mixed_types.i b/Examples/test-suite/mixed_types.i index 1cc8656eb..274cfcf7f 100644 --- a/Examples/test-suite/mixed_types.i +++ b/Examples/test-suite/mixed_types.i @@ -1,7 +1,7 @@ %module mixed_types -%warnfilter(801) hi; /* Ruby, wrong constant name */ -%warnfilter(801) hello; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hi; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hello; /* Ruby, wrong constant name */ %inline { diff --git a/Examples/test-suite/multiple_inheritance.i b/Examples/test-suite/multiple_inheritance.i index af05be0ab..5ff5879e1 100644 --- a/Examples/test-suite/multiple_inheritance.i +++ b/Examples/test-suite/multiple_inheritance.i @@ -3,8 +3,13 @@ It tests basic multiple inheritance */ %module(ruby_minherit="1") multiple_inheritance -%warnfilter(813,833,870) FooBar; /* C#, Java, Php4 multiple inheritance */ -%warnfilter(813,833,870) FooBarSpam; /* C#, Java, Php4 multiple inheritance */ +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) FooBar; /* C#, Java, Php4 multiple inheritance */ + +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) FooBarSpam; /* C#, Java, Php4 multiple inheritance */ %inline %{ diff --git a/Examples/test-suite/name.i b/Examples/test-suite/name.i index 6b3a425c7..70e80dcd3 100644 --- a/Examples/test-suite/name.i +++ b/Examples/test-suite/name.i @@ -4,7 +4,7 @@ %module name -#pragma SWIG nowarn=121 // %name is deprecated. Use %rename instead. +#pragma SWIG nowarn=SWIGWARN_DEPRECATED_NAME // %name is deprecated. Use %rename instead. #ifdef SWIGGUILE %rename foo_1 "foo-2"; diff --git a/Examples/test-suite/name_cxx.i b/Examples/test-suite/name_cxx.i index b7bdbf2de..64d79c308 100644 --- a/Examples/test-suite/name_cxx.i +++ b/Examples/test-suite/name_cxx.i @@ -4,7 +4,7 @@ %module name_cxx -#pragma SWIG nowarn=121 // %name is deprecated. Use %rename instead. +#pragma SWIG nowarn=SWIGWARN_DEPRECATED_NAME // %name is deprecated. Use %rename instead. %name("bar_int") %inline %{ diff --git a/Examples/test-suite/name_warnings.i b/Examples/test-suite/name_warnings.i index 01fb6062f..85452eaf2 100644 --- a/Examples/test-suite/name_warnings.i +++ b/Examples/test-suite/name_warnings.i @@ -10,7 +10,7 @@ */ /* activate all the name warnings */ -%warnfilter(+314,+321,-403); +%warnfilter(+SWIGWARN_PARSE_KEYWORD,+SWIGWARN_PARSE_BUILTIN_NAME,-SWIGWARN_TYPE_ABSTRACT); %{ #ifdef max diff --git a/Examples/test-suite/namespace_class.i b/Examples/test-suite/namespace_class.i index 91f6f71ca..ccec6de08 100644 --- a/Examples/test-suite/namespace_class.i +++ b/Examples/test-suite/namespace_class.i @@ -210,7 +210,7 @@ namespace a %} -#pragma SWIG nowarn=312 +#pragma SWIG nowarn=SWIGWARN_PARSE_NESTED_CLASS %inline %{ class Ala { diff --git a/Examples/test-suite/namespace_extend.i b/Examples/test-suite/namespace_extend.i index 52ec0fb57..3c414d1af 100644 --- a/Examples/test-suite/namespace_extend.i +++ b/Examples/test-suite/namespace_extend.i @@ -1,6 +1,6 @@ %module namespace_extend -%warnfilter(801) bar; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) bar; /* Ruby, wrong class name */ %{ namespace foo { diff --git a/Examples/test-suite/namespace_nested.i b/Examples/test-suite/namespace_nested.i index 440c873ba..349d14f22 100644 --- a/Examples/test-suite/namespace_nested.i +++ b/Examples/test-suite/namespace_nested.i @@ -1,7 +1,7 @@ %module namespace_nested -%warnfilter(801) hello::hi::hi0; /* Ruby, wrong class name */ -%warnfilter(801) oss::hi1; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hello::hi::hi0; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::hi1; /* Ruby, wrong class name */ %inline %{ namespace hello diff --git a/Examples/test-suite/namespace_template.i b/Examples/test-suite/namespace_template.i index b707b0bc7..a36abb19b 100644 --- a/Examples/test-suite/namespace_template.i +++ b/Examples/test-suite/namespace_template.i @@ -2,10 +2,10 @@ %module namespace_template -%warnfilter(801) vector; /* Ruby, wrong class name */ -%warnfilter(801) test2::vector; /* Ruby, wrong class name */ -%warnfilter(801) test3::vector; /* Ruby, wrong class name */ -%warnfilter(801) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) test2::vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) test3::vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ %{ #ifdef max diff --git a/Examples/test-suite/operator_overload.i b/Examples/test-suite/operator_overload.i index a1d8d2386..901197dcc 100644 --- a/Examples/test-suite/operator_overload.i +++ b/Examples/test-suite/operator_overload.i @@ -7,7 +7,10 @@ see bottom for a set of possible tests %module operator_overload #if defined(SWIGPYTHON) -%warnfilter(362,389,383,384); +%warnfilter(SWIGWARN_IGNORE_OPERATOR_EQ, + SWIGWARN_IGNORE_OPERATOR_INDEX, + SWIGWARN_IGNORE_OPERATOR_PLUSPLUS, + SWIGWARN_IGNORE_OPERATOR_MINUSMINUS); #endif #if !defined(SWIGLUA) || !defined(SWIGPERL) @@ -87,10 +90,7 @@ public: friend Op operator/(const Op& a,const Op& b){return Op(a.i/b.i);} friend Op operator%(const Op& a,const Op& b){return Op(a.i%b.i);} - // unary operators - Op operator++() {i++; return *this;} - Op operator--() {i--; return *this;} Op operator-() const {return Op(-i);} bool operator !() const {return !(i);} @@ -108,17 +108,13 @@ public: int operator()(int a=0){return i+a;} int operator()(int a,int b){return i+a+b;} -<<<<<<< operator_overload.i - // TODO: <<,<<= -======= // increment/decrement operators Op& operator++(){++i; return *this;} // prefix ++ - Op& operator++(int){i++; return *this;} // postfix ++ + Op operator++(int){return Op(i++);} // postfix ++ Op& operator--(){--i; return *this;} // prefix -- - Op& operator--(int){i--; return *this;} // postfix -- + Op operator--(int){return Op(i++);} // postfix -- // TODO: <<,<<= ->>>>>>> 1.6 }; // just to complicate matters diff --git a/Examples/test-suite/overload_extend.i b/Examples/test-suite/overload_extend.i index e39f293c2..70225c847 100644 --- a/Examples/test-suite/overload_extend.i +++ b/Examples/test-suite/overload_extend.i @@ -4,7 +4,7 @@ %typemap(default) double y "$1=1000;"; #endif -%warnfilter(302) Foo::test; +%warnfilter(SWIGWARN_PARSE_REDEFINED) Foo::test; diff --git a/Examples/test-suite/pointer_reference.i b/Examples/test-suite/pointer_reference.i index 1cc7a0bb5..b7c605429 100644 --- a/Examples/test-suite/pointer_reference.i +++ b/Examples/test-suite/pointer_reference.i @@ -6,7 +6,7 @@ %module pointer_reference -%warnfilter(454); /* memory leak when setting a ptr/ref variable */ +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */ #ifdef SWIGGUILE /* A silly testing typemap for feeding a doubly indirect integer */ diff --git a/Examples/test-suite/preproc.i b/Examples/test-suite/preproc.i index a1a88dcee..08e81da6f 100644 --- a/Examples/test-suite/preproc.i +++ b/Examples/test-suite/preproc.i @@ -1,11 +1,11 @@ %module preproc -%warnfilter(801) one; /* Ruby, wrong constant name */ -%warnfilter(801) two; /* Ruby, wrong constant name */ -%warnfilter(801) three; /* Ruby, wrong constant name */ -%warnfilter(801) __GMP_HAVE_CONST; /* Ruby, wrong constant name */ -%warnfilter(801) __GMP_HAVE_PROTOTYPES; /* Ruby, wrong constant name */ -%warnfilter(801) __GMP_HAVE_TOKEN_PASTE; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) one; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) two; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) three; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) __GMP_HAVE_CONST; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) __GMP_HAVE_PROTOTYPES; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) __GMP_HAVE_TOKEN_PASTE; /* Ruby, wrong constant name */ /* check __cplusplus case */ %header @@ -103,10 +103,10 @@ int f(int min); // preproc_5 -%warnfilter(801) a5; // Ruby, wrong constant name -%warnfilter(801) b5; // Ruby, wrong constant name -%warnfilter(801) c5; // Ruby, wrong constant name -%warnfilter(801) d5; // Ruby, wrong constant name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) a5; // Ruby, wrong constant name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) b5; // Ruby, wrong constant name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) c5; // Ruby, wrong constant name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) d5; // Ruby, wrong constant name // Various preprocessor bits of nastiness. @@ -150,10 +150,10 @@ NAME 42 // preproc_6 -%warnfilter(801) a6; /* Ruby, wrong constant name */ -%warnfilter(801) b6; /* Ruby, wrong constant name */ -%warnfilter(801) c6; /* Ruby, wrong constant name */ -%warnfilter(801) d6; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) a6; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) b6; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) c6; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) d6; /* Ruby, wrong constant name */ #define add(a, b) (a + b) #define times(a, b) (a * b) @@ -279,7 +279,7 @@ inline const char* mangle ## #@__VA_ARGS__ () { #ifdef SWIGCHICKEN /* define is a scheme keyword (and thus an invalid variable name), so SWIG warns about it */ -%warnfilter(314) define; +%warnfilter(SWIGWARN_PARSE_KEYWORD) define; #endif #ifdef SWIGRUBY diff --git a/Examples/test-suite/primitive_types.i b/Examples/test-suite/primitive_types.i index 9a549bf31..25d44078f 100644 --- a/Examples/test-suite/primitive_types.i +++ b/Examples/test-suite/primitive_types.i @@ -2,10 +2,10 @@ %module(directors="1") primitive_types // Ruby constant names -#pragma SWIG nowarn=801 +#pragma SWIG nowarn=SWIGWARN_RUBY_WRONG_NAME // Using thread unsafe wrapping -#pragma SWIG nowarn=470,473 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR /* if your language has problems with MyInt* and/or Hello*, @@ -87,9 +87,7 @@ // Try your language module with and without // these nowarn flags. // -%warnfilter(451); -//%warnfilter(515); -//%warnfilter(509); +%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK); %{ #include diff --git a/Examples/test-suite/private_assign.i b/Examples/test-suite/private_assign.i index 72fc7c205..ce1258e16 100644 --- a/Examples/test-suite/private_assign.i +++ b/Examples/test-suite/private_assign.i @@ -24,7 +24,7 @@ %} -#pragma SWIG nowarn=350 // operator new +#pragma SWIG nowarn=SWIGWARN_IGNORE_OPERATOR_NEW // operator new %inline %{ class TROOT { diff --git a/Examples/test-suite/pure_virtual.i b/Examples/test-suite/pure_virtual.i index aae0a436a..b41e48a89 100644 --- a/Examples/test-suite/pure_virtual.i +++ b/Examples/test-suite/pure_virtual.i @@ -7,7 +7,9 @@ %module(ruby_minherit="1") pure_virtual -%warnfilter(813,833,870) E; /* C#, Java, Php4 multiple inheritance */ +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) E; /* C#, Java, Php4 multiple inheritance */ %nodefaultctor C; %nodefaultdtor C; diff --git a/Examples/test-suite/python/director_stl.i b/Examples/test-suite/python/director_stl.i index 429e13304..cbcb4ba85 100644 --- a/Examples/test-suite/python/director_stl.i +++ b/Examples/test-suite/python/director_stl.i @@ -1,5 +1,5 @@ %module(directors="1") director_stl -#pragma SWIG nowarn=470,473 +#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR %include "std_string.i" %include "std_pair.i" diff --git a/Examples/test-suite/python/vector.i b/Examples/test-suite/python/vector.i index 46d0ab50d..04c961cda 100644 --- a/Examples/test-suite/python/vector.i +++ b/Examples/test-suite/python/vector.i @@ -43,7 +43,7 @@ typedef float Real; #if 1 //fails namespace std { - %template(RealVector) vector; + %template(RealVector) vector; } #else //works diff --git a/Examples/test-suite/redefined.i b/Examples/test-suite/redefined.i index a97de66e0..3022ee9cc 100644 --- a/Examples/test-suite/redefined.i +++ b/Examples/test-suite/redefined.i @@ -1,9 +1,9 @@ %module redefined -%warnfilter(801) agua; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) agua; /* no redundant warnings */ -%warnfilter(322); +%warnfilter(SWIGWARN_PARSE_REDUNDANT); #if 1 // diff --git a/Examples/test-suite/reference_global_vars.i b/Examples/test-suite/reference_global_vars.i index c6ca7cdbb..8c806599b 100644 --- a/Examples/test-suite/reference_global_vars.i +++ b/Examples/test-suite/reference_global_vars.i @@ -4,7 +4,7 @@ %module reference_global_vars -%warnfilter(454); /* memory leak when setting a ptr/ref variable */ +%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */ %inline %{ class TestClass { diff --git a/Examples/test-suite/ret_by_value.i b/Examples/test-suite/ret_by_value.i index 273336e00..c69ade3d6 100644 --- a/Examples/test-suite/ret_by_value.i +++ b/Examples/test-suite/ret_by_value.i @@ -2,7 +2,7 @@ %module ret_by_value -%warnfilter(801) test; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) test; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/smart_pointer_extend.i b/Examples/test-suite/smart_pointer_extend.i index 583dd3952..a4b07f807 100644 --- a/Examples/test-suite/smart_pointer_extend.i +++ b/Examples/test-suite/smart_pointer_extend.i @@ -1,6 +1,6 @@ %module smart_pointer_extend -%warnfilter(801) hi::CBase::z; /* Ruby, wrong const name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hi::CBase::z; /* Ruby, wrong const name */ %inline %{ namespace hi diff --git a/Examples/test-suite/static_const_member_2.i b/Examples/test-suite/static_const_member_2.i index 39d005ae0..0b6d38d21 100644 --- a/Examples/test-suite/static_const_member_2.i +++ b/Examples/test-suite/static_const_member_2.i @@ -1,8 +1,8 @@ %module static_const_member_2 -%warnfilter(801) oss::modules::CavityPackFlags::forward_field; -%warnfilter(801) oss::modules::CavityPackFlags::backward_field; -%warnfilter(801) oss::modules::Test::current_profile; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::modules::CavityPackFlags::forward_field; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::modules::CavityPackFlags::backward_field; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::modules::Test::current_profile; %inline %{ namespace oss diff --git a/Examples/test-suite/template.i b/Examples/test-suite/template.i index 9e79b3e86..d2c7a91ed 100644 --- a/Examples/test-suite/template.i +++ b/Examples/test-suite/template.i @@ -1,9 +1,9 @@ /* File : example.i */ %module "template" -%warnfilter(801) vector; /* Ruby, wrong class name */ -%warnfilter(801) vector; /* Ruby, wrong class name */ -%warnfilter(801) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ /* Let's just grab the original header file here */ diff --git a/Examples/test-suite/template_arg_replace.i b/Examples/test-suite/template_arg_replace.i index 536315ce3..4e69fa351 100644 --- a/Examples/test-suite/template_arg_replace.i +++ b/Examples/test-suite/template_arg_replace.i @@ -1,6 +1,6 @@ %module template_arg_replace -%warnfilter(801) Matrix; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Matrix; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/template_base_template.i b/Examples/test-suite/template_base_template.i index 1191764cc..d3e7759ac 100644 --- a/Examples/test-suite/template_base_template.i +++ b/Examples/test-suite/template_base_template.i @@ -1,8 +1,8 @@ %module template_base_template -%warnfilter(801) traits; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) traits; /* Ruby, wrong class name */ -%warnfilter(320); +%warnfilter(SWIGWARN_PARSE_EXPLICIT_TEMPLATE); %inline %{ template diff --git a/Examples/test-suite/template_default.i b/Examples/test-suite/template_default.i index 66236bb33..2f6ffd5ba 100644 --- a/Examples/test-suite/template_default.i +++ b/Examples/test-suite/template_default.i @@ -2,7 +2,7 @@ -%warnfilter(801) ns1::Traits::c; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) ns1::Traits::c; /* Ruby, wrong constant name */ namespace ns1 { namespace ns2 { diff --git a/Examples/test-suite/template_default2.i b/Examples/test-suite/template_default2.i index 0bcd47652..1e0b6240d 100644 --- a/Examples/test-suite/template_default2.i +++ b/Examples/test-suite/template_default2.i @@ -1,6 +1,6 @@ %module template_default2 -%warnfilter(801) oss::traits; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::traits; // Ruby, wrong class name %inline %{ namespace oss diff --git a/Examples/test-suite/template_default_arg.i b/Examples/test-suite/template_default_arg.i index bbce89451..54ff262b8 100644 --- a/Examples/test-suite/template_default_arg.i +++ b/Examples/test-suite/template_default_arg.i @@ -1,6 +1,6 @@ %module template_default_arg -%warnfilter(801) Hello; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Hello; /* Ruby, wrong class name */ %inline %{ template diff --git a/Examples/test-suite/template_default_inherit.i b/Examples/test-suite/template_default_inherit.i index 51c381db7..d8d34d858 100644 --- a/Examples/test-suite/template_default_inherit.i +++ b/Examples/test-suite/template_default_inherit.i @@ -1,6 +1,6 @@ %module template_default_inherit -%warnfilter(801) A::nindex; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) A::nindex; /* Ruby, wrong constant name */ %inline %{ template diff --git a/Examples/test-suite/template_default_qualify.i b/Examples/test-suite/template_default_qualify.i index 7a411d130..bcba1a44e 100644 --- a/Examples/test-suite/template_default_qualify.i +++ b/Examples/test-suite/template_default_qualify.i @@ -3,7 +3,7 @@ %module template_default_qualify -%warnfilter(801) etraits; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) etraits; /* Ruby, wrong class name */ %inline %{ namespace oss diff --git a/Examples/test-suite/template_enum.i b/Examples/test-suite/template_enum.i index 9f6eeeb6f..46a92facd 100644 --- a/Examples/test-suite/template_enum.i +++ b/Examples/test-suite/template_enum.i @@ -1,7 +1,7 @@ %module template_enum -%warnfilter(801) foo; /* Ruby, wrong class name */ -%warnfilter(801) foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ %inline %{ template class foo { diff --git a/Examples/test-suite/template_enum_typedef.i b/Examples/test-suite/template_enum_typedef.i index f1c15f182..9752d0858 100644 --- a/Examples/test-suite/template_enum_typedef.i +++ b/Examples/test-suite/template_enum_typedef.i @@ -1,6 +1,6 @@ %module template_enum_typedef -%warnfilter(801) oss::etraits; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::etraits; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/template_explicit.i b/Examples/test-suite/template_explicit.i index bcd8d8126..ede854a27 100644 --- a/Examples/test-suite/template_explicit.i +++ b/Examples/test-suite/template_explicit.i @@ -1,13 +1,13 @@ /* File : example.i */ %module "template_explicit" -%warnfilter(801) vector; /* Ruby, wrong class name */ -%warnfilter(801) vector; /* Ruby, wrong class name */ -%warnfilter(801) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ // #pragma is used for warnings that are not associated to // specific nodes. -#pragma SWIG nowarn=-320 +#pragma SWIG nowarn=-SWIGWARN_PARSE_EXPLICIT_TEMPLATE /* Let's just grab the original header file here */ diff --git a/Examples/test-suite/template_extend1.i b/Examples/test-suite/template_extend1.i index e6a8673a8..34e4f5cec 100644 --- a/Examples/test-suite/template_extend1.i +++ b/Examples/test-suite/template_extend1.i @@ -2,8 +2,8 @@ %module template_extend1 -%warnfilter(801) Baz; // Ruby, wrong class name -%warnfilter(801) Baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Baz; // Ruby, wrong class name %{ namespace Quux { diff --git a/Examples/test-suite/template_extend2.i b/Examples/test-suite/template_extend2.i index 396223e25..b0ac6c902 100644 --- a/Examples/test-suite/template_extend2.i +++ b/Examples/test-suite/template_extend2.i @@ -1,8 +1,8 @@ // Another evil Luigi test %module template_extend2 -%warnfilter(801) Baz; // Ruby, wrong class name -%warnfilter(801) Baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Baz; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Baz; // Ruby, wrong class name %{ namespace Quux { diff --git a/Examples/test-suite/template_inherit_abstract.i b/Examples/test-suite/template_inherit_abstract.i index 4382e6437..f676b3b3e 100644 --- a/Examples/test-suite/template_inherit_abstract.i +++ b/Examples/test-suite/template_inherit_abstract.i @@ -1,7 +1,10 @@ %module(ruby_minherit="1") template_inherit_abstract -%warnfilter(801) oss::test; /* Ruby, wrong class name */ -%warnfilter(813,833,870) oss::Module; /* C#, Java, Php4 multiple inheritance */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::test; /* Ruby, wrong class name */ + +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) oss::Module; /* C#, Java, Php4 multiple inheritance */ %inline %{ diff --git a/Examples/test-suite/template_int_const.i b/Examples/test-suite/template_int_const.i index 7b9eea5f8..37b1cf998 100644 --- a/Examples/test-suite/template_int_const.i +++ b/Examples/test-suite/template_int_const.i @@ -1,7 +1,7 @@ %module template_int_const -%warnfilter(801) interface_traits; /* Ruby, wrong class name */ -%warnfilter(801) module_traits; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) interface_traits; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) module_traits; /* Ruby, wrong class name */ %inline %{ enum Polarization { UnaryPolarization, BinaryPolarization }; diff --git a/Examples/test-suite/template_ns.i b/Examples/test-suite/template_ns.i index bd0bf643f..77dfcd194 100644 --- a/Examples/test-suite/template_ns.i +++ b/Examples/test-suite/template_ns.i @@ -3,8 +3,8 @@ %module template_ns -%warnfilter(801) std::my_pair; /* Ruby, wrong class name */ -%warnfilter(801) std::my_pair; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::my_pair; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::my_pair; /* Ruby, wrong class name */ %ignore std::my_pair::my_pair(); diff --git a/Examples/test-suite/template_ns3.i b/Examples/test-suite/template_ns3.i index 0cc08b551..8df02806d 100644 --- a/Examples/test-suite/template_ns3.i +++ b/Examples/test-suite/template_ns3.i @@ -1,6 +1,6 @@ %module template_ns3 -%warnfilter(801) foo::bar; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo::bar; /* Ruby, wrong class name */ %inline %{ namespace foo { diff --git a/Examples/test-suite/template_rename.i b/Examples/test-suite/template_rename.i index 8d3574e81..f76f103af 100644 --- a/Examples/test-suite/template_rename.i +++ b/Examples/test-suite/template_rename.i @@ -1,7 +1,7 @@ %module template_rename -%warnfilter(801) Foo; /* Ruby, wrong class name */ -%warnfilter(801) Foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Foo; /* Ruby, wrong class name */ %rename(blah_test) Foo::blah(int); %rename(spam_test) Foo::spam(int); diff --git a/Examples/test-suite/template_specialization_enum.i b/Examples/test-suite/template_specialization_enum.i index ccebf3af5..5fc51fbe0 100644 --- a/Examples/test-suite/template_specialization_enum.i +++ b/Examples/test-suite/template_specialization_enum.i @@ -1,7 +1,7 @@ %module template_specialization_enum -%warnfilter(801) Hello; /* Ruby, wrong class name */ -%warnfilter(801) Hi; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Hello; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Hi; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/template_static.i b/Examples/test-suite/template_static.i index e4696143d..8f0f9825a 100644 --- a/Examples/test-suite/template_static.i +++ b/Examples/test-suite/template_static.i @@ -1,7 +1,7 @@ %module template_static -%warnfilter(801) foo; /* Ruby, wrong class name */ -%warnfilter(801) foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ %inline %{ template class foo { diff --git a/Examples/test-suite/template_tbase_template.i b/Examples/test-suite/template_tbase_template.i index 3cbdd0949..18b1b3924 100644 --- a/Examples/test-suite/template_tbase_template.i +++ b/Examples/test-suite/template_tbase_template.i @@ -1,8 +1,8 @@ %module template_tbase_template -%warnfilter(801) traits; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) traits; /* Ruby, wrong class name */ -%warnfilter(320); +%warnfilter(SWIGWARN_PARSE_EXPLICIT_TEMPLATE); %inline %{ typedef double Double; diff --git a/Examples/test-suite/template_type_namespace.i b/Examples/test-suite/template_type_namespace.i index 719647361..ec94cd04d 100644 --- a/Examples/test-suite/template_type_namespace.i +++ b/Examples/test-suite/template_type_namespace.i @@ -1,6 +1,6 @@ %module template_type_namespace -%warnfilter(801) std::vector; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::vector; // Ruby, wrong class name %include std_string.i %include std_vector.i diff --git a/Examples/test-suite/template_typedef_ptr.i b/Examples/test-suite/template_typedef_ptr.i index b625d5600..9f9a29a55 100644 --- a/Examples/test-suite/template_typedef_ptr.i +++ b/Examples/test-suite/template_typedef_ptr.i @@ -1,6 +1,6 @@ %module("templatereduce") template_typedef_ptr -%warnfilter(801) Test; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Test; /* Ruby, wrong constant name */ /* Use the "templatereduce" feature to force swig to reduce the template diff --git a/Examples/test-suite/throw_exception.i b/Examples/test-suite/throw_exception.i index 8d7a43422..066a951f1 100644 --- a/Examples/test-suite/throw_exception.i +++ b/Examples/test-suite/throw_exception.i @@ -1,7 +1,7 @@ %module throw_exception -%warnfilter(801) Namespace::enum1; -%warnfilter(801) Namespace::enum2; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Namespace::enum1; +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Namespace::enum2; // Tests SWIG's automatic exception mechanism diff --git a/Examples/test-suite/typedef_funcptr.i b/Examples/test-suite/typedef_funcptr.i index 8bb27496d..f8cdd14b3 100644 --- a/Examples/test-suite/typedef_funcptr.i +++ b/Examples/test-suite/typedef_funcptr.i @@ -2,8 +2,8 @@ %module typedef_funcptr -%warnfilter(801) addf; /* Ruby, wrong constant name */ -%warnfilter(801) subf; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) addf; /* Ruby, wrong constant name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) subf; /* Ruby, wrong constant name */ %{ int addf(int x, int y) { diff --git a/Examples/test-suite/typemap_ns_using.i b/Examples/test-suite/typemap_ns_using.i index 6f3357016..72f5c1981 100644 --- a/Examples/test-suite/typemap_ns_using.i +++ b/Examples/test-suite/typemap_ns_using.i @@ -1,6 +1,6 @@ %module typemap_ns_using -%warnfilter(801) X::_FooImpl; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) X::_FooImpl; /* Ruby, wrong class name */ %inline %{ namespace X { diff --git a/Examples/test-suite/typemap_subst.i b/Examples/test-suite/typemap_subst.i index 6288393d5..e4d3c9330 100644 --- a/Examples/test-suite/typemap_subst.i +++ b/Examples/test-suite/typemap_subst.i @@ -3,7 +3,7 @@ %module typemap_subst -%warnfilter(801) xyzzy; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) xyzzy; /* Ruby, wrong class name */ %inline %{ struct xyzzy { diff --git a/Examples/test-suite/union_scope.i b/Examples/test-suite/union_scope.i index b58585c2a..67093eff6 100644 --- a/Examples/test-suite/union_scope.i +++ b/Examples/test-suite/union_scope.i @@ -1,7 +1,7 @@ %module union_scope -%warnfilter(801) nRState; // Ruby, wrong class name -%warnfilter(801) nRState_rstate; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) nRState; // Ruby, wrong class name +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) nRState_rstate; // Ruby, wrong class name %inline %{ class nRState { diff --git a/Examples/test-suite/using1.i b/Examples/test-suite/using1.i index cd1fe8aac..2e336faab 100644 --- a/Examples/test-suite/using1.i +++ b/Examples/test-suite/using1.i @@ -1,6 +1,6 @@ %module using1 -%warnfilter(801) X::_FooImpl; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) X::_FooImpl; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/using2.i b/Examples/test-suite/using2.i index 8542719a1..1f3dc46f5 100644 --- a/Examples/test-suite/using2.i +++ b/Examples/test-suite/using2.i @@ -1,10 +1,10 @@ %module using2 -%warnfilter(315); +%warnfilter(SWIGWARN_PARSE_USING_UNDEF); using ::baz; -%warnfilter(801) X::_FooImpl; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) X::_FooImpl; /* Ruby, wrong class name */ %inline %{ diff --git a/Examples/test-suite/using_composition.i b/Examples/test-suite/using_composition.i index f48ffcce8..b3e78ae38 100644 --- a/Examples/test-suite/using_composition.i +++ b/Examples/test-suite/using_composition.i @@ -1,6 +1,8 @@ %module(ruby_minherit="1") using_composition -%warnfilter(813,833,870) FooBar; // C#, Java, Php4 multiple inheritance +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) FooBar; // C#, Java, Php4 multiple inheritance %inline %{ class Foo { diff --git a/Examples/test-suite/using_extend.i b/Examples/test-suite/using_extend.i index ebb211254..21a4c39d5 100644 --- a/Examples/test-suite/using_extend.i +++ b/Examples/test-suite/using_extend.i @@ -1,6 +1,8 @@ %module(ruby_minherit="1") using_extend -%warnfilter(813,833,870) FooBar; // C#, Java, Php4 multiple inheritance +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) FooBar; // C#, Java, Php4 multiple inheritance %extend Foo { int blah(int x, int y) { diff --git a/Examples/test-suite/using_namespace.i b/Examples/test-suite/using_namespace.i index abeb555f4..a4c35274a 100644 --- a/Examples/test-suite/using_namespace.i +++ b/Examples/test-suite/using_namespace.i @@ -1,9 +1,11 @@ %module(ruby_minherit="1") using_namespace -%warnfilter(801) hi::hi0; /* Ruby, wrong class name */ -%warnfilter(801) hi::hi1; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hi::hi0; /* Ruby, wrong class name */ +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) hi::hi1; /* Ruby, wrong class name */ -%warnfilter(813,833,870) Hi; // C#, Java, Php4 multiple inheritance +%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE, + SWIGWARN_CSHARP_MULTIPLE_INHERITANCE, + SWIGWARN_PHP4_MULTIPLE_INHERITANCE) Hi; // C#, Java, Php4 multiple inheritance %inline %{ namespace hello diff --git a/Examples/test-suite/virtual_poly.i b/Examples/test-suite/virtual_poly.i index feaba0d37..c337421e8 100644 --- a/Examples/test-suite/virtual_poly.i +++ b/Examples/test-suite/virtual_poly.i @@ -1,11 +1,11 @@ %module(directors="1") virtual_poly -%warnfilter(822, 842) copy; /* Java, C# covariant return types */ -%warnfilter(822, 842) ref_this; /* Java, C# covariant return types */ -%warnfilter(822, 842) covariant; /* Java, C# covariant return types */ -%warnfilter(822, 842) covariant2; /* Java, C# covariant return types */ -%warnfilter(822, 842) covariant3; /* Java, C# covariant return types */ -%warnfilter(822, 842) covariant4; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, SWIGWARN_CSHARP_COVARIANT_RET) copy; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, SWIGWARN_CSHARP_COVARIANT_RET) ref_this; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, SWIGWARN_CSHARP_COVARIANT_RET) covariant; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, SWIGWARN_CSHARP_COVARIANT_RET) covariant2; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, SWIGWARN_CSHARP_COVARIANT_RET) covariant3; /* Java, C# covariant return types */ +%warnfilter(SWIGWARN_JAVA_COVARIANT_RET, SWIGWARN_CSHARP_COVARIANT_RET) covariant4; /* Java, C# covariant return types */ // // Check this example with directors wherever possible. diff --git a/Lib/java/enums.swg b/Lib/java/enums.swg index e87a5020f..f2f18b65e 100644 --- a/Lib/java/enums.swg +++ b/Lib/java/enums.swg @@ -15,7 +15,7 @@ $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const enum SWIGTYPE & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1_name;" diff --git a/Lib/java/enumsimple.swg b/Lib/java/enumsimple.swg index 3c58966b5..9303e6988 100644 --- a/Lib/java/enumsimple.swg +++ b/Lib/java/enumsimple.swg @@ -15,7 +15,7 @@ $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const enum SWIGTYPE & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1_name;" diff --git a/Lib/java/enumtypesafe.swg b/Lib/java/enumtypesafe.swg index 255928cda..41e987778 100644 --- a/Lib/java/enumtypesafe.swg +++ b/Lib/java/enumtypesafe.swg @@ -14,7 +14,7 @@ $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const enum SWIGTYPE & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1_name;" diff --git a/Lib/java/enumtypeunsafe.swg b/Lib/java/enumtypeunsafe.swg index ca7cba696..ee359cfb3 100644 --- a/Lib/java/enumtypeunsafe.swg +++ b/Lib/java/enumtypeunsafe.swg @@ -15,7 +15,7 @@ $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const enum SWIGTYPE & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1_name;" diff --git a/Lib/java/java.swg b/Lib/java/java.swg index 4f4f86d60..78121f001 100644 --- a/Lib/java/java.swg +++ b/Lib/java/java.swg @@ -390,7 +390,7 @@ %{ temp = $input ? true : false; $1 = &temp; %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const bool & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & %{ static $*1_ltype temp; temp = $input ? true : false; $1 = &temp; %} @@ -413,7 +413,7 @@ %{ temp = ($*1_ltype)$input; $1 = &temp; %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const char &, +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, const signed char &, const unsigned char &, const short &, @@ -520,7 +520,7 @@ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); } -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const unsigned long long & { +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const unsigned long long & { static $*1_ltype temp; jclass clazz; jmethodID mid; diff --git a/Lib/java/std_string.i b/Lib/java/std_string.i index de70a1efd..086c49348 100644 --- a/Lib/java/std_string.i +++ b/Lib/java/std_string.i @@ -86,7 +86,7 @@ class string; $1 = &$1_str; jenv->ReleaseStringUTFChars($input, $1_pstr); %} -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const string & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & %{if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string"); return $null; diff --git a/Lib/java/std_wstring.i b/Lib/java/std_wstring.i index 5cc03fc5e..f757ff307 100644 --- a/Lib/java/std_wstring.i +++ b/Lib/java/std_wstring.i @@ -90,7 +90,7 @@ class wstring; %typemap(javadirectorin) const wstring & "$jniinput" %typemap(javadirectorout) const wstring & "$javacall" -%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const wstring & +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & %{if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); return $null; diff --git a/Lib/swig.swg b/Lib/swig.swg index a1cc019a5..a2d60dc9c 100644 --- a/Lib/swig.swg +++ b/Lib/swig.swg @@ -129,13 +129,65 @@ /* Common features */ /* Warnings */ -#define %warnfilter(...) %feature("warnfilter",`__VA_ARGS__`) +#define %_warnfilter(...) %feature("warnfilter",`__VA_ARGS__`) +#define %warnfilter(...) %_warnfilter(__VA_ARGS__) -/* Warnings used in typemaps. Macro names are the same as those in swigwarn.h but prefixed by SWIG_. */ -%define SWIG_WARN_TYPEMAP_CHARLEAK "451:Setting const char * member may leak memory." %enddef -%define SWIG_WARN_TYPEMAP_SWIGTYPELEAK "454:Setting a pointer/reference variable may leak memory." %enddef -%define SWIG_WARN_TYPEMAP_THREAD_UNSAFE "470:Thread/reentrant unsafe wrapping, consider returning by value instead." %enddef -%define SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR "473:Returning a pointer or reference in a director method is not recommended." %enddef + +/* + Include the internal swig macro codes. These macros correspond to + the one found in Source/Include/swigwarn.h plus the 'SWIG'prefix. + + For example, in the include file you will find + + WARN_TYPEMAP_CHARLEAK + + and in the interface you use the code for filters as + + %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK); + +*/ +%include + +/* Warnings messages used in typemaps. Message names will be the same + as those in Lib/swigwarn.swg but with the suffix _MSG. + + For example, for the code SWIGWARN_TYPEMAP_CHARLEAK, once you use + + %warning_msg(SWIGWARN_TYPEMAP_CHARLEAK,); + + you use the message in your typemap as + + %typemap(varin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) char * + + while you suppress the warning using + + %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK); + + as described above. + +*/ + + +/* macros to create warning messages */ +%define %_warning_msg(Def, Val, Msg) +%define Def `Val`":"`Msg` %enddef +%enddef +%define %warning_msg(x,msg) +%_warning_msg(x##_MSG, x, msg) +%enddef + +/* specific warning messages */ +%warning_msg(SWIGWARN_TYPEMAP_CHARLEAK, "Setting const char * member may leak memory.") +%warning_msg(SWIGWARN_TYPEMAP_SWIGTYPELEAK, "Setting a pointer/reference variable may leak memory."); +%warning_msg(SWIGWARN_TYPEMAP_THREAD_UNSAFE, "Thread/reentrant unsafe wrapping, consider returning by value instead."); +%warning_msg(SWIGWARN_TYPEMAP_DIRECTOROUT_PTR, "Returning a pointer or reference in a director method is not recommended."); + + +/* Old warning messages names, for compatibility */ +%define SWIG_WARN_TYPEMAP_CHARLEAK SWIGWARN_TYPEMAP_CHARLEAK_MSG %enddef +%define SWIG_WARN_TYPEMAP_SWIGTYPELEAK SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG %enddef +%define SWIG_WARN_TYPEMAP_THREAD_UNSAFE SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG %enddef +%define SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG %enddef /* Contract support - Experimental and undocumented */ @@ -519,6 +571,8 @@ static int NAME(TYPE x) { %} %enddef + + %insert("runtime") "swiglabels.swg" diff --git a/Lib/swigwarn.swg b/Lib/swigwarn.swg new file mode 100644 index 000000000..08dcf2d3b --- /dev/null +++ b/Lib/swigwarn.swg @@ -0,0 +1,252 @@ +/* Automatically generated file containing all the swig warning codes. */ +/* Do not modify this file by hand, change 'Source/Include/swigwarn.h' */ +/* and use the command 'make Lib/swigwarn.swg' instead. */ + + +/* SWIG warning message numbers + + This file serves as the main registry of warning message numbers. Some of these + numbers are used internally in the C/C++ source code of SWIG. However, some + of the numbers are used in SWIG configuration files (swig.swg and others). + + The numbers are roughly organized into a few different classes by functionality. + + Even though symbolic constants are used in the SWIG source, this is + not always the case in SWIG interface files. Do not change the + numbers in this file. + + */ + + + + + +%define SWIGWARN_NONE 0 %enddef + +/* -- Deprecated features -- */ + +%define SWIGWARN_DEPRECATED_EXTERN 101 %enddef +%define SWIGWARN_DEPRECATED_VAL 102 %enddef +%define SWIGWARN_DEPRECATED_OUT 103 %enddef +%define SWIGWARN_DEPRECATED_DISABLEDOC 104 %enddef +%define SWIGWARN_DEPRECATED_ENABLEDOC 105 %enddef +%define SWIGWARN_DEPRECATED_DOCONLY 106 %enddef +%define SWIGWARN_DEPRECATED_STYLE 107 %enddef +%define SWIGWARN_DEPRECATED_LOCALSTYLE 108 %enddef +%define SWIGWARN_DEPRECATED_TITLE 109 %enddef +%define SWIGWARN_DEPRECATED_SECTION 110 %enddef +%define SWIGWARN_DEPRECATED_SUBSECTION 111 %enddef +%define SWIGWARN_DEPRECATED_SUBSUBSECTION 112 %enddef +%define SWIGWARN_DEPRECATED_ADDMETHODS 113 %enddef +%define SWIGWARN_DEPRECATED_READONLY 114 %enddef +%define SWIGWARN_DEPRECATED_READWRITE 115 %enddef +%define SWIGWARN_DEPRECATED_EXCEPT 116 %enddef +%define SWIGWARN_DEPRECATED_NEW 117 %enddef +%define SWIGWARN_DEPRECATED_EXCEPT_TM 118 %enddef +%define SWIGWARN_DEPRECATED_IGNORE_TM 119 %enddef +%define SWIGWARN_DEPRECATED_OPTC 120 %enddef +%define SWIGWARN_DEPRECATED_NAME 121 %enddef +%define SWIGWARN_DEPRECATED_NOEXTERN 122 %enddef +%define SWIGWARN_DEPRECATED_NODEFAULT 123 %enddef +%define SWIGWARN_DEPRECATED_TYPEMAP_LANG 124 %enddef + +/* -- Preprocessor -- */ + +%define SWIGWARN_PP_MISSING_FILE 201 %enddef +%define SWIGWARN_PP_EVALUATION 202 %enddef +%define SWIGWARN_PP_INCLUDEALL_IMPORTALL 203 %enddef +%define SWIGWARN_PP_CPP_WARNING 204 %enddef +%define SWIGWARN_PP_CPP_ERROR 205 %enddef + +/* -- C/C++ Parser -- */ + +%define SWIGWARN_PARSE_CLASS_KEYWORD 301 %enddef +%define SWIGWARN_PARSE_REDEFINED 302 %enddef +%define SWIGWARN_PARSE_EXTEND_UNDEF 303 %enddef +%define SWIGWARN_PARSE_UNSUPPORTED_VALUE 304 %enddef +%define SWIGWARN_PARSE_BAD_VALUE 305 %enddef +%define SWIGWARN_PARSE_PRIVATE 306 %enddef +%define SWIGWARN_PARSE_BAD_DEFAULT 307 %enddef +%define SWIGWARN_PARSE_NAMESPACE_ALIAS 308 %enddef +%define SWIGWARN_PARSE_PRIVATE_INHERIT 309 %enddef +%define SWIGWARN_PARSE_TEMPLATE_REPEAT 310 %enddef +%define SWIGWARN_PARSE_TEMPLATE_PARTIAL 311 %enddef +%define SWIGWARN_PARSE_NESTED_CLASS 312 %enddef +%define SWIGWARN_PARSE_UNDEFINED_EXTERN 313 %enddef +%define SWIGWARN_PARSE_KEYWORD 314 %enddef +%define SWIGWARN_PARSE_USING_UNDEF 315 %enddef +%define SWIGWARN_PARSE_MODULE_REPEAT 316 %enddef +%define SWIGWARN_PARSE_TEMPLATE_SP_UNDEF 317 %enddef +%define SWIGWARN_PARSE_TEMPLATE_AMBIG 318 %enddef +%define SWIGWARN_PARSE_NO_ACCESS 319 %enddef +%define SWIGWARN_PARSE_EXPLICIT_TEMPLATE 320 %enddef +%define SWIGWARN_PARSE_BUILTIN_NAME 321 %enddef +%define SWIGWARN_PARSE_REDUNDANT 322 %enddef + +%define SWIGWARN_IGNORE_OPERATOR_NEW 350 %enddef /* new */ +%define SWIGWARN_IGNORE_OPERATOR_DELETE 351 %enddef /* delete */ +%define SWIGWARN_IGNORE_OPERATOR_PLUS 352 %enddef /* + */ +%define SWIGWARN_IGNORE_OPERATOR_MINUS 353 %enddef /* - */ +%define SWIGWARN_IGNORE_OPERATOR_MUL 354 %enddef /* * */ +%define SWIGWARN_IGNORE_OPERATOR_DIV 355 %enddef /* / */ +%define SWIGWARN_IGNORE_OPERATOR_MOD 356 %enddef /* % */ +%define SWIGWARN_IGNORE_OPERATOR_XOR 357 %enddef /* ^ */ +%define SWIGWARN_IGNORE_OPERATOR_AND 358 %enddef /* & */ +%define SWIGWARN_IGNORE_OPERATOR_OR 359 %enddef /* | */ +%define SWIGWARN_IGNORE_OPERATOR_NOT 360 %enddef /* ~ */ +%define SWIGWARN_IGNORE_OPERATOR_LNOT 361 %enddef /* ! */ +%define SWIGWARN_IGNORE_OPERATOR_EQ 362 %enddef /* = */ +%define SWIGWARN_IGNORE_OPERATOR_LT 363 %enddef /* < */ +%define SWIGWARN_IGNORE_OPERATOR_GT 364 %enddef /* > */ +%define SWIGWARN_IGNORE_OPERATOR_PLUSEQ 365 %enddef /* += */ +%define SWIGWARN_IGNORE_OPERATOR_MINUSEQ 366 %enddef /* -= */ +%define SWIGWARN_IGNORE_OPERATOR_MULEQ 367 %enddef /* *= */ +%define SWIGWARN_IGNORE_OPERATOR_DIVEQ 368 %enddef /* /= */ +%define SWIGWARN_IGNORE_OPERATOR_MODEQ 369 %enddef /* %= */ +%define SWIGWARN_IGNORE_OPERATOR_XOREQ 370 %enddef /* ^= */ +%define SWIGWARN_IGNORE_OPERATOR_ANDEQ 371 %enddef /* &= */ +%define SWIGWARN_IGNORE_OPERATOR_OREQ 372 %enddef /* |= */ +%define SWIGWARN_IGNORE_OPERATOR_LSHIFT 373 %enddef /* << */ +%define SWIGWARN_IGNORE_OPERATOR_RSHIFT 374 %enddef /* >> */ +%define SWIGWARN_IGNORE_OPERATOR_LSHIFTEQ 375 %enddef /* <<= */ +%define SWIGWARN_IGNORE_OPERATOR_RSHIFTEQ 376 %enddef /* >>= */ +%define SWIGWARN_IGNORE_OPERATOR_EQUALTO 377 %enddef /* == */ +%define SWIGWARN_IGNORE_OPERATOR_NOTEQUAL 378 %enddef /* != */ +%define SWIGWARN_IGNORE_OPERATOR_LTEQUAL 379 %enddef /* <= */ +%define SWIGWARN_IGNORE_OPERATOR_GTEQUAL 380 %enddef /* >= */ +%define SWIGWARN_IGNORE_OPERATOR_LAND 381 %enddef /* && */ +%define SWIGWARN_IGNORE_OPERATOR_LOR 382 %enddef /* || */ +%define SWIGWARN_IGNORE_OPERATOR_PLUSPLUS 383 %enddef /* ++ */ +%define SWIGWARN_IGNORE_OPERATOR_MINUSMINUS 384 %enddef /* -- */ +%define SWIGWARN_IGNORE_OPERATOR_COMMA 385 %enddef /* , */ +%define SWIGWARN_IGNORE_OPERATOR_ARROWSTAR 386 %enddef /* ->* */ +%define SWIGWARN_IGNORE_OPERATOR_ARROW 387 %enddef /* -> */ +%define SWIGWARN_IGNORE_OPERATOR_CALL 388 %enddef /* () */ +%define SWIGWARN_IGNORE_OPERATOR_INDEX 389 %enddef /* [] */ +%define SWIGWARN_IGNORE_OPERATOR_UPLUS 390 %enddef /* + */ +%define SWIGWARN_IGNORE_OPERATOR_UMINUS 391 %enddef /* - */ +%define SWIGWARN_IGNORE_OPERATOR_UMUL 392 %enddef /* * */ +%define SWIGWARN_IGNORE_OPERATOR_UAND 393 %enddef /* & */ +%define SWIGWARN_IGNORE_OPERATOR_NEWARR 394 %enddef /* new [] */ +%define SWIGWARN_IGNORE_OEPRATOR_DELARR 395 %enddef /* delete [] */ +%define SWIGWARN_IGNORE_OEPRATOR_REF 396 %enddef /* operator *() */ + +/* 394-399 are reserved */ + +/* -- Type system and typemaps -- */ + +%define SWIGWARN_TYPE_UNDEFINED_CLASS 401 %enddef +%define SWIGWARN_TYPE_INCOMPLETE 402 %enddef +%define SWIGWARN_TYPE_ABSTRACT 403 %enddef +%define SWIGWARN_TYPE_REDEFINED 404 %enddef + +%define SWIGWARN_TYPEMAP_SOURCETARGET 450 %enddef +%define SWIGWARN_TYPEMAP_CHARLEAK 451 %enddef +%define SWIGWARN_TYPEMAP_SWIGTYPE 452 %enddef +%define SWIGWARN_TYPEMAP_APPLY_UNDEF 453 %enddef +%define SWIGWARN_TYPEMAP_SWIGTYPELEAK 454 %enddef + +%define SWIGWARN_TYPEMAP_IN_UNDEF 460 %enddef +%define SWIGWARN_TYPEMAP_OUT_UNDEF 461 %enddef +%define SWIGWARN_TYPEMAP_VARIN_UNDEF 462 %enddef +%define SWIGWARN_TYPEMAP_VAROUT_UNDEF 463 %enddef +%define SWIGWARN_TYPEMAP_CONST_UNDEF 464 %enddef +%define SWIGWARN_TYPEMAP_UNDEF 465 %enddef +%define SWIGWARN_TYPEMAP_VAR_UNDEF 466 %enddef +%define SWIGWARN_TYPEMAP_TYPECHECK 467 %enddef +%define SWIGWARN_TYPEMAP_THROW 468 %enddef +%define SWIGWARN_TYPEMAP_DIRECTORIN_UNDEF 469 %enddef +%define SWIGWARN_TYPEMAP_THREAD_UNSAFE 470 %enddef /* mostly used in directorout typemaps */ +%define SWIGWARN_TYPEMAP_DIRECTOROUT_UNDEF 471 %enddef +%define SWIGWARN_TYPEMAP_TYPECHECK_UNDEF 472 %enddef +%define SWIGWARN_TYPEMAP_DIRECTOROUT_PTR 473 %enddef + +/* -- General code generation -- */ + +%define SWIGWARN_LANG_OVERLOAD_DECL 501 %enddef +%define SWIGWARN_LANG_OVERLOAD_CONSTRUCT 502 %enddef +%define SWIGWARN_LANG_IDENTIFIER 503 %enddef +%define SWIGWARN_LANG_RETURN_TYPE 504 %enddef +%define SWIGWARN_LANG_VARARGS 505 %enddef +%define SWIGWARN_LANG_VARARGS_KEYWORD 506 %enddef +%define SWIGWARN_LANG_NATIVE_UNIMPL 507 %enddef +%define SWIGWARN_LANG_DEREF_SHADOW 508 %enddef +%define SWIGWARN_LANG_OVERLOAD_SHADOW 509 %enddef +%define SWIGWARN_LANG_FRIEND_IGNORE 510 %enddef +%define SWIGWARN_LANG_OVERLOAD_KEYWORD 511 %enddef +%define SWIGWARN_LANG_OVERLOAD_CONST 512 %enddef +%define SWIGWARN_LANG_CLASS_UNNAMED 513 %enddef +%define SWIGWARN_LANG_DIRECTOR_VDESTRUCT 514 %enddef +%define SWIGWARN_LANG_DISCARD_CONST 515 %enddef +%define SWIGWARN_LANG_OVERLOAD_IGNORED 516 %enddef +%define SWIGWARN_LANG_DIRECTOR_ABSTRACT 517 %enddef +%define SWIGWARN_LANG_PORTABILITY_FILENAME 518 %enddef + +/* -- Reserved (600-799) -- */ + +/* -- Language module specific warnings (800 - 999) -- */ + +%define SWIGWARN_RUBY_WRONG_NAME 801 %enddef +%define SWIGWARN_RUBY_MULTIPLE_INHERITANCE 802 %enddef + +%define SWIGWARN_JAVA_TYPEMAP_JNI_UNDEF 810 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JTYPE_UNDEF 811 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JSTYPE_UNDEF 812 %enddef +%define SWIGWARN_JAVA_MULTIPLE_INHERITANCE 813 %enddef +%define SWIGWARN_JAVA_TYPEMAP_GETCPTR_UNDEF 814 %enddef +%define SWIGWARN_JAVA_TYPEMAP_CLASSMOD_UNDEF 815 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVABODY_UNDEF 816 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVAOUT_UNDEF 817 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVAIN_UNDEF 818 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVADIRECTORIN_UNDEF 819 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVADIRECTOROUT_UNDEF 820 %enddef +%define SWIGWARN_JAVA_COVARIANT_RET 822 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVACONSTRUCT_UNDEF 823 %enddef +%define SWIGWARN_JAVA_TYPEMAP_DIRECTORIN_NODESC 824 %enddef +%define SWIGWARN_JAVA_NO_DIRECTORCONNECT_ATTR 825 %enddef + +/* please leave 810-829 free for Java */ + +%define SWIGWARN_CSHARP_TYPEMAP_CTYPE_UNDEF 830 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSTYPE_UNDEF 831 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSWTYPE_UNDEF 832 %enddef +%define SWIGWARN_CSHARP_MULTIPLE_INHERITANCE 833 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_GETCPTR_UNDEF 834 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CLASSMOD_UNDEF 835 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSBODY_UNDEF 836 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSOUT_UNDEF 837 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSIN_UNDEF 838 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSDIRECTORIN_UNDEF 839 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSDIRECTOROUT_UNDEF 840 %enddef +%define SWIGWARN_CSHARP_COVARIANT_RET 842 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSCONSTRUCT_UNDEF 843 %enddef +%define SWIGWARN_CSHARP_EXCODE 844 %enddef +%define SWIGWARN_CSHARP_CANTHROW 845 %enddef + + +%define SWIGWARN_MODULA3_TYPEMAP_TYPE_UNDEF 850 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_GETCPTR_UNDEF 851 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_CLASSMOD_UNDEF 852 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_PTRCONSTMOD_UNDEF 853 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_MULTIPLE_RETURN 854 %enddef +%define SWIGWARN_MODULA3_MULTIPLE_INHERITANCE 855 %enddef +%define SWIGWARN_MODULA3_TYPECONSTRUCTOR_UNKNOWN 856 %enddef +%define SWIGWARN_MODULA3_UNKNOWN_PRAGMA 857 %enddef +%define SWIGWARN_MODULA3_BAD_ENUMERATION 858 %enddef +%define SWIGWARN_MODULA3_DOUBLE_ID 859 %enddef +%define SWIGWARN_MODULA3_BAD_IMPORT 860 %enddef + +/* please leave 850-869 free for Modula 3 */ + + +/* please leave 870-889 free for Php */ +%define SWIGWARN_PHP4_MULTIPLE_INHERITANCE 870 %enddef + + + +/* Feel free to claim any number in this space that's not currently being used. Just make sure you + add an entry here */ + + + + diff --git a/Lib/typemaps/ptrtypes.swg b/Lib/typemaps/ptrtypes.swg index 9a55d7ea3..2c03df1c7 100644 --- a/Lib/typemaps/ptrtypes.swg +++ b/Lib/typemaps/ptrtypes.swg @@ -82,7 +82,7 @@ if (SWIG_IsNewObj(ores)) %delete(optr); } - %typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) Type* { + %typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Type* { Type *optr = 0; int ores = asptr_meth($input, &optr); if (!SWIG_IsOK(ores)) { @@ -100,7 +100,7 @@ } } - %typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) Type& { + %typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Type& { Type *optr = 0; int ores = asptr_meth($input, &optr); if (!SWIG_IsOK(ores)) { diff --git a/Lib/typemaps/strings.swg b/Lib/typemaps/strings.swg index f7bad091d..bc9814ac5 100644 --- a/Lib/typemaps/strings.swg +++ b/Lib/typemaps/strings.swg @@ -77,7 +77,7 @@ } } -%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * { +%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const Char * { Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ; if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc)))) { %variable_fail(SWIG_TypeError, "$type", "$name"); @@ -107,7 +107,7 @@ } } -%typemap(memberin,noblock=1,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * { +%typemap(memberin,noblock=1,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const Char * { if ($input) { size_t size = SWIG_CharPtrLen($input) + 1; $1 = %new_copy_array($input, size, Char); @@ -128,7 +128,7 @@ } } -%typemap(globalin,noblock=1,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * { +%typemap(globalin,noblock=1,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const Char * { if ($input) { size_t size = SWIG_CharPtrLen($input) + 1; $1 = %new_copy_array($input, size, Char); @@ -158,7 +158,7 @@ /* directorout */ -%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) +%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Char * (Char* buf = 0, int alloc = SWIG_NEWOBJ) { if (!SWIG_IsOK((SWIG_AsCharPtr($input, &buf, &alloc)))) { %dirout_fail(SWIG_TypeError, "$type"); @@ -176,7 +176,7 @@ } -%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) +%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Char * const& (Char* buf = 0, int alloc = SWIG_NEWOBJ), Char const* const& (Char* buf = 0, int alloc = SWIG_NEWOBJ) { if (!SWIG_IsOK((SWIG_AsCharPtr($input, &buf, &alloc)))) { diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index 55f55620e..a9377b33a 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -223,7 +223,7 @@ /* Pointers, references, and variable size arrays */ -%typemap(varin,noblock=1,warning=SWIG_WARN_TYPEMAP_SWIGTYPELEAK) SWIGTYPE * { +%typemap(varin,noblock=1,warning=SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) SWIGTYPE * { void *argp = 0; int res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); if (!SWIG_IsOK(res)) { @@ -237,7 +237,7 @@ %variable_fail(SWIG_AttributeError, "$type", "read-only $name"); } -%typemap(varin,noblock=1,warning=SWIG_WARN_TYPEMAP_SWIGTYPELEAK) SWIGTYPE & { +%typemap(varin,noblock=1,warning=SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) SWIGTYPE & { void *argp = 0; int res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); if (!SWIG_IsOK(res)) { @@ -381,7 +381,7 @@ } #endif -%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) +%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *(void *argp, swig_owntype own) { if (!SWIG_IsOK((SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own)))) { %dirout_fail(SWIG_TypeError,"$type"); @@ -395,7 +395,7 @@ } } -%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) +%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE &(void *argp, swig_owntype own) { if (!SWIG_IsOK((SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own)))) { %dirout_fail(SWIG_TypeError,"$type"); diff --git a/Lib/typemaps/valtypes.swg b/Lib/typemaps/valtypes.swg index 9bf3136c2..bec5af66a 100644 --- a/Lib/typemaps/valtypes.swg +++ b/Lib/typemaps/valtypes.swg @@ -123,7 +123,7 @@ } $result = %static_cast(val,$type); } - %typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) const Type& { + %typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const Type& { Type val; int res = asval_meth($input, &val); if (!SWIG_IsOK(res)) { diff --git a/Lib/typemaps/void.swg b/Lib/typemaps/void.swg index fcfe4ad3b..0a5029fa1 100644 --- a/Lib/typemaps/void.swg +++ b/Lib/typemaps/void.swg @@ -65,7 +65,7 @@ $result = %reinterpret_cast(argp, $ltype); } -%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) void * const& (void *argp) { +%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) void * const& (void *argp) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, 0, $disown)))) { %dirout_fail(SWIG_TypeError,"$type"); } diff --git a/Makefile.in b/Makefile.in index 294409465..3e0835a44 100644 --- a/Makefile.in +++ b/Makefile.in @@ -310,6 +310,18 @@ noskip-%-test-suite: distclean-dead: rm -f $(DISTCLEAN-DEAD) +############################################################################ +# Update the Lib/swigwarn.swg file +############################################################################ + +Lib/swigwarn.swg: Source/Include/swigwarn.h + @echo "/* Automatically generated file containing all the swig warning codes. */" > $@ + @echo "/* Do not modify this file by hand, change 'Source/Include/swigwarn.h' */" >> $@ + @echo "/* and use the command 'make Lib/swigwarn.swg' instead. */" >> $@ + @echo >> $@; echo >> $@ + @awk '/#define WARN/{$$1="%define"; $$2="SWIG"$$2; $$3=sprintf("%d %%enddef", $$3); print $$0; next;}\ + /#/{next;} {print $0}' < $? >> $@ + ##################################################################### # TARGETS: install & friends ##################################################################### @@ -333,7 +345,8 @@ lib-languages = gcj typemaps tcl perl5 python guile java mzscheme ruby php4 ocam lib-modules = std -install-lib: + +install-lib: @echo "Installing the SWIG library" @$(MKINSTDIRS) $(DESTDIR)$(SWIG_LIB) @for file in $(srcdir)/Lib/*.i $(srcdir)/Lib/*.swg ; do \ @@ -415,4 +428,7 @@ configfiles: wget ftp://ftp.gnu.org/pub/gnu/config/config.sub -O Tools/config/config.sub chmod a+x Tools/config/config.sub + # Makefile ends here + + diff --git a/Source/Preprocessor/cpp.c b/Source/Preprocessor/cpp.c index 484a2ddee..a11c02578 100644 --- a/Source/Preprocessor/cpp.c +++ b/Source/Preprocessor/cpp.c @@ -1581,7 +1581,11 @@ Preprocessor_parse(String *s) while (*c && (isspace((int)*c))) c++; if (*c) { if (strncmp(c,"nowarn=",7) == 0) { - Swig_warnfilter(c+7,1); + String *val = NewString(c+7); + String *nowarn = Preprocessor_replace(val); + Swig_warnfilter(nowarn,1); + Delete(nowarn); + Delete(val); } else if (strncmp(c,"cpperraswarn=",7) == 0) { error_as_warning = atoi(c+13); diff --git a/Source/Swig/error.c b/Source/Swig/error.c index de4b342dc..9df05bbbf 100644 --- a/Source/Swig/error.c +++ b/Source/Swig/error.c @@ -173,10 +173,20 @@ Swig_error_silent(int s) { void Swig_warnfilter(const String_or_char *wlist, int add) { char *c; + char *cw; String *s; if (!filter) filter = NewStringEmpty(); - s = NewString(wlist); + + s = NewString(""); + Clear(s); + cw = Char(wlist); + while (*cw != '\0') { + if (*cw != ' ') { + Putc(*cw, s); + } + ++cw; + } c = Char(s); c = strtok(c,", "); while (c) {