Change 29903 by [EMAIL PROTECTED] on 2007/01/21 00:16:12

        Integrate:
        [ 27294]
        Replace direct flags tests & manipulations for SVpad_TYPED and
        SVpad_OUR with macros SvPAD_TYPED(), SvPAD_OUR() etc, to abstract
        away the flags bits acutally used to store this information.

Affected files ...

... //depot/maint-5.8/perl/XSUB.h#33 integrate
... //depot/maint-5.8/perl/dump.c#61 integrate
... //depot/maint-5.8/perl/op.c#163 integrate
... //depot/maint-5.8/perl/pad.c#59 integrate
... //depot/maint-5.8/perl/pad.h#14 integrate
... //depot/maint-5.8/perl/pp.c#114 integrate
... //depot/maint-5.8/perl/sv.c#295 integrate
... //depot/maint-5.8/perl/sv.h#68 integrate
... //depot/maint-5.8/perl/toke.c#136 integrate

Differences ...

==== //depot/maint-5.8/perl/dump.c#61 (text) ====
Index: perl/dump.c
--- perl/dump.c#60~29901~       2007-01-20 15:44:56.000000000 -0800
+++ perl/dump.c 2007-01-20 16:16:12.000000000 -0800
@@ -1055,7 +1055,8 @@
        if (GvUNIQUE(sv))       sv_catpv(d, "UNIQUE,");
        if (GvASSUMECV(sv))     sv_catpv(d, "ASSUMECV,");
        if (GvIN_PAD(sv))       sv_catpv(d, "IN_PAD,");
-       if (flags & SVpad_OUR)  sv_catpv(d, "OUR,");
+       if (SvPAD_OUR(sv))      sv_catpv(d, "OUR,");
+       if (SvPAD_TYPED(sv))    sv_catpv(d, "TYPED,");
        if (GvIMPORTED(sv)) {
            sv_catpv(d, "IMPORT");
            if (GvIMPORTED(sv) == GVf_IMPORTED)
@@ -1079,8 +1080,7 @@
        if (SvVALID(sv))        sv_catpv(d, "VALID,");
        break;
     case SVt_PVMG:
-       if (flags & SVpad_TYPED)
-                               sv_catpv(d, "TYPED,");
+       if (SvPAD_TYPED(sv))    sv_catpv(d, "TYPED,");
        break;
     }
     /* SVphv_SHAREKEYS is also 0x20000000 */

==== //depot/maint-5.8/perl/op.c#163 (text) ====
Index: perl/op.c
--- perl/op.c#162~29898~        2007-01-20 10:43:49.000000000 -0800
+++ perl/op.c   2007-01-20 16:16:12.000000000 -0800
@@ -6852,7 +6852,7 @@
            if (rop->op_type != OP_RV2HV || rop->op_first->op_type != OP_PADSV)
                break;
            lexname = *av_fetch(PL_comppad_name, rop->op_first->op_targ, TRUE);
-           if (!(SvFLAGS(lexname) & SVpad_TYPED))
+           if (!SvPAD_TYPED(lexname))
                break;
            fields = (GV**)hv_fetchs(SvSTASH(lexname), "FIELDS", FALSE);
            if (!fields || !GvHV(*fields))
@@ -6903,7 +6903,7 @@
            if (rop->op_type != OP_RV2HV || rop->op_first->op_type != OP_PADSV)
                break;
            lexname = *av_fetch(PL_comppad_name, rop->op_first->op_targ, TRUE);
-           if (!(SvFLAGS(lexname) & SVpad_TYPED))
+           if (!SvPAD_TYPED(lexname))
                break;
            fields = (GV**)hv_fetchs(SvSTASH(lexname), "FIELDS", FALSE);
            if (!fields || !GvHV(*fields))

==== //depot/maint-5.8/perl/pad.c#59 (text) ====
Index: perl/pad.c
--- perl/pad.c#58~29898~        2007-01-20 10:43:49.000000000 -0800
+++ perl/pad.c  2007-01-20 16:16:12.000000000 -0800
@@ -347,11 +347,11 @@
     sv_setpv(namesv, name);
 
     if (typestash) {
-       SvFLAGS(namesv) |= SVpad_TYPED;
+       SvPAD_TYPED_on(namesv);
        SvSTASH_set(namesv, (HV*)SvREFCNT_inc_simple_NN((SV*)typestash));
     }
     if (ourstash) {
-       SvFLAGS(namesv) |= SVpad_OUR;
+       SvPAD_OUR_on(namesv);
        GvSTASH(namesv) = (HV*)SvREFCNT_inc_simple_NN((SV*) ourstash);
     }
 
@@ -541,7 +541,7 @@
                && sv != &PL_sv_undef
                && !SvFAKE(sv)
                && (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0)
