From da2a914365c86912e4bd598d850d8a27a2004e8a Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 27 Sep 2005 20:16:09 +0000 Subject: [PATCH] Visual Studio warning fixes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7538 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/rubyenum.swg | 2 +- Lib/ruby/rubyswigtype.swg | 2 +- Lib/std/std_except.i | 12 ++++++------ Lib/tcl/tcl8.swg | 3 +++ Source/Modules/tcl8.cxx | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Lib/ruby/rubyenum.swg b/Lib/ruby/rubyenum.swg index abce97cbc..4a9b89963 100644 --- a/Lib/ruby/rubyenum.swg +++ b/Lib/ruby/rubyenum.swg @@ -61,5 +61,5 @@ static void SWIG_AsVal(VALUE obj, int *val) * ------------------------------------------------------------ */ %typemap(throws) enum SWIGTYPE - "rb_exc_raise(rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(INT2NUM($1))));"; + "(void)$1; rb_exc_raise(rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(INT2NUM($1))));" diff --git a/Lib/ruby/rubyswigtype.swg b/Lib/ruby/rubyswigtype.swg index 964490d71..8a5457471 100644 --- a/Lib/ruby/rubyswigtype.swg +++ b/Lib/ruby/rubyswigtype.swg @@ -158,5 +158,5 @@ * ------------------------------------------------------------ */ %typemap(throws) SWIGTYPE, SWIGTYPE *, SWIGTYPE [ANY], SWIGTYPE & - "rb_raise(rb_eRuntimeError, \"$1_type\");"; + "(void)$1; rb_raise(rb_eRuntimeError, \"$1_type\");"; diff --git a/Lib/std/std_except.i b/Lib/std/std_except.i index e9dc4da21..587bb3150 100644 --- a/Lib/std/std_except.i +++ b/Lib/std/std_except.i @@ -4,32 +4,32 @@ #if defined(SWIGJAVA) %typemap(throws) std::out_of_range %{ - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, _e.what()); + SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what()); return $null; %} #elif defined(SWIGCSHARP) %typemap(throws, canthrow=1) std::out_of_range %{ - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, _e.what()); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, $1.what()); return $null; %} %typemap(throws, canthrow=1) std::invalid_argument %{ - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentException, _e.what(), ""); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentException, $1.what(), ""); return $null; %} #elif defined(SWIGPYTHON) %include "exception.i" %typemap(throws) std::out_of_range %{ if (!PyErr_Occurred()) { - SWIG_exception(SWIG_IndexError, _e.what()); + SWIG_exception(SWIG_IndexError, $1.what()); } else { SWIG_fail; } %} %typemap(throws) std::invalid_argument %{ if (!PyErr_Occurred()) { - SWIG_exception(SWIG_TypeError, _e.what()); + SWIG_exception(SWIG_TypeError, $1.what()); } else { SWIG_fail; } %} #elif %include "exception.i" %typemap(throws) std::out_of_range %{ - SWIG_exception(SWIG_IndexError, _e.what()); %} + SWIG_exception(SWIG_IndexError, $1.what()); %} #endif diff --git a/Lib/tcl/tcl8.swg b/Lib/tcl/tcl8.swg index f61914465..c030bda6f 100644 --- a/Lib/tcl/tcl8.swg +++ b/Lib/tcl/tcl8.swg @@ -622,16 +622,19 @@ } %typemap(throws) SWIGTYPE { + (void)$1; Tcl_SetObjResult(interp, Tcl_NewStringObj((char*) "$1_type", -1)); SWIG_fail; } %typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY] { + (void)$1; Tcl_SetObjResult(interp, Tcl_NewStringObj((char*) "$1_type", -1)); SWIG_fail; } %typemap(throws) enum SWIGTYPE { + (void)$1; Tcl_SetObjResult(interp, Tcl_NewStringObj((char*) "$1_type", -1)); SWIG_fail; } diff --git a/Source/Modules/tcl8.cxx b/Source/Modules/tcl8.cxx index 1a70d7a97..2b6791147 100644 --- a/Source/Modules/tcl8.cxx +++ b/Source/Modules/tcl8.cxx @@ -920,7 +920,7 @@ public: "swig_", mangled_classname, "_base_names, &swig_module };\n", NIL); if( !itcl ) { - Printv(cmd_tab, tab4, "{ SWIG_prefix \"", class_name, "\", (swig_wrapper_func) SWIG_ObjectConstructor, &_wrap_class_", mangled_classname, "},\n", NIL); + Printv(cmd_tab, tab4, "{ SWIG_prefix \"", class_name, "\", (swig_wrapper_func) SWIG_ObjectConstructor, (ClientData)&_wrap_class_", mangled_classname, "},\n", NIL); }; Delete(t);