fix perl C errors

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8481 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-19 04:53:15 +00:00
commit 6cb4870883
2 changed files with 4 additions and 7 deletions

View file

@ -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)) {

View file

@ -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))) {