From ff7ab7afac2b0e5fd3f5932bc84e5b8ca307c208 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 5 May 2006 23:26:57 +0000 Subject: [PATCH] more %apply char* fixes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9093 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/csharp/csharp.swg | 2 +- SWIG/Lib/guile/typemaps.i | 2 +- SWIG/Lib/lua/lua.swg | 2 +- SWIG/Lib/typemaps/strings.swg | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SWIG/Lib/csharp/csharp.swg b/SWIG/Lib/csharp/csharp.swg index d71c52f47..11eafdc33 100644 --- a/SWIG/Lib/csharp/csharp.swg +++ b/SWIG/Lib/csharp/csharp.swg @@ -126,7 +126,7 @@ %typemap(out) double %{ $result = $1; %} /* char * - treat as String */ -%typemap(in) char * %{ $1 = ($1_type)$input; %} +%typemap(in) char * %{ $1 = ($1_ltype)$input; %} %typemap(out) char * %{ $result = SWIG_csharp_string_callback((const char *)$1); %} %typemap(out, null="") void "" diff --git a/SWIG/Lib/guile/typemaps.i b/SWIG/Lib/guile/typemaps.i index 4a726cf17..a0b82dc5f 100644 --- a/SWIG/Lib/guile/typemaps.i +++ b/SWIG/Lib/guile/typemaps.i @@ -289,7 +289,7 @@ SIMPLE_MAP(unsigned long long, gh_scm2ulong_long, gh_ulong_long2scm, integer); /* Strings */ %typemap (in, doc="$NAME is a string") char *(int must_free = 0) { - $1 = ($1_type)SWIG_scm2str($input); + $1 = ($1_ltype)SWIG_scm2str($input); must_free = 1; } %typemap (varin, doc="NEW-VALUE is a string") char * {$1 = SWIG_scm2str($input);} diff --git a/SWIG/Lib/lua/lua.swg b/SWIG/Lib/lua/lua.swg index 47af5b2cd..88a00b3d7 100644 --- a/SWIG/Lib/lua/lua.swg +++ b/SWIG/Lib/lua/lua.swg @@ -68,7 +68,7 @@ // strings (char* and char[]) %typemap(in,checkfn="lua_isstring") const char*, char* -%{$1 = ($1_type)lua_tostring(L, $input);%} +%{$1 = ($1_ltype)lua_tostring(L, $input);%} %typemap(in,checkfn="lua_isstring") const char[ANY], char[ANY] %{$1 = (char*)lua_tostring(L, $input);%} diff --git a/SWIG/Lib/typemaps/strings.swg b/SWIG/Lib/typemaps/strings.swg index 77d869529..9eae553aa 100644 --- a/SWIG/Lib/typemaps/strings.swg +++ b/SWIG/Lib/typemaps/strings.swg @@ -174,7 +174,7 @@ if (alloc == SWIG_NEWOBJ) { swig_acquire_ownership_array(buf); } - $result = %reinterpret_cast(buf, $ltype); + $result = %reinterpret_cast(buf, $1_ltype); } %typemap(directorfree,noblock=1) Char * { @@ -191,7 +191,7 @@ if (!SWIG_IsOK(res)) { %dirout_fail(res, "$type"); } - static $*ltype tmp = buf; + static $*1_ltype tmp = buf; $result = &tmp; if (alloc == SWIG_NEWOBJ) { swig_acquire_ownership_array(buf);