-               && ((SvFLAGS(sv) & SVpad_OUR) && GvSTASH(sv) == ourstash)
+               && ((SvPAD_OUR(sv)) && GvSTASH(sv) == ourstash)
                && strEQ(name, SvPVX_const(sv)))
            {
                Perl_warner(aTHX_ packWARN(WARN_MISC),
@@ -608,7 +608,7 @@
            if (   seq >  U_32(SvNVX(sv))       /* min */
                && seq <= (U32)SvIVX(sv))       /* max */
                return off;
-           else if ((SvFLAGS(sv) & SVpad_OUR)
+           else if (SvPAD_OUR(sv)
                    && U_32(SvNVX(sv)) == PAD_MAX) /* min */
            {
                /* look for an our that's being introduced; this allows
@@ -805,7 +805,7 @@
        }
        else if (!CvUNIQUE(PL_compcv)) {
            if (ckWARN(WARN_CLOSURE) && !SvFAKE(sv) && !CvUNIQUE(cv)
-               && !(SvFLAGS(sv) & SVpad_OUR))
+               && !(SvPAD_OUR(sv)))
            {
                Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
                    "Variable \"%s\" will not stay shared", name);
@@ -1565,7 +1565,7 @@
 Perl_pad_compname_type(pTHX_ const PADOFFSET po)
 {
     SV* const * const av = av_fetch(PL_comppad_name, po, FALSE);
-    if ( SvFLAGS(*av) & SVpad_TYPED ) {
+    if ( SvPAD_TYPED(*av) ) {
         return SvSTASH(*av);
     }
     return NULL;

==== //depot/maint-5.8/perl/pad.h#14 (text) ====
Index: perl/pad.h
--- perl/pad.h#13~28128~        2006-05-08 12:22:03.000000000 -0700
+++ perl/pad.h  2007-01-20 16:16:12.000000000 -0800
@@ -219,6 +219,7 @@
 */
 
 #define PAD_COMPNAME_FLAGS(po) SvFLAGS(*av_fetch(PL_comppad_name, (po), FALSE))
+#define PAD_COMPNAME_FLAGS_isOUR(po) (PAD_COMPNAME_FLAGS(po) & SVpad_OUR)
 #define PAD_COMPNAME_PV(po) SvPV_nolen(*av_fetch(PL_comppad_name, (po), FALSE))
 
 #define PAD_COMPNAME_TYPE(po) pad_compname_type(po)

==== //depot/maint-5.8/perl/sv.c#295 (text) ====
Index: perl/sv.c
--- perl/sv.c#294~29898~        2007-01-20 10:43:49.000000000 -0800
+++ perl/sv.c   2007-01-20 16:16:12.000000000 -0800
@@ -1189,7 +1189,7 @@
        /* This flag bit is used to mean other things in other scalar types.
           Given that it only has meaning inside the pad, it shouldn't be set
           on anything that can get upgraded.  */
-       assert((SvFLAGS(sv) & SVpad_TYPED) == 0);
+       assert(!SvPAD_TYPED(sv));
        break;
     default:
        if (old_type_details->cant_upgrade)
@@ -4529,7 +4529,7 @@
     if (type >= SVt_PVMG) {
        if (SvMAGIC(sv))
            mg_free(sv);
-       if (type == SVt_PVMG && SvFLAGS(sv) & SVpad_TYPED)
+       if (type == SVt_PVMG && SvPAD_TYPED(sv))
            SvREFCNT_dec(SvSTASH(sv));
     }
     stash = NULL;

==== //depot/maint-5.8/perl/sv.h#68 (text) ====
Index: perl/sv.h
--- perl/sv.h#67~29899~ 2007-01-20 15:15:32.000000000 -0800
+++ perl/sv.h   2007-01-20 16:16:12.000000000 -0800
@@ -892,6 +892,14 @@
 #define SvREPADTMP_off(sv)     (SvFLAGS(sv) &= ~SVf_FAKE)
 #endif
 
+#define SvPAD_TYPED(sv)                (SvFLAGS(sv) & SVpad_TYPED)
+#define SvPAD_TYPED_on(sv)     (SvFLAGS(sv) |= SVpad_TYPED)
+#define SvPAD_TYPED_off(sv)    (SvFLAGS(sv) &= ~SVpad_TYPED)
+
+#define SvPAD_OUR(sv)          (SvFLAGS(sv) & SVpad_OUR)
+#define SvPAD_OUR_on(sv)       (SvFLAGS(sv) |= SVpad_OUR)
+#define SvPAD_OUR_off(sv)      (SvFLAGS(sv) &= ~SVpad_OUR)
+
 #define SvRV(sv) ((XRV*)  SvANY(sv))->xrv_rv
 #define SvRVx(sv) SvRV(sv)
 

==== //depot/maint-5.8/perl/toke.c#136 (text) ====
Index: perl/toke.c
--- perl/toke.c#135~29897~      2007-01-20 10:14:46.000000000 -0800
+++ perl/toke.c 2007-01-20 16:16:12.000000000 -0800
@@ -5637,7 +5637,7 @@
            tmp = pad_findmy(PL_tokenbuf);
         if (tmp != NOT_IN_PAD) {
             /* might be an "our" variable" */
-            if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) {
+            if (PAD_COMPNAME_FLAGS_isOUR(tmp)) {
                 /* build ops for a bareword */
                 SV * const sym
                  = newSVpv(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)), 0);
@@ -9823,7 +9823,7 @@
               add symbol table ops
            */
            if ((tmp = pad_findmy(d)) != NOT_IN_PAD) {
-               if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) {
+               if (PAD_COMPNAME_FLAGS_isOUR(tmp)) {
                    SV * const sym = sv_2mortal(
                            newSVpv(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)),0));
                    sv_catpvs(sym, "::");
End of Patch.

Reply via email to