From a04dc64d0464b1620dc906cb51423f7fe8dfa9ec Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 27 May 2004 11:29:39 +0000 Subject: [PATCH] fixes for const char[] git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5931 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/python.cxx | 3 +-- SWIG/Source/Swig/stype.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index 882ca1f78..07fb608ce 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -986,8 +986,7 @@ public: Printf(f_shadow_stubs,"%s = %s.%s\n", global_name, module, global_name); } } - - if ((shadow) && (SwigType_isconst(t))) { + if ((shadow) && (!SwigType_ismutable(t))) { if (!in_class) { Printf(f_shadow_stubs,"%s = %s.%s\n", iname, global_name, iname); } diff --git a/SWIG/Source/Swig/stype.c b/SWIG/Source/Swig/stype.c index f7d9ac33c..59ab6f412 100644 --- a/SWIG/Source/Swig/stype.c +++ b/SWIG/Source/Swig/stype.c @@ -227,7 +227,7 @@ int SwigType_isconst(SwigType *t) { int SwigType_ismutable(SwigType *t) { int r; SwigType *qt = SwigType_typedef_resolve_all(t); - if (SwigType_isreference(qt)) { + if (SwigType_isreference(qt) || SwigType_isarray(qt)) { Delete(SwigType_pop(qt)); } r = SwigType_isconst(qt);