From 18d7ad613babbe374de23bcfaae129aa54073bad Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Sat, 11 Feb 2006 02:20:17 +0000 Subject: [PATCH] comments, clean and cosmetics git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8782 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/perl5/perltypemaps.swg | 9 ++------- Lib/ruby/rubyprimtypes.swg | 1 - Lib/ruby/rubytypemaps.swg | 6 +++++- Lib/tcl/tcltypemaps.swg | 9 ++++++++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Lib/perl5/perltypemaps.swg b/Lib/perl5/perltypemaps.swg index 5fb4ccad7..0261493c8 100644 --- a/Lib/perl5/perltypemaps.swg +++ b/Lib/perl5/perltypemaps.swg @@ -55,20 +55,15 @@ %define %set_output(obj) $result = obj; argvi++ %enddef /* append output */ -%define %append_output(obj) - if (argvi >= items) { - EXTEND(sp,1); - } - %set_output(obj) %enddef +%define %append_output(obj) if (argvi >= items) EXTEND(sp,1); %set_output(obj) %enddef /* variable output */ %define %set_varoutput(obj) sv_setsv($result,obj) %enddef /* constant */ %define %set_constant(name, obj) %begin_block - SV *_obj = obj; SV *sv = get_sv((char*) SWIG_prefix name, TRUE | 0x2); - sv_setsv(sv, _obj); + sv_setsv(sv, obj); SvREADONLY_on(sv); %end_block %enddef diff --git a/Lib/ruby/rubyprimtypes.swg b/Lib/ruby/rubyprimtypes.swg index 77f8c0560..e6694c097 100644 --- a/Lib/ruby/rubyprimtypes.swg +++ b/Lib/ruby/rubyprimtypes.swg @@ -22,7 +22,6 @@ SWIGINTERN VALUE SWIG_AUX_##Method##(VALUE *args) *res = Action; return obj; } - %enddef diff --git a/Lib/ruby/rubytypemaps.swg b/Lib/ruby/rubytypemaps.swg index 9569301df..9e5120f29 100644 --- a/Lib/ruby/rubytypemaps.swg +++ b/Lib/ruby/rubytypemaps.swg @@ -36,8 +36,12 @@ #define SWIG_Object VALUE #define VOID_Object Qnil -/* Simple overload of the output/constant/exception handling */ +/* Overload of the output/constant/exception handling */ + +/* append output */ #define SWIG_AppendOutput(result,obj) SWIG_Ruby_AppendOutput(result, obj) + +/* set constant */ #define SWIG_SetConstant(name, obj) rb_define_const($module, name, obj) /* raise */ diff --git a/Lib/tcl/tcltypemaps.swg b/Lib/tcl/tcltypemaps.swg index 3901603e1..a18e6a123 100644 --- a/Lib/tcl/tcltypemaps.swg +++ b/Lib/tcl/tcltypemaps.swg @@ -41,11 +41,18 @@ /* Tcl types */ #define SWIG_Object Tcl_Obj * -/* Simple overload of the output/constant/exception handling */ +/* Overload of the output/constant/exception handling */ + /* output */ #define %set_output(obj) Tcl_SetObjResult(interp,obj) + +/* append output */ #define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj) + +/* set constant */ #define SWIG_SetConstant(name, obj) SWIG_Tcl_SetConstantObj(interp, name, obj) + +/* raise */ #define SWIG_Raise(obj,type,desc) SWIG_Tcl_SetErrorObj(interp,type,obj)