Change 29967 by [EMAIL PROTECTED] on 2007/01/25 10:34:50

        Integrate:
        [ 28047]
        Subject: [PATCH] More tweaking of SvREFCNT_inc calls
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sun, 30 Apr 2006 12:06:21 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 28048]
        Subject: [PATCH] quiet some perlio.c warnings
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sun, 30 Apr 2006 13:23:22 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 28049]
        Subject: [PATCH] Some more SvREFCNT_inc updates
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sun, 30 Apr 2006 13:24:14 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 28050]
        Subject: [PATCH] pp.c casting, take two
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sun, 30 Apr 2006 19:48:26 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        (with adjustements, some of the code has already
        been touched since)

Affected files ...

... //depot/maint-5.8/perl/cop.h#30 integrate
... //depot/maint-5.8/perl/mg.c#134 integrate
... //depot/maint-5.8/perl/perlio.c#91 integrate
... //depot/maint-5.8/perl/pp.c#127 integrate
... //depot/maint-5.8/perl/pp_ctl.c#158 integrate

Differences ...

==== //depot/maint-5.8/perl/cop.h#30 (text) ====
Index: perl/cop.h
--- perl/cop.h#29~29964~        2007-01-24 15:53:28.000000000 -0800
+++ perl/cop.h  2007-01-25 02:34:50.000000000 -0800
@@ -137,8 +137,8 @@
        cx->blk_sub.olddepth = CvDEPTH(cv);                             \
        cx->blk_sub.hasargs = hasargs;                                  \
        if (!CvDEPTH(cv)) {                                             \
-           SvREFCNT_inc_void(cv);                                      \
-           SvREFCNT_inc_void(cv);                                      \
+           SvREFCNT_inc_simple_void_NN(cv);                            \
+           SvREFCNT_inc_simple_void_NN(cv);                            \
            SAVEFREESV(cv);                                             \
        }
 

==== //depot/maint-5.8/perl/mg.c#134 (text) ====
Index: perl/mg.c
--- perl/mg.c#133~29962~        2007-01-24 14:51:14.000000000 -0800
+++ perl/mg.c   2007-01-25 02:34:50.000000000 -0800
@@ -158,7 +158,7 @@
        cause the SV's buffer to get stolen (and maybe other stuff).
        So restore it.
     */
-    sv_2mortal(SvREFCNT_inc_simple(sv));
+    sv_2mortal(SvREFCNT_inc_simple_NN(sv));
     if (!was_temp) {
        SvTEMP_off(sv);
     }
@@ -1196,20 +1196,21 @@
        if(PL_psig_ptr[i])
            sv_setsv(sv,PL_psig_ptr[i]);
        else {
-           Sighandler_t sigstate;
-           sigstate = rsignal_state(i);
+           Sighandler_t sigstate = rsignal_state(i);
 #ifdef FAKE_PERSISTENT_SIGNAL_HANDLERS
-           if (PL_sig_handlers_initted && PL_sig_ignoring[i]) sigstate = 
SIG_IGN;
+           if (PL_sig_handlers_initted && PL_sig_ignoring[i])
+               sigstate = SIG_IGN;
 #endif
 #ifdef FAKE_DEFAULT_SIGNAL_HANDLERS
-           if (PL_sig_handlers_initted && PL_sig_defaulting[i]) sigstate = 
SIG_DFL;
+           if (PL_sig_handlers_initted && PL_sig_defaulting[i])
+               sigstate = SIG_DFL;
 #endif
            /* cache state so we don't fetch it again */
            if(sigstate == (Sighandler_t) SIG_IGN)
                sv_setpv(sv,"IGNORE");
            else
                sv_setsv(sv,&PL_sv_undef);
-           PL_psig_ptr[i] = SvREFCNT_inc_simple(sv);
+           PL_psig_ptr[i] = SvREFCNT_inc_simple_NN(sv);
            SvTEMP_off(sv);
        }
     }
