Change 26686 by [EMAIL PROTECTED] on 2006/01/06 22:05:28

        Integrate:
        [ 25754]
        Subject: [PATCH] Stas' croak patch and then some
        From: Andy Lester <[EMAIL PROTECTED]>
        Date: Thu, 13 Oct 2005 16:42:12 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/maint-5.8/perl/embed.fnc#118 integrate
... //depot/maint-5.8/perl/gv.c#59 integrate
... //depot/maint-5.8/perl/op.c#117 integrate
... //depot/maint-5.8/perl/pad.c#46 integrate
... //depot/maint-5.8/perl/perl.c#146 integrate
... //depot/maint-5.8/perl/pp_sort.c#30 integrate
... //depot/maint-5.8/perl/proto.h#108 integrate
... //depot/maint-5.8/perl/regcomp.c#62 integrate
... //depot/maint-5.8/perl/sv.c#203 integrate
... //depot/maint-5.8/perl/toke.c#104 integrate
... //depot/maint-5.8/perl/utf8.c#48 integrate

Differences ...

==== //depot/maint-5.8/perl/embed.fnc#118 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#117~26682~   2006-01-06 12:10:24.000000000 -0800
+++ perl/embed.fnc      2006-01-06 14:05:28.000000000 -0800
@@ -137,7 +137,8 @@
 Ap     |MAGIC* |condpair_magic |SV *sv
 #endif
 pR     |OP*    |convert        |I32 optype|I32 flags|NULLOK OP* o
-Afprd  |void   |croak          |NN const char* pat|...
+: croak()'s first parm can be NULL.  Otherwise, mod_perl breaks.
+Afprd  |void   |croak          |NULLOK const char* pat|...
 Apr    |void   |vcroak         |NN const char* pat|NULLOK va_list* args
 #if defined(PERL_IMPLICIT_CONTEXT)
 Afnrp  |void   |croak_nocontext|NN const char* pat|...
@@ -757,7 +758,7 @@
 Apd    |void   |sv_dec         |NN SV* sv
 Ap     |void   |sv_dump        |NN SV* sv
 ApdR   |bool   |sv_derived_from|NN SV* sv|NN const char* name
-Apd    |I32    |sv_eq          |NN SV* sv1|NN SV* sv2
+Apd    |I32    |sv_eq          |NULLOK SV* sv1|NULLOK SV* sv2
 Apd    |void   |sv_free        |NULLOK SV* sv
 pd     |void   |sv_free_arenas
 Apd    |char*  |sv_gets        |NN SV* sv|NN PerlIO* fp|I32 append

