more perl cleaning

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7731 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-26 07:15:14 +00:00
commit 16bd77e9d6
2 changed files with 5 additions and 12 deletions

View file

@ -19,13 +19,7 @@ typedef struct SWIGCDATA {
* Typemaps for returning binary data * Typemaps for returning binary data
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
#if SWIGPERL #if SWIGGUILE
%typemap(out) SWIGCDATA {
ST(argvi) = sv_newmortal();
sv_setpvn((SV*)ST(argvi++),$1.data,$1.len);
}
%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH);
#elif SWIGGUILE
%typemap(out) SWIGCDATA { %typemap(out) SWIGCDATA {
$result = gh_str2scm($1.data,$1.len); $result = gh_str2scm($1.data,$1.len);
} }

View file

@ -46,7 +46,7 @@
/* Error manipulation */ /* Error manipulation */
#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
#define SWIG_Error(code, msg) sv_setpvf(perl_get_sv("@", TRUE), "%s error %s\n", SWIG_ErrorType(code), msg) #define SWIG_Error(code, msg) warn("%s %s\n", SWIG_ErrorType(code), msg)
#define SWIG_fail goto fail #define SWIG_fail goto fail
/* Perl-specific SWIG API */ /* Perl-specific SWIG API */
@ -156,10 +156,9 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
To set ownership (see bellow), an newSViv(1) entry is added. To set ownership (see bellow), an newSViv(1) entry is added.
Hence, to remove ownership, we delete the entry. Hence, to remove ownership, we delete the entry.
*/ */
if (hv_exists_ent(hv, obj, 0)) {
/* SV *val = */ hv_delete_ent(hv, obj, 0, 0);
hv_delete_ent(hv, obj, 0, 0); }
/* if (val) SvREFCNT_dec(val); */
} }
} }
return SWIG_OK; return SWIG_OK;