Change 24717 by [EMAIL PROTECTED] on 2005/06/07 08:18:59

        Subject: [PATCH] Unvoid SvUPGRADE
        From: Andy Lester <[EMAIL PROTECTED]>
        Date: Mon, 6 Jun 2005 23:08:50 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/doio.c#261 edit
... //depot/perl/doop.c#152 edit
... //depot/perl/gv.c#244 edit
... //depot/perl/op.c#684 edit
... //depot/perl/pp.c#458 edit
... //depot/perl/pp_ctl.c#442 edit
... //depot/perl/pp_hot.c#393 edit
... //depot/perl/pp_sys.c#407 edit
... //depot/perl/scope.c#150 edit
... //depot/perl/sv.c#870 edit
... //depot/perl/sv.h#194 edit
... //depot/perl/toke.c#565 edit
... //depot/perl/util.c#458 edit

Differences ...

==== //depot/perl/doio.c#261 (text) ====
Index: perl/doio.c
--- perl/doio.c#260~24689~      Fri Jun  3 01:31:26 2005
+++ perl/doio.c Tue Jun  7 01:18:59 2005
@@ -673,11 +673,11 @@
 
                 LOCK_FDPID_MUTEX;
                 sv = *av_fetch(PL_fdpid,fd,TRUE);
-                (void)SvUPGRADE(sv, SVt_IV);
+                SvUPGRADE(sv, SVt_IV);
                 pid = SvIVX(sv);
                 SvIV_set(sv, 0);
                 sv = *av_fetch(PL_fdpid,savefd,TRUE);
-                (void)SvUPGRADE(sv, SVt_IV);
+                SvUPGRADE(sv, SVt_IV);
                 SvIV_set(sv, pid);
                 UNLOCK_FDPID_MUTEX;
             }

==== //depot/perl/doop.c#152 (text) ====
Index: perl/doop.c
--- perl/doop.c#151~24445~      Wed May 11 00:54:19 2005
+++ perl/doop.c Tue Jun  7 01:18:59 2005
@@ -653,7 +653,7 @@
 
     mark++;
     len = (items > 0 ? (delimlen * (items - 1) ) : 0);