@@ -1423,7 +1424,7 @@
 #endif
        SvREFCNT_dec(PL_psig_name[i]);
        to_dec = PL_psig_ptr[i];
-       PL_psig_ptr[i] = SvREFCNT_inc_simple(sv);
+       PL_psig_ptr[i] = SvREFCNT_inc_simple_NN(sv);
        SvTEMP_off(sv); /* Make sure it doesn't go away on us */
        PL_psig_name[i] = newSVpvn(s, len);
        SvREADONLY_on(PL_psig_name[i]);
@@ -1474,7 +1475,7 @@
        if (i)
            (void)rsignal(i, PL_csighandlerp);
        else
-           *svp = SvREFCNT_inc_simple(sv);
+           *svp = SvREFCNT_inc_simple_NN(sv);
     }
 #ifdef HAS_SIGPROCMASK
     if(i)
@@ -1988,7 +1989,7 @@
            if ((I32)LvTARGOFF(sv) <= AvFILL(av))
                targ = AvARRAY(av)[LvTARGOFF(sv)];
        }
-       if (targ && targ != &PL_sv_undef) {
+       if (targ && (targ != &PL_sv_undef)) {
            /* somebody else defined it for us */
            SvREFCNT_dec(LvTARG(sv));
            LvTARG(sv) = SvREFCNT_inc_simple_NN(targ);

==== //depot/maint-5.8/perl/perlio.c#91 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#90~29963~     2007-01-24 15:24:03.000000000 -0800
+++ perl/perlio.c       2007-01-25 02:34:50.000000000 -0800
@@ -650,7 +650,7 @@
     PL_known_layers = PerlIO_clone_list(aTHX_ proto->Iknown_layers, param);
     PL_def_layerlist = PerlIO_clone_list(aTHX_ proto->Idef_layerlist, param);
     PerlIO_allocate(aTHX); /* root slot is never used */
-    PerlIO_debug("Clone %p from %p\n",aTHX,proto);
+    PerlIO_debug("Clone %p from %p\n",(void*)aTHX,(void*)proto);
     while ((f = *table)) {
            int i;
            table = (PerlIO **) (f++);
@@ -662,6 +662,7 @@
            }
        }
 #else
+    PERL_UNUSED_CONTEXT;
     PERL_UNUSED_ARG(proto);
     PERL_UNUSED_ARG(param);
 #endif
@@ -673,7 +674,7 @@
     PerlIO **table = &PL_perlio;
     PerlIO *f;
 #ifdef USE_ITHREADS
-    PerlIO_debug("Destruct %p\n",aTHX);
+    PerlIO_debug("Destruct %p\n",(void*)aTHX);
 #endif
     while ((f = *table)) {
        int i;
@@ -2298,7 +2299,7 @@
 {
     int i;
 #ifdef USE_ITHREADS
-    PerlIO_debug("Cleanup layers for %p\n",aTHX);
+    PerlIO_debug("Cleanup layers for %p\n",(void*)aTHX);
 #else
     PerlIO_debug("Cleanup layers\n");
 #endif

==== //depot/maint-5.8/perl/pp.c#127 (text) ====
Index: perl/pp.c
--- perl/pp.c#126~29964~        2007-01-24 15:53:28.000000000 -0800
+++ perl/pp.c   2007-01-25 02:34:50.000000000 -0800
@@ -340,7 +340,7 @@
 {
     dSP;
     GV *gv;
-    HV *stash;
+    HV *stash_unused;
     const I32 flags = (PL_op->op_flags & OPf_SPECIAL)
        ? 0
        : ((PL_op->op_private & (OPpLVAL_INTRO|OPpMAY_RETURN_CONSTANT)) == 
OPpMAY_RETURN_CONSTANT)
@@ -349,7 +349,7 @@
     /* We usually try to add a non-existent subroutine in case of AUTOLOAD. */
     /* (But not in defined().) */
 
-    CV *cv = sv_2cv(TOPs, &stash, &gv, flags);
+    CV *cv = sv_2cv(TOPs, &stash_unused, &gv, flags);
     if (cv) {
        if (CvCLONE(cv))
            cv = (CV*)sv_2mortal((SV*)cv_clone(cv));
@@ -3310,13 +3310,13 @@
 PP(pp_ord)
 {
     dSP; dTARGET;
+
     SV *argsv = POPs;
     STRLEN len;
     const U8 *s = (U8*)SvPV_const(argsv, len);
-    SV *tmpsv;
 
     if (PL_encoding && SvPOK(argsv) && !DO_UTF8(argsv)) {
-        tmpsv = sv_2mortal(newSVsv(argsv));
+        SV * const tmpsv = sv_2mortal(newSVsv(argsv));
         s = (U8*)sv_recode_to_utf8(tmpsv, PL_encoding);
         argsv = tmpsv;
     }
@@ -3440,7 +3440,7 @@
     if (SvOK(source)) {
        s = (const U8*)SvPV_nomg_const(source, slen);
     } else {
-       s = (U8*)"";
+       s = (const U8*)"";
        slen = 0;
     }
 
@@ -3453,7 +3453,7 @@
            toLOWER_utf8((U8 *)s, tmpbuf, &tculen);
        }
        /* If the two differ, we definately cannot do inplace.  */
-       inplace = ulen == tculen;
+       inplace = (ulen == tculen);
        need = slen + 1 - ulen + tculen;
     } else {
        doing_utf8 = FALSE;
@@ -3563,7 +3563,7 @@
        if (SvOK(source)) {
            s = (const U8*)SvPV_nomg_const(source, len);
        } else {
-           s = (U8*)"";
+           s = (const U8*)"";
            len = 0;
        }
        min = len + 1;
@@ -3662,7 +3662,7 @@
        if (SvOK(source)) {
            s = (const U8*)SvPV_nomg_const(source, len);
        } else {
-           s = (U8*)"";
+           s = (const U8*)"";
            len = 0;
        }
        min = len + 1;
@@ -4357,7 +4357,7 @@
 PP(pp_push)
 {
     dSP; dMARK; dORIGMARK; dTARGET;
-    register AV *ary = (AV*)*++MARK;
+    register AV * const ary = (AV*)*++MARK;
     const MAGIC * const mg = SvTIED_mg((SV*)ary, PERL_MAGIC_tied);
 
     if (mg) {

==== //depot/maint-5.8/perl/pp_ctl.c#158 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#157~29964~    2007-01-24 15:53:28.000000000 -0800
+++ perl/pp_ctl.c       2007-01-25 02:34:50.000000000 -0800
@@ -2290,7 +2290,7 @@
 
                CvDEPTH(cv)++;
                if (CvDEPTH(cv) < 2)
-                   SvREFCNT_inc_void_NN(cv);
+                   SvREFCNT_inc_simple_void_NN(cv);
                else {
                    if (CvDEPTH(cv) == 100 && ckWARN(WARN_RECURSION))
                        sub_crush_depth(cv);
@@ -3169,7 +3169,7 @@
                        if (SvROK(arg) && (SvTYPE(SvRV(arg)) <= SVt_PVLV)
                            && !isGV_with_GP(SvRV(arg))) {
                            filter_cache = SvRV(arg);
-                           SvREFCNT_inc_void_NN(filter_cache);
+                           SvREFCNT_inc_simple_void_NN(filter_cache);
 
                            if (i < count) {
                                arg = SP[i++];
@@ -3201,7 +3201,7 @@
 
                        if (SvROK(arg) && SvTYPE(SvRV(arg)) == SVt_PVCV) {
                            filter_sub = arg;
-                           SvREFCNT_inc_void_NN(filter_sub);
+                           SvREFCNT_inc_simple_void_NN(filter_sub);
 
                            if (i < count) {
                                filter_state = SP[i];
End of Patch.

Reply via email to