avoid PTR->IV cast warnings
Gurusamy Sarathy [Wed, 1 Dec 1999 05:15:27 +0000 (05:15 +0000)]
p4raw-id: //depot/perl@4605

mg.c
op.c
scope.h

diff --git a/mg.c b/mg.c
index 2b35677..0ea3560 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1182,7 +1182,7 @@ Perl_magic_setdbline(pTHX_ SV *sv, MAGIC *mg)
     i = SvTRUE(sv);
     svp = av_fetch(GvAV(gv),
                     atoi(MgPV(mg,n_a)), FALSE);
-    if (svp && SvIOKp(*svp) && (o = (OP*)SvIVX(*svp)))
+    if (svp && SvIOKp(*svp) && (o = INT2PTR(OP*,SvIVX(*svp))))
        o->op_private = i;
     else if (ckWARN_d(WARN_INTERNAL))
        Perl_warner(aTHX_ WARN_INTERNAL, "Can't break at that line\n");
diff --git a/op.c b/op.c
index 6cfc957..80fb550 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3365,7 +3365,7 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o)
        SV **svp = av_fetch(CopFILEAV(PL_curcop), (I32)CopLINE(cop), FALSE);
        if (svp && *svp != &PL_sv_undef && !SvIOK(*svp)) {
            (void)SvIOK_on(*svp);
-           SvIVX(*svp) = (IV)cop;
+           SvIVX(*svp) = PTR2IV(cop);
        }
     }
 
diff --git a/scope.h b/scope.h
index 6d6b013..330467f 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -78,7 +78,7 @@
 #define SAVELONG(l)    save_long(SOFT_CAST(long*)&(l))
 #define SAVESPTR(s)    save_sptr((SV**)&(s))
 #define SAVEPPTR(s)    save_pptr(SOFT_CAST(char**)&(s))
-#define SAVEVPTR(s)    save_vptr(&(s))
+#define SAVEVPTR(s)    save_vptr((void*)&(s))
 #define SAVEFREESV(s)  save_freesv((SV*)(s))
 #define SAVEFREEOP(o)  save_freeop(SOFT_CAST(OP*)(o))
 #define SAVEFREEPV(p)  save_freepv(SOFT_CAST(char*)(p))