From ec75a4e9781e89662950d8bce785f2b4c9e10a3d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 9 Oct 2005 13:49:44 +0000 Subject: [PATCH] warning/error fixes for Visual Studio git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7633 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/python/exceptshadow/example.i | 2 +- Examples/test-suite/compactdefaultargs.i | 10 ++++++++-- Examples/test-suite/refcount.h | 2 +- Examples/test-suite/typemap_variables.i | 16 ++++++++-------- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Examples/python/exceptshadow/example.i b/Examples/python/exceptshadow/example.i index 0ca4ca99a..0098257a7 100644 --- a/Examples/python/exceptshadow/example.i +++ b/Examples/python/exceptshadow/example.i @@ -40,7 +40,7 @@ the necessary code to catch it and rethrow it to the python side. */ -%typemap(throws) FullError "throw;"; +%typemap(throws) FullError "(void)$1; throw;"; %exception *::enqueue { diff --git a/Examples/test-suite/compactdefaultargs.i b/Examples/test-suite/compactdefaultargs.i index 54ad22a45..b2b07c5f8 100644 --- a/Examples/test-suite/compactdefaultargs.i +++ b/Examples/test-suite/compactdefaultargs.i @@ -7,12 +7,15 @@ class Defaults1 { static const int PRIVATE_DEFAULT = -1; public: - static const double PUBLIC_DEFAULT = -1.0; + static const double PUBLIC_DEFAULT; Defaults1(int a = PRIVATE_DEFAULT) {} double ret(double d = PUBLIC_DEFAULT) { return d; } }; %} +%{ +const double Defaults1::PUBLIC_DEFAULT = -1.0; +%} // compactdefaultargs now on by default %feature("compactdefaultargs"); @@ -24,9 +27,12 @@ public: class Defaults2 { static const int PRIVATE_DEFAULT = -1; public: - static const double PUBLIC_DEFAULT = -1.0; + static const double PUBLIC_DEFAULT; Defaults2(int a = PRIVATE_DEFAULT) {} double ret(double d = PUBLIC_DEFAULT) { return d; } }; %} +%{ +const double Defaults2::PUBLIC_DEFAULT = -1.0; +%} diff --git a/Examples/test-suite/refcount.h b/Examples/test-suite/refcount.h index 897971bf7..7d07e7242 100644 --- a/Examples/test-suite/refcount.h +++ b/Examples/test-suite/refcount.h @@ -48,7 +48,7 @@ private: RCObjBase& operator=(const RCObjBase& ); - friend class RCObj; + friend struct RCObj; int add_ref() const { diff --git a/Examples/test-suite/typemap_variables.i b/Examples/test-suite/typemap_variables.i index a9f442b0f..94a008024 100644 --- a/Examples/test-suite/typemap_variables.i +++ b/Examples/test-suite/typemap_variables.i @@ -7,25 +7,25 @@ %typemap(varin) int "this_will_not_compile_varin " %typemap(varout) int "this_will_not_compile_varout" %typemap(varin) int globul "/*int globul varin */" -%typemap(varout) int globul "/*int globul varout*/" +%typemap(varout) int globul "/*int globul varout*/ $result=0;" %typemap(varin) int Space::nspace "/*int nspace varin */" -%typemap(varout) int Space::nspace "/*int nspace varout*/" +%typemap(varout) int Space::nspace "/*int nspace varout*/ $result=0;" //%typemap(varin) int member "/*int member varin */" -//%typemap(varout) int member "/*int member varout*/" +//%typemap(varout) int member "/*int member varout*/ $result=0;" %typemap(varin) int Space::Struct::smember "/*int smember varin */" -%typemap(varout) int Space::Struct::smember "/*int smember varout*/" +%typemap(varout) int Space::Struct::smember "/*int smember varout*/ $result=0;" // Statically typed languages use in/out for variables %typemap(in) int "this_will_not_compile_in " %typemap(out) int "this_will_not_compile_out" %typemap(in) int globul "/*int globul in */ $1=0;" -%typemap(out) int globul "/*int globul out*/" +%typemap(out) int globul "/*int globul out*/ $result=0;" %typemap(in) int Space::nspace "/*int nspace in */ $1=0;" -%typemap(out) int Space::nspace "/*int nspace out*/" +%typemap(out) int Space::nspace "/*int nspace out*/ $result=0;" %typemap(in) int member "/*int member in */ $1=0;" -%typemap(out) int member "/*int member out*/" +%typemap(out) int member "/*int member out*/ $result=0;" %typemap(in) int Space::Struct::smember "/*int smember in */ $1=0;" -%typemap(out) int Space::Struct::smember "/*int smember out*/" +%typemap(out) int Space::Struct::smember "/*int smember out*/ $result=0;" %typemap(javain) int "this_will_not_compile_javain " %typemap(javaout) int "this_will_not_compile_javaout"