From 58fc17cb81df0b228956758d8395979018fb1aa4 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 15 Jun 2004 23:10:22 +0000 Subject: [PATCH] fix char[] varout git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5995 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/pystrbase.swg | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/SWIG/Lib/python/pystrbase.swg b/SWIG/Lib/python/pystrbase.swg index d742c7295..6a7faaf5d 100644 --- a/SWIG/Lib/python/pystrbase.swg +++ b/SWIG/Lib/python/pystrbase.swg @@ -136,18 +136,8 @@ * Unknown size const Character array Char[ANY] handling * ------------------------------------------------------------ */ -%typemap(in) Char [] = Char *; -%typemap(in) const Char [] = Char *; -%typemap(out) Char [] = Char *; -%typemap(out) const Char [] = const Char *; -%typemap(varout) Char [] = Char *; -%typemap(varout) const Char [] = const Char *; -%typemap(constcode) Char [] = Char *; -%typemap(directorin) Char [] = Char *; -%typemap(directorin) const Char [] = Char *; -%typemap(directorout) Char [] = Char *; -%typemap(typecheck) Char [] = Char *; -%typemap(typecheck) const Char [] = Char *; +%apply Char* { Char [] }; +%apply const Char* { const Char [] }; %typemap(varin,fragment=#SWIG_AsCharArray) Char [] { @@ -159,16 +149,6 @@ } } -%typemap(varout,fragment=#SWIG_FromCharArray) const Char [] -{ - size_t size = sizeof($1); -#ifndef SWIG_PRESERVE_CARRAY_SIZE - while (size && ($1[size - 1] == '\0')) --size; -#endif - $result = SWIG_FromCharArray($1, size); -} - - /* ------------------------------------------------------------ * Fix size Character array Char[ANY] handling