From 6cb48708836f7147916015d9f18c8cc3c009a044 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 19 Jan 2006 04:53:15 +0000 Subject: [PATCH] fix perl C errors git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8481 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/perl5/perlrun.swg | 2 +- SWIG/Source/Modules/perl5.cxx | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/SWIG/Lib/perl5/perlrun.swg b/SWIG/Lib/perl5/perlrun.swg index f8ebd1ec6..1ce07b0cb 100644 --- a/SWIG/Lib/perl5/perlrun.swg +++ b/SWIG/Lib/perl5/perlrun.swg @@ -209,8 +209,8 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * /* Check to see if this is an object */ if (sv_isobject(sv)) { - tsv = (SV*) SvRV(sv); IV tmp = 0; + tsv = (SV*) SvRV(sv); if ((SvTYPE(tsv) == SVt_PVHV)) { MAGIC *mg; if (SvMAGICAL(tsv)) { diff --git a/SWIG/Source/Modules/perl5.cxx b/SWIG/Source/Modules/perl5.cxx index 6e605eed9..9bce554c8 100644 --- a/SWIG/Source/Modules/perl5.cxx +++ b/SWIG/Source/Modules/perl5.cxx @@ -306,9 +306,8 @@ public: "#else\n", "#define MAGIC_CLASS\n", "#endif\n", - "SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *sv, MAGIC *mg) {\n", + "SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {\n", tab4, "MAGIC_PPERL\n", - tab4, "sv = sv; mg = mg;\n", tab4, "croak(\"Value is read-only.\");\n", tab4, "return 0;\n", "}\n", @@ -821,10 +820,9 @@ public: /* Create a Perl function for setting the variable value */ if (!GetFlag(n,"feature:immutable")) { - Printf(setf->def,"SWIGCLASS_STATIC int %s(pTHX_ SV* sv, MAGIC *mg) {\n", set_name); + Printf(setf->def,"SWIGCLASS_STATIC int %s(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {\n", set_name); Printv(setf->code, tab4, "MAGIC_PPERL\n", - tab4, "mg = mg;\n", NIL); /* Check for a few typemaps */ @@ -847,10 +845,9 @@ public: /* Now write a function to evaluate the variable */ - Printf(getf->def,"SWIGCLASS_STATIC int %s(pTHX_ SV *sv, MAGIC *mg) {\n", val_name); + Printf(getf->def,"SWIGCLASS_STATIC int %s(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {\n", val_name); Printv(getf->code, tab4, "MAGIC_PPERL\n", - tab4, "mg = mg;\n", NIL); if ((tm = Swig_typemap_lookup_new("varout",n,name,0))) {