-    (void)SvUPGRADE(sv, SVt_PV);
+    SvUPGRADE(sv, SVt_PV);
     if (SvLEN(sv) < len + items) {     /* current length is way too short */
        while (items-- > 0) {
            if (*mark && !SvGAMAGIC(*mark) && SvOK(*mark)) {

==== //depot/perl/gv.c#244 (text) ====
Index: perl/gv.c
--- perl/gv.c#243~24689~        Fri Jun  3 01:31:26 2005
+++ perl/gv.c   Tue Jun  7 01:18:59 2005
@@ -1005,7 +1005,7 @@
 
        case '?':
 #ifdef COMPLEX_STATUS
-           (void)SvUPGRADE(GvSV(gv), SVt_PVLV);
+           SvUPGRADE(GvSV(gv), SVt_PVLV);
 #endif
            goto magicalize;
 

==== //depot/perl/op.c#684 (text) ====
Index: perl/op.c
--- perl/op.c#683~24697~        Fri Jun  3 04:06:36 2005
+++ perl/op.c   Tue Jun  7 01:18:59 2005
@@ -1597,7 +1597,7 @@
 
     /* Fake up a method call to import */
     meth = newSVpvn("import", 6);
-    (void)SvUPGRADE(meth, SVt_PVIV);
+    SvUPGRADE(meth, SVt_PVIV);
     (void)SvIOK_on(meth);
     {
        U32 hash;
@@ -3064,7 +3064,7 @@
 
        /* Fake up a method call to import/unimport */
        meth = aver ? newSVpvn("import",6) : newSVpvn("unimport", 8);
-       (void)SvUPGRADE(meth, SVt_PVIV);
+       SvUPGRADE(meth, SVt_PVIV);
        (void)SvIOK_on(meth);
        {
            U32 hash;
@@ -5500,7 +5500,7 @@
                                SV *namesv;
                                targ = pad_alloc(OP_RV2GV, SVs_PADTMP);
                                namesv = PAD_SVl(targ);
-                               (void)SvUPGRADE(namesv, SVt_PV);
+                               SvUPGRADE(namesv, SVt_PV);
                                if (*name != '$')
                                    sv_setpvn(namesv, "$", 1);
                                sv_catpvn(namesv, name, len);

==== //depot/perl/pp.c#458 (text) ====
Index: perl/pp.c
--- perl/pp.c#457~24697~        Fri Jun  3 04:06:36 2005
+++ perl/pp.c   Tue Jun  7 01:18:59 2005
@@ -3358,7 +3358,7 @@
     char *tmps;
     UV value = POPu;
 
-    (void)SvUPGRADE(TARG,SVt_PV);
+    SvUPGRADE(TARG,SVt_PV);
 
     if (value > 255 && !IN_BYTES) {
        SvGROW(TARG, (STRLEN)UNISKIP(value)+1);
@@ -3587,7 +3587,7 @@
        else {
            STRLEN min = len + 1;
 
-           (void)SvUPGRADE(TARG, SVt_PV);
+           SvUPGRADE(TARG, SVt_PV);
            SvGROW(TARG, min);
            (void)SvPOK_only(TARG);
            d = (U8*)SvPVX(TARG);
@@ -3670,7 +3670,7 @@
        else {
            STRLEN min = len + 1;
 
-           (void)SvUPGRADE(TARG, SVt_PV);
+           SvUPGRADE(TARG, SVt_PV);
            SvGROW(TARG, min);
            (void)SvPOK_only(TARG);
            d = (U8*)SvPVX(TARG);
@@ -3759,7 +3759,7 @@
 
     SvUTF8_off(TARG);                          /* decontaminate */
     if (len) {
-       (void)SvUPGRADE(TARG, SVt_PV);
+       SvUPGRADE(TARG, SVt_PV);
        SvGROW(TARG, (len * 2) + 1);
        d = SvPVX(TARG);
        if (DO_UTF8(sv)) {

==== //depot/perl/pp_ctl.c#442 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#441~24689~    Fri Jun  3 01:31:26 2005
+++ perl/pp_ctl.c       Tue Jun  7 01:18:59 2005
@@ -285,7 +285,7 @@
        MAGIC *mg;
        I32 i;
        if (SvTYPE(sv) < SVt_PVMG)
-           (void)SvUPGRADE(sv, SVt_PVMG);
+           SvUPGRADE(sv, SVt_PVMG);
        if (!(mg = mg_find(sv, PERL_MAGIC_regex_global))) {
            sv_magic(sv, Nullsv, PERL_MAGIC_regex_global, Nullch, 0);
            mg = mg_find(sv, PERL_MAGIC_regex_global);

==== //depot/perl/pp_hot.c#393 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#392~24716~    Mon Jun  6 07:50:21 2005
+++ perl/pp_hot.c       Tue Jun  7 01:18:59 2005
@@ -1518,7 +1518,7 @@
        sv = TARG;
        if (SvROK(sv))
            sv_unref(sv);
-       (void)SvUPGRADE(sv, SVt_PV);
+       SvUPGRADE(sv, SVt_PV);
        tmplen = SvLEN(sv);     /* remember if already alloced */
        if (!tmplen && !SvREADONLY(sv))
            Sv_Grow(sv, 80);    /* try short-buffering it */

==== //depot/perl/pp_sys.c#407 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#406~24703~    Sat Jun  4 00:16:11 2005
+++ perl/pp_sys.c       Tue Jun  7 01:18:59 2005
@@ -449,7 +449,7 @@
     tmps = SvPV(tmpsv, len);
     if ((!tmps || !len) && PL_errgv) {
        SV *error = ERRSV;
-       (void)SvUPGRADE(error, SVt_PV);
+       SvUPGRADE(error, SVt_PV);
        if (SvPOK(error) && SvCUR(error))
            sv_catpv(error, "\t...caught");
        tmpsv = error;
@@ -486,7 +486,7 @@
     }
     if (!tmps || !len) {
        SV *error = ERRSV;
-       (void)SvUPGRADE(error, SVt_PV);
+       SvUPGRADE(error, SVt_PV);
        if (multiarg ? SvROK(error) : SvROK(tmpsv)) {
            if (!multiarg)
                SvSetSV(error,tmpsv);
@@ -1698,7 +1698,7 @@
        SvCUR_set(bufsv, offset);
 
        read_target = sv_newmortal();
-       (void)SvUPGRADE(read_target, SVt_PV);
+       SvUPGRADE(read_target, SVt_PV);
        buffer = SvGROW(read_target, (STRLEN)(length + 1));
     }
 

==== //depot/perl/scope.c#150 (text) ====
Index: perl/scope.c
--- perl/scope.c#149~24670~     Thu Jun  2 01:44:41 2005
+++ perl/scope.c        Tue Jun  7 01:18:59 2005
@@ -720,7 +720,7 @@
            if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
                SvTYPE(sv) != SVt_PVGV)
            {
-               (void)SvUPGRADE(value, SvTYPE(sv));
+               SvUPGRADE(value, SvTYPE(sv));
                SvMAGIC_set(value, SvMAGIC(sv));
                SvFLAGS(value) |= SvMAGICAL(sv);
                SvMAGICAL_off(sv);

==== //depot/perl/sv.c#870 (text) ====
Index: perl/sv.c
--- perl/sv.c#869~24716~        Mon Jun  6 07:50:21 2005
+++ perl/sv.c   Tue Jun  7 01:18:59 2005
@@ -3674,7 +3674,7 @@
            len = 1;
        }
 #endif
-       (void)SvUPGRADE(sv, SVt_PV);
+       SvUPGRADE(sv, SVt_PV);
        *lp = len;
        s = SvGROW(sv, len + 1);
        SvCUR_set(sv, len);
@@ -4260,9 +4260,9 @@
            }
        }
        if (stype == SVt_PVLV)
-           (void)SvUPGRADE(dstr, SVt_PVNV);
+           SvUPGRADE(dstr, SVt_PVNV);
        else
-           (void)SvUPGRADE(dstr, (U32)stype);
+           SvUPGRADE(dstr, (U32)stype);
     }
 
     sflags = SvFLAGS(sstr);
@@ -4652,7 +4652,7 @@
     }
     else
        new_SV(dstr);
-    (void)SvUPGRADE (dstr, SVt_PVIV);
+    SvUPGRADE(dstr, SVt_PVIV);
 
     assert (SvPOK(sstr));
     assert (SvPOKp(sstr));
@@ -4675,7 +4675,7 @@
        SV_COW_NEXT_SV_SET(dstr, SV_COW_NEXT_SV(sstr));
     } else {
        assert ((SvFLAGS(sstr) & CAN_COW_MASK) == CAN_COW_FLAGS);
-       (void)SvUPGRADE (sstr, SVt_PVIV);
+       SvUPGRADE(sstr, SVt_PVIV);
        SvREADONLY_on(sstr);
        SvFAKE_on(sstr);
        DEBUG_C(PerlIO_printf(Perl_debug_log,
@@ -4725,7 +4725,7 @@
        if (iv < 0)
            Perl_croak(aTHX_ "panic: sv_setpvn called with negative strlen");
     }
-    (void)SvUPGRADE(sv, SVt_PV);
+    SvUPGRADE(sv, SVt_PV);
 
     SvGROW(sv, len + 1);
     dptr = SvPVX(sv);
@@ -4771,7 +4771,7 @@
        return;
     }
     len = strlen(ptr);
-    (void)SvUPGRADE(sv, SVt_PV);
+    SvUPGRADE(sv, SVt_PV);
 
     SvGROW(sv, len + 1);
     Move(ptr,SvPVX(sv),len+1,char);
@@ -4814,7 +4814,7 @@
 {
     STRLEN allocate;
     SV_CHECK_THINKFIRST_COW_DROP(sv);
-    (void)SvUPGRADE(sv, SVt_PV);
+    SvUPGRADE(sv, SVt_PV);
     if (!ptr) {
        (void)SvOK_off(sv);
        return;
@@ -5270,7 +5270,7 @@
     MAGIC* mg;
 
     if (SvTYPE(sv) < SVt_PVMG) {
-       (void)SvUPGRADE(sv, SVt_PVMG);
+       SvUPGRADE(sv, SVt_PVMG);
     }
     Newz(702,mg, 1, MAGIC);
     mg->mg_moremagic = SvMAGIC(sv);
@@ -6887,7 +6887,7 @@
        However, perlbench says it's slower, because the existing swipe code
        is faster than copy on write.
        Swings and roundabouts.  */
-    (void)SvUPGRADE(sv, SVt_PV);
+    SvUPGRADE(sv, SVt_PV);
 
     SvSCREAM_off(sv);
 
@@ -8280,7 +8280,7 @@
        
            if (SvROK(sv))
                sv_unref(sv);
-           (void)SvUPGRADE(sv, SVt_PV);                /* Never FALSE */
+           SvUPGRADE(sv, SVt_PV);              /* Never FALSE */
            SvGROW(sv, len + 1);
            Move(s,SvPVX_const(sv),len,char);
            SvCUR_set(sv, len);
@@ -8690,7 +8690,7 @@
     SvOBJECT_on(tmpRef);
     if (SvTYPE(tmpRef) != SVt_PVIO)
        ++PL_sv_objcount;
-    (void)SvUPGRADE(tmpRef, SVt_PVMG);
+    SvUPGRADE(tmpRef, SVt_PVMG);
     SvSTASH_set(tmpRef, (HV*)SvREFCNT_inc(stash));
 
     if (Gv_AMG(stash))

==== //depot/perl/sv.h#194 (text) ====
Index: perl/sv.h
--- perl/sv.h#193~24716~        Mon Jun  6 07:50:21 2005
+++ perl/sv.h   Tue Jun  7 01:18:59 2005
@@ -208,7 +208,7 @@
 #define SVTYPEMASK     0xff
 #define SvTYPE(sv)     ((sv)->sv_flags & SVTYPEMASK)
 
-#define SvUPGRADE(sv, mt) (SvTYPE(sv) >= mt || sv_upgrade(sv, mt))
+#define SvUPGRADE(sv, mt) (void)(SvTYPE(sv) >= mt || sv_upgrade(sv, mt))
 
 #define SVs_PADSTALE   0x00000100      /* lexical has gone out of scope */
 #define SVs_PADTMP     0x00000200      /* in use as tmp */

==== //depot/perl/toke.c#565 (text) ====
Index: perl/toke.c
--- perl/toke.c#564~24701~      Fri Jun  3 15:07:57 2005
+++ perl/toke.c Tue Jun  7 01:18:59 2005
@@ -1027,7 +1027,7 @@
             version = yylval.opval;
            ver = cSVOPx(version)->op_sv;
            if (SvPOK(ver) && !SvNIOK(ver)) {
-               (void)SvUPGRADE(ver, SVt_PVNV);
+               SvUPGRADE(ver, SVt_PVNV);
                SvNV_set(ver, str_to_version(ver));
                SvNOK_on(ver);          /* hint that it is a version */
            }
@@ -2150,7 +2150,7 @@
        PL_rsfp_filters = newAV();
     if (!datasv)
        datasv = NEWSV(255,0);
-    (void)SvUPGRADE(datasv, SVt_PVIO);
+    SvUPGRADE(datasv, SVt_PVIO);
     u.filter = funcp;
     IoANY(datasv) = u.iop; /* stash funcp into spare field */
     IoFLAGS(datasv) |= IOf_FAKE_DIRP;

==== //depot/perl/util.c#458 (text) ====
Index: perl/util.c
--- perl/util.c#457~24689~      Fri Jun  3 01:31:26 2005
+++ perl/util.c Tue Jun  7 01:18:59 2005
@@ -380,7 +380,7 @@
            mg->mg_len++;
     }
     s = (U8*)SvPV_force(sv, len);
-    (void)SvUPGRADE(sv, SVt_PVBM);
+    SvUPGRADE(sv, SVt_PVBM);
     if (len == 0)              /* TAIL might be on a zero-length string. */
        return;
     if (len > 2) {
@@ -2039,7 +2039,7 @@
     LOCK_FDPID_MUTEX;
     sv = *av_fetch(PL_fdpid,p[This],TRUE);
     UNLOCK_FDPID_MUTEX;
-    (void)SvUPGRADE(sv,SVt_IV);
+    SvUPGRADE(sv,SVt_IV);
     SvIV_set(sv, pid);
     PL_forkprocess = pid;
     /* If we managed to get status pipe check for exec fail */
@@ -2190,7 +2190,7 @@
     LOCK_FDPID_MUTEX;
     sv = *av_fetch(PL_fdpid,p[This],TRUE);
     UNLOCK_FDPID_MUTEX;
-    (void)SvUPGRADE(sv,SVt_IV);
+    SvUPGRADE(sv,SVt_IV);
     SvIV_set(sv, pid);
     PL_forkprocess = pid;
     if (did_pipes && pid > 0) {
@@ -2656,7 +2656,7 @@
 
     sprintf(spid, "%"IVdf, (IV)pid);
     sv = *hv_fetch(PL_pidstatus,spid,strlen(spid),TRUE);
-    (void)SvUPGRADE(sv,SVt_IV);
+    SvUPGRADE(sv,SVt_IV);
     SvIV_set(sv, status);
     return;
 }
@@ -3706,7 +3706,7 @@
     int pathlen=0;
     Direntry_t *dp;
 
-    (void)SvUPGRADE(sv, SVt_PV);
+    SvUPGRADE(sv, SVt_PV);
 
     if (PerlLIO_lstat(".", &statbuf) < 0) {
        SV_CWD_RETURN_UNDEF;
End of Patch.

Reply via email to