From 7d38c269be26bb197437a8707b0ca2520315fc1e Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Fri, 28 Nov 2003 19:06:35 +0000 Subject: [PATCH] Fixed casting problem with references to arrays in gcc-3.3 (and maybe other versions). I'm not sure if this is a gcc bug or a SWIG bug. However, the patch makes the arrayref.i test work on my machine. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5433 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Swig/stype.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SWIG/Source/Swig/stype.c b/SWIG/Source/Swig/stype.c index c63cdcd1e..a2eb2918a 100644 --- a/SWIG/Source/Swig/stype.c +++ b/SWIG/Source/Swig/stype.c @@ -603,6 +603,7 @@ String *SwigType_rcaststr(SwigType *s, const String_or_char *name) { int clear = 1; int firstarray = 1; int isreference = 0; + int isarray = 0; result = NewString(""); @@ -684,6 +685,7 @@ String *SwigType_rcaststr(SwigType *s, const String_or_char *name) { Delete(size); clear = 0; } + isarray = 1; } else if (SwigType_isfunction(element)) { DOH *parms, *p; int j, plen; @@ -718,6 +720,7 @@ String *SwigType_rcaststr(SwigType *s, const String_or_char *name) { } if (name) { if (isreference) { + if (isarray) Clear(cast); Append(cast,"*"); } Append(cast,name);