From 5eb47b0da5e2cd6dfedd5c63384d4d7f166f14cb Mon Sep 17 00:00:00 2001 From: Gonzalo Garramuno Date: Thu, 20 Sep 2007 00:19:57 +0000 Subject: [PATCH] Reverted the static_cast fix as it is incorrect due to swig going thru a void* in-between. The problem is still present, but will require a much more elaborate fix. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9947 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/typemaps/swigtype.swg | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index de335ffe6..4d3718b05 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -7,7 +7,7 @@ if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } - $1 = %static_cast(argp, $ltype); + $1 = %reinterpret_cast(argp, $ltype); } %typemap(freearg) SWIGTYPE * ""; @@ -16,7 +16,7 @@ if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } - $1 = %static_cast(argp, $ltype); + $1 = %reinterpret_cast(argp, $ltype); } %typemap(freearg) SWIGTYPE [] ""; @@ -26,7 +26,7 @@ if (!SWIG_IsOK(res)) { %argument_fail(res, "$*ltype", $symname, $argnum); } - temp = %static_cast(argp, $*ltype); + temp = %reinterpret_cast(argp, $*ltype); $1 = &temp; } %typemap(freearg) SWIGTYPE* const& ""; @@ -39,7 +39,7 @@ %argument_fail(res, "$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); } - $1 = %static_cast(argp, $ltype); + $1 = %reinterpret_cast(argp, $ltype); } %typemap(freearg) SWIGTYPE & ""; @@ -50,7 +50,7 @@ %argument_fail(res, "$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); } - $1 = %static_cast(argp, $ltype); + $1 = %reinterpret_cast(argp, $ltype); } %typemap(freearg,noblock=1,match="in",implicitconv=1) const SWIGTYPE & { @@ -63,7 +63,7 @@ %argument_fail(res, "$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); } - $1 = %static_cast(argp, $ltype); + $1 = %reinterpret_cast(argp, $ltype); } #endif @@ -77,7 +77,7 @@ if (!argp) { %argument_nullref("$type", $symname, $argnum); } else { - $<ype temp = %static_cast(argp, $<ype); + $<ype temp = %reinterpret_cast(argp, $<ype); $1 = *temp; if (SWIG_IsNewObj(res)) %delete(temp); } @@ -91,7 +91,7 @@ if (!argp) { %argument_nullref("$type", $symname, $argnum); } else { - $1 = *(%static_cast(argp, $<ype)); + $1 = *(%reinterpret_cast(argp, $<ype)); } } #endif @@ -215,7 +215,7 @@ if (!SWIG_IsOK(res)) { %variable_fail(res, "$type", "$name"); } - $1 = %static_cast(argp, $ltype); + $1 = %reinterpret_cast(argp, $ltype); } %typemap(varin,noblock=1,warning="462:Unable to set dimensionless array variable") SWIGTYPE [] @@ -232,7 +232,7 @@ if (!argp) { %variable_nullref("$type", "$name"); } - $1 = *(%static_cast(argp, $ltype)); + $1 = *(%reinterpret_cast(argp, $ltype)); } #if defined(__cplusplus) && defined(%implicitconv_flag) @@ -246,7 +246,7 @@ %variable_nullref("$type", "$name"); } else { $&type temp; - temp = %static_cast(argp, $&type); + temp = %reinterpret_cast(argp, $&type); $1 = *temp; if (SWIG_IsNewObj(res)) %delete(temp); } @@ -261,7 +261,7 @@ if (!argp) { %variable_nullref("$type", "$name"); } else { - $1 = *(%static_cast(argp, $&type)); + $1 = *(%reinterpret_cast(argp, $&type)); } } #endif @@ -356,8 +356,8 @@ if (!SWIG_IsOK(swig_res)) { %dirout_fail(swig_res,"$type"); } - $result = *(%static_cast(swig_argp, $<ype)); - if (SWIG_IsNewObj(swig_res)) %delete(%static_cast(swig_argp, $<ype)); + $result = *(%reinterpret_cast(swig_argp, $<ype)); + if (SWIG_IsNewObj(swig_res)) %delete(%reinterpret_cast(swig_argp, $<ype)); } #else %typemap(directorout,noblock=1) SWIGTYPE (void * swig_argp, int swig_res = 0) { @@ -365,7 +365,7 @@ if (!SWIG_IsOK(swig_res)) { %dirout_fail(swig_res,"$type"); } - $result = *(%static_cast(swig_argp, $<ype)); + $result = *(%reinterpret_cast(swig_argp, $<ype)); } #endif @@ -375,7 +375,7 @@ if (!SWIG_IsOK(swig_res)) { %dirout_fail(swig_res,"$type"); } - $result = %static_cast(swig_argp, $ltype); + $result = %reinterpret_cast(swig_argp, $ltype); swig_acquire_ownership_obj(%as_voidptr($result), own); } %typemap(directorfree,noblock=1,match="directorout") SWIGTYPE * { @@ -391,7 +391,7 @@ %dirout_fail(swig_res,"$type"); } if (!swig_argp) { %dirout_nullref("$type"); } - $result = %static_cast(swig_argp, $ltype); + $result = %reinterpret_cast(swig_argp, $ltype); swig_acquire_ownership_obj(%as_voidptr($result), own); } %typemap(directorfree,noblock=1,match="directorout") SWIGTYPE & {