==== //depot/maint-5.8/perl/gv.c#59 (text) ====
Index: perl/gv.c
--- perl/gv.c#58~26682~ 2006-01-06 12:10:24.000000000 -0800
+++ perl/gv.c   2006-01-06 14:05:28.000000000 -0800
@@ -950,7 +950,7 @@
                    hv = GvHVn(gv);
                    hv_magic(hv, Nullgv, PERL_MAGIC_sig);
                    for (i = 1; i < SIG_SIZE; i++) {
-                       SV ** const init = hv_fetch(hv, PL_sig_name[i], 
strlen(PL_sig_name[i]), 1);
+                       SV * const * const init = hv_fetch(hv, PL_sig_name[i], 
strlen(PL_sig_name[i]), 1);
                        if (init)
                            sv_setsv(*init, &PL_sv_undef);
                        PL_psig_ptr[i] = 0;
@@ -1250,14 +1250,14 @@
                file = GvFILE(gv);
                /* performance hack: if filename is absolute and it's a standard
                 * module, don't bother warning */
-               if (file
-                   && PERL_FILE_IS_ABSOLUTE(file)
 #ifdef MACOS_TRADITIONAL
-                   && (instr(file, ":lib:")
+#   define LIB_COMPONENT ":lib:"
 #else
-                   && (instr(file, "/lib/")
+#   define LIB_COMPONENT "/lib/"
 #endif
-                   || instr(file, ".pm")))
+               if (file
+                   && PERL_FILE_IS_ABSOLUTE(file)
+                   && (instr(file, LIB_COMPONENT) || instr(file, ".pm")))
                {
                    continue;
                }

==== //depot/maint-5.8/perl/op.c#117 (text) ====
Index: perl/op.c
--- perl/op.c#116~26597~        2006-01-03 04:14:54.000000000 -0800
+++ perl/op.c   2006-01-06 14:05:28.000000000 -0800
@@ -128,7 +128,7 @@
 void
 Perl_Slab_Free(pTHX_ void *op)
 {
-    I32 ** const ptr = (I32 **) op;
+    I32 * const * const ptr = (I32 **) op;
     I32 * const slab = ptr[-1];
     assert( ptr-1 > (I32 **) slab );
     assert( ptr < ( (I32 **) slab + PERL_SLAB_SIZE) );
@@ -473,7 +473,7 @@
     case OP_QR:
 clear_pmop:
        {
-           HV *pmstash = PmopSTASH(cPMOPo);
+           HV * const pmstash = PmopSTASH(cPMOPo);
            if (pmstash && SvREFCNT(pmstash)) {
                PMOP *pmop = HvPMROOT(pmstash);
                PMOP *lastpmop = NULL;
@@ -622,7 +622,7 @@
     OP *kid;
 
     /* assumes no premature commitment */
-    if (!o || (o->op_flags & OPf_WANT) || PL_error_count
+    if (!o || PL_error_count || (o->op_flags & OPf_WANT)
         || o->op_type == OP_RETURN)
     {
        return o;
@@ -1576,7 +1576,7 @@
 
     if (for_my) {
        /* Don't force the C<use> if we don't need it. */
-       SV **svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
+       SV * const * const svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
                       sizeof(ATTRSMODULE_PM)-1, 0);
        if (svp && *svp != &PL_sv_undef)
            ;           /* already in %INC */
@@ -1721,7 +1721,7 @@
            yyerror(Perl_form(aTHX_ "Can't declare %s in %s",
                        OP_DESC(o), PL_in_my == KEY_our ? "our" : "my"));
        } else if (attrs) {
-           GV *gv = cGVOPx_gv(cUNOPo->op_first);
+           GV * const gv = cGVOPx_gv(cUNOPo->op_first);
            PL_in_my = FALSE;
            PL_in_my_stash = Nullhv;
            apply_attrs(GvSTASH(gv),
@@ -1817,10 +1817,10 @@
        left->op_type == OP_PADHV)
        && ckWARN(WARN_MISC))
     {
-      const char *desc = PL_op_desc[(right->op_type == OP_SUBST ||
+      const char * const desc = PL_op_desc[(right->op_type == OP_SUBST ||
                             right->op_type == OP_TRANS)
                            ? right->op_type : OP_MATCH];
-      const char *sample = ((left->op_type == OP_RV2AV ||
+      const char * const sample = ((left->op_type == OP_RV2AV ||
                             left->op_type == OP_PADAV)
                            ? "@array" : "%hash");
       Perl_warner(aTHX_ packWARN(WARN_MISC),
@@ -1930,7 +1930,7 @@
 Perl_block_end(pTHX_ I32 floor, OP *seq)
 {
     const int needblockscope = PL_hints & HINT_BLOCK_SCOPE;
-    OP* retval = scalarseq(seq);
+    OP* const retval = scalarseq(seq);
     /* If there were syntax errors, don't try to close a block */
     if (PL_yynerrs) return retval;
     LEAVE_SCOPE(floor);
@@ -1945,7 +1945,7 @@
 S_newDEFSVOP(pTHX)
 {
 #ifdef USE_5005THREADS
-    OP *o = newOP(OP_THREADSV, 0);
+    OP *const o = newOP(OP_THREADSV, 0);
     o->op_targ = find_threadsv("_");
     return o;
 #else
@@ -1986,7 +1986,7 @@
 
        /* Register with debugger */
        if (PERLDB_INTER) {
-           CV *cv = get_cv("DB::postponed", FALSE);
+           CV * const cv = get_cv("DB::postponed", FALSE);
            if (cv) {
                dSP;
                PUSHMARK(SP);
@@ -2318,8 +2318,7 @@
     listop->op_first = first;
     listop->op_last = last;
     if (type == OP_LIST) {
-       OP* pushop;
-       pushop = newOP(OP_PUSHMARK, 0);
+       OP* const pushop = newOP(OP_PUSHMARK, 0);
        pushop->op_sibling = first;
        listop->op_first = pushop;
        listop->op_flags |= OPf_KIDS;
@@ -2427,16 +2426,13 @@
     const U8 *r = (U8*)SvPV_const(rstr, rlen);
     register I32 i;
     register I32 j;
-    I32 del;
-    I32 complement;
-    I32 squash;
     I32 grows = 0;
     register short *tbl;
 
+    const I32 complement = o->op_private & OPpTRANS_COMPLEMENT;
+    const I32 squash     = o->op_private & OPpTRANS_SQUASH;
+    I32 del              = o->op_private & OPpTRANS_DELETE;
     PL_hints |= HINT_BLOCK_SCOPE;
-    complement = o->op_private & OPpTRANS_COMPLEMENT;
-    del                = o->op_private & OPpTRANS_DELETE;
-    squash     = o->op_private & OPpTRANS_SQUASH;
 
     if (SvUTF8(tstr))
         o->op_private |= OPpTRANS_FROM_UTF;
@@ -2445,7 +2441,7 @@
         o->op_private |= OPpTRANS_TO_UTF;
 
     if (o->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) {
-       SV* listsv = newSVpvn("# comment\n",10);
+       SV* const listsv = newSVpvn("# comment\n",10);
        SV* transv = 0;
        const U8* tend = t + tlen;
        const U8* rend = r + rlen;
@@ -2462,8 +2458,8 @@
        I32 bits;
        I32 havefinal = 0;
        U32 final = 0;
-       I32 from_utf    = o->op_private & OPpTRANS_FROM_UTF;
-       I32 to_utf      = o->op_private & OPpTRANS_TO_UTF;
+       const I32 from_utf  = o->op_private & OPpTRANS_FROM_UTF;
+       const I32 to_utf    = o->op_private & OPpTRANS_TO_UTF;
        U8* tsave = NULL;
        U8* rsave = NULL;
 
@@ -2742,19 +2738,16 @@
     pmop->op_pmflags = pmop->op_pmpermflags;
 
 #ifdef USE_ITHREADS
-    {
-        SV* repointer;
-        if(av_len((AV*) PL_regex_pad[0]) > -1) {
-           repointer = av_pop((AV*)PL_regex_pad[0]);
-            pmop->op_pmoffset = SvIV(repointer);
-           SvREPADTMP_off(repointer);
-           sv_setiv(repointer,0);
-        } else {
-            repointer = newSViv(0);
-            av_push(PL_regex_padav,SvREFCNT_inc(repointer));
-            pmop->op_pmoffset = av_len(PL_regex_padav);
-            PL_regex_pad = AvARRAY(PL_regex_padav);
-        }
+    if (av_len((AV*) PL_regex_pad[0]) > -1) {
+       SV * const repointer = av_pop((AV*)PL_regex_pad[0]);
+       pmop->op_pmoffset = SvIV(repointer);
+       SvREPADTMP_off(repointer);
+       sv_setiv(repointer,0);
+    } else {
+       SV * const repointer = newSViv(0);
+       av_push(PL_regex_padav,SvREFCNT_inc(repointer));
+       pmop->op_pmoffset = av_len(PL_regex_padav);
+       PL_regex_pad = AvARRAY(PL_regex_padav);
     }
 #endif
 
@@ -3041,7 +3034,7 @@
     veop = Nullop;
 
     if (version) {
-       SV *vesv = ((SVOP*)version)->op_sv;
+       SV * const vesv = ((SVOP*)version)->op_sv;
 
        if (!arg && !SvNIOKp(vesv)) {
            arg = version;
@@ -3173,9 +3166,9 @@
 void
 Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver, va_list *args)
 {
-    OP *modname, *veop, *imop;
+    OP *veop, *imop;
 
-    modname = newSVOP(OP_CONST, 0, name);
+    OP * const modname = newSVOP(OP_CONST, 0, name);
     modname->op_private |= OPpCONST_BARE;
     if (ver) {
        veop = newSVOP(OP_CONST, 0, ver);
@@ -3404,7 +3397,7 @@
            if ((tmpop = ((LISTOP*)right)->op_first) &&
                tmpop->op_type == OP_PUSHRE)
            {
-               PMOP *pm = (PMOP*)tmpop;
+               PMOP * const pm = (PMOP*)tmpop;
                if (left->op_type == OP_RV2AV &&
                    !(left->op_private & OPpLVAL_INTRO) &&
                    !(o->op_private & OPpASSIGN_COMMON) )
@@ -3514,7 +3507,7 @@
     CopSTASH_set(cop, PL_curstash);
 
     if (PERLDB_LINE && PL_curstash != PL_debstash) {
-       SV ** const svp = av_fetch(CopFILEAV(PL_curcop), (I32)CopLINE(cop), 
FALSE);
+       SV * const * const svp = av_fetch(CopFILEAV(PL_curcop), 
(I32)CopLINE(cop), FALSE);
        if (svp && *svp != &PL_sv_undef ) {
            (void)SvIOK_on(*svp);
            SvIV_set(*svp, PTR2IV(cop));
@@ -3854,7 +3847,7 @@
        next = LINKLIST(cont);
     }
     if (expr) {
-       OP *unstack = newOP(OP_UNSTACK, 0);
+       OP * const unstack = newOP(OP_UNSTACK, 0);
        if (!next)
            next = unstack;
        cont = append_elem(OP_LINESEQ, cont, unstack);
@@ -3955,8 +3948,8 @@
         * set the STACKED flag to indicate that these values are to be
         * treated as min/max values by 'pp_iterinit'.
         */
-       UNOP* flip = (UNOP*)((UNOP*)((BINOP*)expr)->op_first)->op_first;
-       LOGOP* range = (LOGOP*) flip->op_first;
+       UNOP* const flip = (UNOP*)((UNOP*)((BINOP*)expr)->op_first)->op_first;
+       LOGOP* const range = (LOGOP*) flip->op_first;
        OP* const left  = range->op_first;
        OP* const right = left->op_sibling;
        LISTOP* listop;
@@ -4494,7 +4487,6 @@
            SV *sv = NEWSV(0,0);
            SV *tmpstr = sv_newmortal();
            GV *db_postponed = gv_fetchpv("DB::postponed", GV_ADDMULTI, 
SVt_PVHV);
-           CV *pcv;
            HV *hv;
 
            Perl_sv_setpvf(aTHX_ sv, "%s:%ld-%ld",
@@ -4503,14 +4495,15 @@
            gv_efullname3(tmpstr, gv, Nullch);
            hv_store(GvHV(PL_DBsub), SvPVX_const(tmpstr), SvCUR(tmpstr), sv, 0);
            hv = GvHVn(db_postponed);
-           if (HvFILL(hv) > 0 && hv_exists(hv, SvPVX_const(tmpstr), 
SvCUR(tmpstr))
-               && (pcv = GvCV(db_postponed)))
-           {
-               dSP;
-               PUSHMARK(SP);
-               XPUSHs(tmpstr);
-               PUTBACK;
-               call_sv((SV*)pcv, G_DISCARD);
+           if (HvFILL(hv) > 0 && hv_exists(hv, SvPVX_const(tmpstr), 
SvCUR(tmpstr))) {
+               CV * const pcv = GvCV(db_postponed);
+               if (pcv) {
+                   dSP;
+                   PUSHMARK(SP);
+                   XPUSHs(tmpstr);
+                   PUTBACK;
+                   call_sv((SV*)pcv, G_DISCARD);
+               }
            }
        }
 
@@ -5014,7 +5007,7 @@
     o = ck_fun(o);
     o->op_private = 0;
     if (o->op_flags & OPf_KIDS) {
-       OP *kid = cUNOPo->op_first;
+       OP * const kid = cUNOPo->op_first;
        switch (kid->op_type) {
        case OP_ASLICE:
            o->op_flags |= OPf_SPECIAL;
@@ -5106,9 +5099,9 @@
 Perl_ck_exit(pTHX_ OP *o)
 {
 #ifdef VMS
-    HV *table = GvHV(PL_hintgv);
+    HV * const table = GvHV(PL_hintgv);
     if (table) {
-       SV **svp = hv_fetch(table, "vmsish_exit", 11, FALSE);
+       SV * const * const svp = hv_fetch(table, "vmsish_exit", 11, FALSE);
        if (svp && *svp && SvTRUE(*svp))
            o->op_private |= OPpEXIT_VMSISH;
     }
@@ -5274,11 +5267,11 @@
        /* nothing */
     }
     else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
-       SVOP *kid = (SVOP*)cUNOPo->op_first;
+       SVOP * const kid = (SVOP*)cUNOPo->op_first;
 
        if (kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
            STRLEN n_a;
-           OP *newop = newGVOP(type, OPf_REF,
+           OP * const newop = newGVOP(type, OPf_REF,
                gv_fetchpv(SvPVx(kid->op_sv, n_a), TRUE, SVt_PVIO));
            op_free(o);
            o = newop;
@@ -5360,7 +5353,7 @@
                    (kid->op_private & OPpCONST_BARE))
                {
                    char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
-                   OP *newop = newAVREF(newGVOP(OP_GV, 0,
+                   OP * const newop = newAVREF(newGVOP(OP_GV, 0,
                        gv_fetchpv(name, TRUE, SVt_PVAV) ));
                    if (ckWARN2(WARN_DEPRECATED, WARN_SYNTAX))
                        Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED, 
WARN_SYNTAX),
@@ -5380,7 +5373,7 @@
                    (kid->op_private & OPpCONST_BARE))
                {
                    char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
-                   OP *newop = newHVREF(newGVOP(OP_GV, 0,
+                   OP * const newop = newHVREF(newGVOP(OP_GV, 0,
                        gv_fetchpv(name, TRUE, SVt_PVHV) ));
                    if (ckWARN2(WARN_DEPRECATED, WARN_SYNTAX))
                        Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED, 
WARN_SYNTAX),
@@ -5397,7 +5390,7 @@
                break;
            case OA_CVREF:
                {
-                   OP *newop = newUNOP(OP_NULL, 0, kid);
+                   OP * const newop = newUNOP(OP_NULL, 0, kid);
                    kid->op_sibling = 0;
                    linklist(kid);
                    newop->op_next = newop;
@@ -5463,12 +5456,11 @@
                            else if (kid->op_type == OP_AELEM
                                     || kid->op_type == OP_HELEM)
                            {
-                                OP *op;
-
+                                OP *op = ((BINOP*)kid)->op_first;
                                 name = 0;
-                                if ((op = ((BINOP*)kid)->op_first)) {
+                                if (op) {
                                      SV *tmpstr = Nullsv;
-                                     const char *a =
+                                     const char * const a =
                                           kid->op_type == OP_AELEM ?
                                           "[]" : "{}";
                                      if (((op->op_type == OP_RV2AV) ||
@@ -5476,7 +5468,7 @@
                                          (op = ((UNOP*)op)->op_first) &&
                                          (op->op_type == OP_GV)) {
                                           /* packagevar $a[] or $h{} */
-                                          GV *gv = cGVOPx_gv(op);
+                                          GV * const gv = cGVOPx_gv(op);
                                           if (gv)
                                                tmpstr =
                                                     Perl_newSVpvf(aTHX_
@@ -5487,7 +5479,7 @@
                                      else if (op->op_type == OP_PADAV
                                               || op->op_type == OP_PADHV) {
                                           /* lexicalvar $a[] or $h{} */
-                                          const char *padname =
+                                          const char * const padname =
                                                PAD_COMPNAME_PV(op->op_targ);
                                           if (padname)
                                                tmpstr =
@@ -5495,7 +5487,6 @@
                                                                   "%s%c...%c",
                                                                   padname + 1,
                                                                   a[0], a[1]);
-                                          
                                      }
                                      if (tmpstr) {
                                           name = SvPV_const(tmpstr, len);
@@ -5774,7 +5765,7 @@
        /* Cannot steal the second time! */
        && !(kid->op_private & OPpTARGET_MY))
     {
-       OP *kkid = kid->op_sibling;
+       OP * const kkid = kid->op_sibling;
 
        /* Can just relocate the target. */
        if (kkid && kkid->op_type == OP_PADSV
@@ -5793,7 +5784,7 @@
     }
     /* optimise C<my $x = undef> to C<my $x> */
     if (kid->op_type == OP_UNDEF) {
-       OP *kkid = kid->op_sibling;
+       OP * const kkid = kid->op_sibling;
        if (kkid && kkid->op_type == OP_PADSV
                && (kkid->op_private & OPpLVAL_INTRO))
        {
@@ -5817,7 +5808,7 @@
 OP *
 Perl_ck_method(pTHX_ OP *o)
 {
-    OP *kid = cUNOPo->op_first;
+    OP * const kid = cUNOPo->op_first;
     if (kid->op_type == OP_CONST) {
        SV* sv = kSVOP->op_sv;
        if (!(strchr(SvPVX_const(sv), ':') || strchr(SvPVX_const(sv), '\''))) {
@@ -5845,13 +5836,11 @@
 OP *
 Perl_ck_open(pTHX_ OP *o)
 {
-    HV *table = GvHV(PL_hintgv);
+    HV * const table = GvHV(PL_hintgv);
     if (table) {
-       SV **svp;
-       I32 mode;
-       svp = hv_fetch(table, "open_IN", 7, FALSE);
+       SV **svp = hv_fetch(table, "open_IN", 7, FALSE);
        if (svp && *svp) {
-           mode = mode_from_discipline(*svp);
+           const I32 mode = mode_from_discipline(*svp);
            if (mode & O_BINARY)
                o->op_private |= OPpOPEN_IN_RAW;
            else if (mode & O_TEXT)
@@ -5860,7 +5849,7 @@
 
        svp = hv_fetch(table, "open_OUT", 8, FALSE);
        if (svp && *svp) {
-           mode = mode_from_discipline(*svp);
+           const I32 mode = mode_from_discipline(*svp);
            if (mode & O_BINARY)
                o->op_private |= OPpOPEN_OUT_RAW;
            else if (mode & O_TEXT)
@@ -5872,8 +5861,8 @@
     {
         /* In case of three-arg dup open remove strictness
          * from the last arg if it is a bareword. */
-        OP *first = cLISTOPx(o)->op_first; /* The pushmark. */
-        OP *last  = cLISTOPx(o)->op_last;  /* The bareword. */
+        OP * const first = cLISTOPx(o)->op_first; /* The pushmark. */
+        OP * const last  = cLISTOPx(o)->op_last;  /* The bareword. */
         OP *oa;
         const char *mode;
 
@@ -5910,10 +5899,10 @@
     GV* gv;
 
     if (o->op_flags & OPf_KIDS) {      /* Shall we supply missing .pm? */
-       SVOP *kid = (SVOP*)cUNOPo->op_first;
+       SVOP * const kid = (SVOP*)cUNOPo->op_first;
 
        if (kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
-           SV *sv = kid->op_sv;
+           SV * const sv = kid->op_sv;
            U32 was_readonly = SvREADONLY(sv);
            char *s;
 
@@ -5945,7 +5934,7 @@
        gv = gv_fetchpv("CORE::GLOBAL::require", FALSE, SVt_PVCV);
 
     if (gv && GvCVu(gv) && GvIMPORTED_CV(gv)) {
-       OP *kid = cUNOPo->op_first;
+       OP * const kid = cUNOPo->op_first;
        cUNOPo->op_first = 0;
        op_free(o);
        return ck_subr(newUNOP(OP_ENTERSUB, OPf_STACKED,
@@ -6179,7 +6168,7 @@
     }
 
     if (kid->op_type != OP_MATCH || kid->op_flags & OPf_STACKED) {
-       OP *sibl = kid->op_sibling;
+       OP * const sibl = kid->op_sibling;
        kid->op_sibling = 0;
        kid = pmruntime( newPMOP(OP_MATCH, OPf_SPECIAL), kid, Nullop);
        if (cLISTOPo->op_first == cLISTOPo->op_last)
@@ -6217,7 +6206,7 @@
 OP *
 Perl_ck_join(pTHX_ OP *o)
 {
-    const OP *kid = cLISTOPo->op_first->op_sibling;
+    const OP * const kid = cLISTOPo->op_first->op_sibling;
     if (kid && kid->op_type == OP_MATCH) {
        if (ckWARN(WARN_SYNTAX)) {
             const REGEXP *re = PM_GETRE(kPMOP);
@@ -6267,7 +6256,7 @@
        if (o2->op_type == OP_CONST)
            o2->op_private &= ~OPpCONST_STRICT;
        else if (o2->op_type == OP_LIST) {
-           OP *o = ((UNOP*)o2)->op_first->op_sibling;
+           OP * const o = ((UNOP*)o2)->op_first->op_sibling;
            if (o && o->op_type == OP_CONST)
                o->op_private &= ~OPpCONST_STRICT;
        }
@@ -6323,9 +6312,9 @@
                                (gvop = ((UNOP*)gvop)->op_first) &&
                                gvop->op_type == OP_GV)
                            {
-                               GV *gv = cGVOPx_gv(gvop);
-                               OP *sibling = o2->op_sibling;
-                               SV *n = newSVpvn("",0);
+                               GV * const gv = cGVOPx_gv(gvop);
+                               OP * const sibling = o2->op_sibling;
+                               SV * const n = newSVpvn("",0);
                                op_free(o2);
                                gv_fullname4(n, gv, "", FALSE);
                                o2 = newSVOP(OP_CONST, 0, n);
@@ -6406,8 +6395,8 @@
                    break;
                wrapref:
                    {
-                       OP* kid = o2;
-                       OP* sib = kid->op_sibling;
+                       OP* const kid = o2;
+                       OP* const sib = kid->op_sibling;
                        kid->op_sibling = 0;
                        o2 = newUNOP(OP_REFGEN, 0, kid);
                        o2->op_sibling = sib;
@@ -6437,7 +6426,7 @@
        mod(o2, OP_ENTERSUB);
        prev = o2;
        o2 = o2->op_sibling;
-    }
+    } /* while */
     if (proto && !optional &&
          (*proto && *proto != '@' && *proto != '%' && *proto != ';'))
        return too_few_arguments(o, gv_ename(namegv));
@@ -6646,10 +6635,10 @@
                }
            }
            else if ((o->op_private & OPpEARLY_CV) && ckWARN(WARN_PROTOTYPE)) {
-               GV *gv = cGVOPo_gv;
+               GV * const gv = cGVOPo_gv;
                if (SvTYPE(gv) == SVt_PVGV && GvCV(gv) && 
SvPVX_const(GvCV(gv))) {
                    /* XXX could check prototype here instead of just carping */
-                   SV *sv = sv_newmortal();
+                   SV * const sv = sv_newmortal();
                    gv_efullname3(sv, gv, Nullch);
                    Perl_warner(aTHX_ packWARN(WARN_PROTOTYPE),
                                "%"SVf"() called too early to check prototype",
@@ -6859,22 +6848,22 @@
 
        case OP_SORT: {
            /* will point to RV2AV or PADAV op on LHS/RHS of assign */
-           OP *oleft, *oright;
+           OP *oleft;
            OP *o2;
 
            /* check that RHS of sort is a single plain array */
-           oright = cUNOPo->op_first;
+           OP *oright = cUNOPo->op_first;
            if (!oright || oright->op_type != OP_PUSHMARK)
                break;
 
            /* reverse sort ... can be optimised.  */
            if (!cUNOPo->op_sibling) {
                /* Nothing follows us on the list. */
-               OP *reverse = o->op_next;
+               OP * const reverse = o->op_next;
 
                if (reverse->op_type == OP_REVERSE &&
                    (reverse->op_flags & OPf_WANT) == OPf_WANT_LIST) {
-                   OP *pushmark = cUNOPx(reverse)->op_first;
+                   OP * const pushmark = cUNOPx(reverse)->op_first;
                    if (pushmark && (pushmark->op_type == OP_PUSHMARK)
                        && (cUNOPx(pushmark)->op_sibling == o)) {
                        /* reverse -> pushmark -> sort */

==== //depot/maint-5.8/perl/pad.c#46 (text) ====
Index: perl/pad.c
--- perl/pad.c#45~26683~        2006-01-06 13:04:51.000000000 -0800
+++ perl/pad.c  2006-01-06 14:05:28.000000000 -0800
@@ -416,7 +416,7 @@
        retval = AvFILLp(PL_comppad);
     }
     else {
-       SV ** const names = AvARRAY(PL_comppad_name);
+       SV * const * const names = AvARRAY(PL_comppad_name);
         const SSize_t names_fill = AvFILLp(PL_comppad_name);
        for (;;) {
            /*
@@ -957,7 +957,7 @@
 Perl_pad_leavemy(pTHX)
 {
     I32 off;
-    SV ** const svp = AvARRAY(PL_comppad_name);
+    SV * const * const svp = AvARRAY(PL_comppad_name);
 
     PL_pad_reset_pending = FALSE;
 
@@ -1099,7 +1099,7 @@
        av_store(PL_comppad_name, AvFILLp(PL_comppad), Nullsv);
 
     if (type == padtidy_SUBCLONE) {
-       SV ** const namep = AvARRAY(PL_comppad_name);
+       SV * const * const namep = AvARRAY(PL_comppad_name);
        PADOFFSET ix;
        for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
            SV *namesv;
@@ -1449,7 +1449,7 @@
     LEAVE;
 
     if (CvCONST(cv)) {
-       SV* const_sv = op_const_sv(CvSTART(cv), cv);
+       SV* const const_sv = op_const_sv(CvSTART(cv), cv);
        assert(const_sv);
        /* constant sub () { $x } closing over $x - see lib/constant.pm */
        SvREFCNT_dec(cv);
@@ -1479,7 +1479,7 @@
     SV ** const namepad = AvARRAY(comppad_name);
     SV ** const curpad = AvARRAY(comppad);
     for (ix = AvFILLp(comppad_name); ix > 0; ix--) {
-        const SV *namesv = namepad[ix];
+        const SV * const namesv = namepad[ix];
        if (namesv && namesv != &PL_sv_undef
            && *SvPVX_const(namesv) == '&')
        {
@@ -1560,7 +1560,7 @@
 HV *
 Perl_pad_compname_type(pTHX_ const PADOFFSET po)
 {
-    SV** const av = av_fetch(PL_comppad_name, po, FALSE);
+    SV* const * const av = av_fetch(PL_comppad_name, po, FALSE);
     if ( SvFLAGS(*av) & SVpad_TYPED ) {
         return SvSTASH(*av);
     }

==== //depot/maint-5.8/perl/pp_sort.c#30 (text) ====
Index: perl/pp_sort.c
--- perl/pp_sort.c#29~26627~    2006-01-03 12:17:14.000000000 -0800
+++ perl/pp_sort.c      2006-01-06 14:05:28.000000000 -0800
@@ -355,11 +355,11 @@
 STATIC void
 S_mergesortsv(pTHX_ gptr *base, size_t nmemb, SVCOMPARE_t cmp, U32 flags)
 {
-    IV i, run, runs, offset;
+    IV i, run, offset;
     I32 sense, level;
+    register gptr *f1, *f2, *t, *b, *p;
     int iwhich;
-    register gptr *f1, *f2, *t, *b, *p, *tp2, *l1, *l2, *q;
-    gptr *aux, *list1, *list2;
+    gptr *aux;
     gptr *p1;
     gptr small[SMALLSORT];
     gptr *which[3];
@@ -388,11 +388,14 @@
         * is needed at the next level up.  Hop up a level, and,
         * as long as stackp->runs is 0, keep merging.
         */
-       if ((runs = stackp->runs) == 0) {
+       IV runs = stackp->runs;
+       if (runs == 0) {
+           gptr *list1, *list2;
            iwhich = level & 1;
            list1 = which[iwhich];              /* area where runs are now */
            list2 = which[++iwhich];            /* area for merged runs */
            do {
+               register gptr *l1, *l2, *tp2;
                offset = stackp->offset;
                f1 = p1 = list1 + offset;               /* start of first run */
                p = tp2 = list2 + offset;       /* where merged run will go */
@@ -422,7 +425,7 @@
                    ** and -1 when equality should look high.
                    */
 
-
+                   register gptr *q;
                    if (cmp(aTHX_ *f1, *f2) <= 0) {
                        q = f2; b = f1; t = l1;
                        sense = -1;
@@ -1720,7 +1723,7 @@
        av_extend(av, max);
        for (i=0; i < max; i++) {
            SV * const sv = base[i];
-           SV **didstore = av_store(av, i, sv);
+           SV ** const didstore = av_store(av, i, sv);
            if (SvSMAGICAL(sv))
                mg_set(sv);
            if (!didstore)

==== //depot/maint-5.8/perl/proto.h#108 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#107~26682~     2006-01-06 12:10:24.000000000 -0800
+++ perl/proto.h        2006-01-06 14:05:28.000000000 -0800
@@ -217,8 +217,7 @@
 
 PERL_CALLCONV void     Perl_croak(pTHX_ const char* pat, ...)
                        __attribute__noreturn__
-                       __attribute__format__(__printf__,pTHX_1,pTHX_2)
-                       __attribute__nonnull__(pTHX_1);
+                       __attribute__format__(__printf__,pTHX_1,pTHX_2);
 
 PERL_CALLCONV void     Perl_vcroak(pTHX_ const char* pat, va_list* args)
                        __attribute__noreturn__
@@ -2073,10 +2072,7 @@
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV I32      Perl_sv_eq(pTHX_ SV* sv1, SV* sv2)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-
+PERL_CALLCONV I32      Perl_sv_eq(pTHX_ SV* sv1, SV* sv2);
 PERL_CALLCONV void     Perl_sv_free(pTHX_ SV* sv);
 PERL_CALLCONV void     Perl_sv_free_arenas(pTHX);
 PERL_CALLCONV char*    Perl_sv_gets(pTHX_ SV* sv, PerlIO* fp, I32 append)

==== //depot/maint-5.8/perl/regcomp.c#62 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#61~26111~    2005-11-13 10:09:54.000000000 -0800
+++ perl/regcomp.c      2006-01-06 14:05:28.000000000 -0800
@@ -425,7 +425,7 @@
        MJD_OFFSET_DEBUG(("** (%d) offset of node %d is %d.\n",         \
                __LINE__, (node), (byte)));                             \
        if((node) < 0) {                                                \
-           Perl_croak(aTHX_ "value of node is %d in Offset macro", node); \
+           Perl_croak(aTHX_ "value of node is %d in Offset macro", 
(int)(node)); \
        } else {                                                        \
            RExC_offsets[2*(node)-1] = (byte);                          \
        }                                                               \
@@ -439,9 +439,9 @@
 #define Set_Node_Length_To_R(node,len) STMT_START {                    \
     if (! SIZE_ONLY) {                                                 \
        MJD_OFFSET_DEBUG(("** (%d) size of node %d is %d.\n",           \
-               __LINE__, (node), (len)));                              \
+               __LINE__, (int)(node), (int)(len)));                    \
        if((node) < 0) {                                                \
-           Perl_croak(aTHX_ "value of node is %d in Length macro", node); \
+           Perl_croak(aTHX_ "value of node is %d in Length macro", 
(int)(node)); \
        } else {                                                        \
            RExC_offsets[2*(node)] = (len);                             \
        }                                                               \

==== //depot/maint-5.8/perl/sv.c#203 (text) ====
Index: perl/sv.c
--- perl/sv.c#202~26683~        2006-01-06 13:04:51.000000000 -0800
+++ perl/sv.c   2006-01-06 14:05:28.000000000 -0800
@@ -1846,7 +1846,7 @@
           pv = sv_uni_display(dsv, sv, 10, 0);
      } else {
          char *d = tmpbuf;
-         char *limit = tmpbuf + sizeof(tmpbuf) - 8;
+         const char * const limit = tmpbuf + sizeof(tmpbuf) - 8;
          /* each *s can expand to 4 chars + "...\0",
             i.e. need room for 8 chars */
        
@@ -2095,11 +2095,13 @@
     }
     if (SvTHINKFIRST(sv)) {
        if (SvROK(sv)) {
-         SV* tmpstr;
-          if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)) &&
-                (!SvROK(tmpstr) || (SvRV(tmpstr) != SvRV(sv))))
-             return SvIV(tmpstr);
-         return PTR2IV(SvRV(sv));
+           if (SvAMAGIC(sv)) {
+               SV * const tmpstr=AMG_CALLun(sv,numer);
+               if (tmpstr && (!SvROK(tmpstr) || (SvRV(tmpstr) != SvRV(sv)))) {
+                   return SvIV(tmpstr);
+               }
+           }
+           return PTR2IV(SvRV(sv));
        }
        if (SvREADONLY(sv) && SvFAKE(sv)) {
            sv_force_normal(sv);
@@ -10050,8 +10052,7 @@
         if(SvTYPE(sstr) == SVt_PVHV &&
           (hvname = HvNAME_get(sstr))) {
            /** don't clone stashes if they already exist **/
-           HV* old_stash = gv_stashpv(hvname,0);
-           return (SV*) old_stash;
+           return (SV*)gv_stashpv(hvname,0);
         }
     }
 

==== //depot/maint-5.8/perl/toke.c#104 (text) ====
Index: perl/toke.c
--- perl/toke.c#103~26678~      2006-01-06 10:09:03.000000000 -0800
+++ perl/toke.c 2006-01-06 14:05:28.000000000 -0800
@@ -417,12 +417,12 @@
            if (t < PL_bufptr && isSPACE(*t))
                Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                        "\t(Do you need to predeclare %.*s?)\n",
-                   t - PL_oldoldbufptr, PL_oldoldbufptr);
+                   (int)(t - PL_oldoldbufptr), PL_oldoldbufptr);
        }
        else {
            assert(s >= oldbp);
            Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
-                   "\t(Missing operator before %.*s?)\n", s - oldbp, oldbp);
+                   "\t(Missing operator before %.*s?)\n", (int)(s - oldbp), 
oldbp);
        }
     }
     PL_bufptr = oldbp;
@@ -2836,7 +2836,7 @@
                     * at least, set argv[0] to the basename of the Perl
                     * interpreter. So, having found "#!", we'll set it right.
                     */
-                   SV *x = GvSV(gv_fetchpv("\030", TRUE, SVt_PV)); /* $^X */
+                   SV * const x = GvSV(gv_fetchpv("\030", TRUE, SVt_PV)); /* 
$^X */
                    assert(SvPOK(x) || SvGMAGICAL(x));
                    if (sv_eq(x, CopFILESV(PL_curcop))) {
                        sv_setpvn(x, ipath, ipathend - ipath);
@@ -4887,9 +4887,10 @@
                    /* [perl #16184] */
                    && !(t[0] == '=' && t[1] == '>')
                ) {
+                   int len = (int)(d-s);
                    Perl_warner(aTHX_ packWARN(WARN_PRECEDENCE),
                           "Precedence problem: open %.*s should be open(%.*s)",
-                           d - s, s, d - s, s);
+                           len, s, len, s);
                }
            }
            LOP(OP_OPEN,XTERM);

==== //depot/maint-5.8/perl/utf8.c#48 (text) ====
Index: perl/utf8.c
--- perl/utf8.c#47~26683~       2006-01-06 13:04:51.000000000 -0800
+++ perl/utf8.c 2006-01-06 14:05:28.000000000 -0800
@@ -560,10 +560,12 @@
            if (s == s0)
                Perl_sv_catpvf(aTHX_ sv, "(unexpected non-continuation byte 
0x%02"UVxf", immediately after start byte 0x%02"UVxf")",
                            (UV)s[1], startbyte);
-           else
+           else {
+               const int len = (int)(s-s0);
                Perl_sv_catpvf(aTHX_ sv, "(unexpected non-continuation byte 
0x%02"UVxf", %d byte%s after start byte 0x%02"UVxf", expected %d bytes)",
-                           (UV)s[1], s - s0, s - s0 > 1 ? "s" : "", startbyte, 
(int)expectlen);
-             
+                           (UV)s[1], len, len > 1 ? "s" : "", startbyte, 
(int)expectlen);
+           }
+
            break;
        case UTF8_WARN_FE_FF:
            Perl_sv_catpvf(aTHX_ sv, "(byte 0x%02"UVxf")", uv);
End of Patch.

Reply via email to