From b0b5552c149c77d6db4b24006f00dbd4390ab516 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 15 Mar 2014 12:39:39 +0000 Subject: [PATCH] Fix casts for array setters broken when fixing nested C classes (c++out mode for Octave) Introduced in 703d5b96fecbcaa3c1fd21cc55cf3e1e3d689dfd Fixes compilation errors with Visual Studio --- Lib/typemaps/swigtype.swg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index 6c0affbe2..e8124df9c 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -159,7 +159,7 @@ %typemap(memberin) SWIGTYPE [ANY] { if ($input) { size_t ii = 0; - for (; ii < (size_t)$1_dim0; ++ii) *($1_ltype)&$1[ii] = ($*1_ltype)$input[ii]; + for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)$input + ii); } else { %variable_nullref("$type","$name"); } @@ -168,7 +168,7 @@ %typemap(globalin) SWIGTYPE [ANY] { if ($input) { size_t ii = 0; - for (; ii < (size_t)$1_dim0; ++ii) *($1_ltype)&$1[ii] = ($*1_ltype)$input[ii]; + for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)$input + ii); } else { %variable_nullref("$type","$name"); } @@ -181,7 +181,7 @@ %variable_fail(res, "$type", "$name"); } else if (inp) { size_t ii = 0; - for (; ii < (size_t)$1_dim0; ++ii) *($1_ltype)&$1[ii] = ($*1_ltype)inp[ii]; + for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)inp + ii); } else { %variable_nullref("$type", "$name"); }