Test changes
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 680b825..a0309de 100644 (file)
--- a/op.c
+++ b/op.c
@@ -42,8 +42,7 @@ static PADOFFSET pad_findlex _((char* name, PADOFFSET newoff, U32 seq,
        CV* startcv, I32 cx_ix));
 
 static char*
-gv_ename(gv)
-GV* gv;
+gv_ename(GV *gv)
 {
     SV* tmpsv = sv_newmortal();
     gv_efullname3(tmpsv, gv, Nullch);
@@ -51,8 +50,7 @@ GV* gv;
 }
 
 static OP *
-no_fh_allowed(o)
-OP *o;
+no_fh_allowed(OP *o)
 {
     yyerror(form("Missing comma after first argument to %s function",
                 op_desc[o->op_type]));
@@ -60,37 +58,28 @@ OP *o;
 }
 
 static OP *
-too_few_arguments(o, name)
-OP* o;
-char* name;
+too_few_arguments(OP *o, char *name)
 {
     yyerror(form("Not enough arguments for %s", name));
     return o;
 }
 
 static OP *
-too_many_arguments(o, name)
-OP *o;
-char* name;
+too_many_arguments(OP *o, char *name)
 {
     yyerror(form("Too many arguments for %s", name));
     return o;
 }
 
 static void
-bad_type(n, t, name, kid)
-I32 n;
-char *t;
-char *name;
-OP *kid;
+bad_type(I32 n, char *t, char *name, OP *kid)
 {
     yyerror(form("Type of arg %d to %s must be %s (not %s)",
                 (int)n, name, t, op_desc[kid->op_type]));
 }
 
 void
-assertref(o)
-OP *o;
+assertref(OP *o)
 {
     int type = o->op_type;
     if (type != OP_AELEM && type != OP_HELEM) {
@@ -104,8 +93,7 @@ OP *o;
 /* "register" allocation */
 
 PADOFFSET
-pad_allocmy(name)
-char *name;
+pad_allocmy(char *name)
 {
     dTHR;
     PADOFFSET off;
@@ -295,8 +283,7 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix)
 }
 
 PADOFFSET
-pad_findmy(name)
-char *name;
+pad_findmy(char *name)
 {
     dTHR;
     I32 off;
@@ -345,8 +332,7 @@ char *name;
 }
 
 void
-pad_leavemy(fill)
-I32 fill;
+pad_leavemy(I32 fill)
 {
     I32 off;
     SV **svp = AvARRAY(comppad_name);
@@ -365,9 +351,7 @@ I32 fill;
 }
 
 PADOFFSET
-pad_alloc(optype,tmptype)      
-I32 optype;
-U32 tmptype;
+pad_alloc(I32 optype, U32 tmptype)
 {
     dTHR;
     SV *sv;
@@ -488,7 +472,7 @@ pad_swipe(PADOFFSET po)
 }
 
 void
-pad_reset()
+pad_reset(void)
 {
     dTHR;
     register I32 po;
@@ -514,8 +498,7 @@ pad_reset()
 /* Destructor */
 
 void
-op_free(o)
-OP *o;
+op_free(OP *o)
 {
     register OP *kid, *nextkid;
 
@@ -580,8 +563,7 @@ OP *o;
 }
 
 static void
-null(o)
-OP* o;
+null(OP *o)
 {
     if (o->op_type != OP_NULL && o->op_targ > 0)
        pad_free(o->op_targ);
@@ -595,8 +577,7 @@ OP* o;
 #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o))
 
 OP *
-linklist(o)
-OP *o;
+linklist(OP *o)
 {
     register OP *kid;
 
@@ -620,8 +601,7 @@ OP *o;
 }
 
 OP *
-scalarkids(o)
-OP *o;
+scalarkids(OP *o)
 {
     OP *kid;
     if (o && o->op_flags & OPf_KIDS) {
@@ -632,8 +612,7 @@ OP *o;
 }
 
 static OP *
-scalarboolean(o)
-OP *o;
+scalarboolean(OP *o)
 {
     if (dowarn &&
        o->op_type == OP_SASSIGN && cBINOPo->op_first->op_type == OP_CONST) {
@@ -649,8 +628,7 @@ OP *o;
 }
 
 OP *
-scalar(o)
-OP *o;
+scalar(OP *o)
 {
     OP *kid;
 
@@ -716,8 +694,7 @@ OP *o;
 }
 
 OP *
-scalarvoid(o)
-OP *o;
+scalarvoid(OP *o)
 {
     OP *kid;
     char* useless = 0;
@@ -900,8 +877,7 @@ OP *o;
 }
 
 OP *
-listkids(o)
-OP *o;
+listkids(OP *o)
 {
     OP *kid;
     if (o && o->op_flags & OPf_KIDS) {
@@ -912,8 +888,7 @@ OP *o;
 }
 
 OP *
-list(o)
-OP *o;
+list(OP *o)
 {
     OP *kid;
 
@@ -979,8 +954,7 @@ OP *o;
 }
 
 OP *
-scalarseq(o)
-OP *o;
+scalarseq(OP *o)
 {
     OP *kid;
 
@@ -1008,9 +982,7 @@ OP *o;
 }
 
 static OP *
-modkids(o, type)
-OP *o;
-I32 type;
+modkids(OP *o, I32 type)
 {
     OP *kid;
     if (o && o->op_flags & OPf_KIDS) {
@@ -1023,9 +995,7 @@ I32 type;
 static I32 modcount;
 
 OP *
-mod(o, type)
-OP *o;
-I32 type;
+mod(OP *o, I32 type)
 {
     dTHR;
     OP *kid;
@@ -1218,9 +1188,7 @@ I32 type;
 }
 
 static bool
-scalar_mod_type(o, type)
-OP *o;
-I32 type;
+scalar_mod_type(OP *o, I32 type)
 {
     switch (type) {
     case OP_SASSIGN:
@@ -1264,9 +1232,7 @@ I32 type;
 }
 
 OP *
-refkids(o, type)
-OP *o;
-I32 type;
+refkids(OP *o, I32 type)
 {
     OP *kid;
     if (o && o->op_flags & OPf_KIDS) {
@@ -1277,9 +1243,7 @@ I32 type;
 }
 
 OP *
-ref(o, type)
-OP *o;
-I32 type;
+ref(OP *o, I32 type)
 {
     OP *kid;
 
@@ -1288,7 +1252,7 @@ I32 type;
 
     switch (o->op_type) {
     case OP_ENTERSUB:
-       if ((type == OP_DEFINED) &&
+       if ((type == OP_DEFINED || type == OP_LOCK) &&
            !(o->op_flags & OPf_STACKED)) {
            o->op_type = OP_RV2CV;             /* entersub => rv2cv */
            o->op_ppaddr = ppaddr[OP_RV2CV];
@@ -1360,8 +1324,7 @@ I32 type;
 }
 
 OP *
-my(o)
-OP *o;
+my(OP *o)
 {
     OP *kid;
     I32 type;
@@ -1388,8 +1351,7 @@ OP *o;
 }
 
 OP *
-sawparens(o)
-OP *o;
+sawparens(OP *o)
 {
     if (o)
        o->op_flags |= OPf_PARENS;
@@ -1397,10 +1359,7 @@ OP *o;
 }
 
 OP *
-bind_match(type, left, right)
-I32 type;
-OP *left;
-OP *right;
+bind_match(I32 type, OP *left, OP *right)
 {
     OP *o;
 
@@ -1438,8 +1397,7 @@ OP *right;
 }
 
 OP *
-invert(o)
-OP *o;
+invert(OP *o)
 {
     if (!o)
        return o;
@@ -1448,8 +1406,7 @@ OP *o;
 }
 
 OP *
-scope(o)
-OP *o;
+scope(OP *o)
 {
     if (o) {
        if (o->op_flags & OPf_PARENS || PERLDB_NOOPT || tainting) {
@@ -1476,8 +1433,7 @@ OP *o;
 }
 
 int
-block_start(full)
-int full;
+block_start(int full)
 {
     dTHR;
     int retval = savestack_ix;
@@ -1501,9 +1457,7 @@ int full;
 }
 
 OP*
-block_end(floor, seq)
-I32 floor;
-OP* seq;
+block_end(I32 floor, OP *seq)
 {
     dTHR;
     int needblockscope = hints & HINT_BLOCK_SCOPE;
@@ -1518,8 +1472,7 @@ OP* seq;
 }
 
 void
-newPROG(o)
-OP *o;
+newPROG(OP *o)
 {
     dTHR;
     if (in_eval) {
@@ -1553,9 +1506,7 @@ OP *o;
 }
 
 OP *
-localize(o, lex)
-OP *o;
-I32 lex;
+localize(OP *o, I32 lex)
 {
     if (o->op_flags & OPf_PARENS)
        list(o);
@@ -1577,8 +1528,7 @@ I32 lex;
 }
 
 OP *
-jmaybe(o)
-OP *o;
+jmaybe(OP *o)
 {
     if (o->op_type == OP_LIST) {
        o = convert(OP_JOIN, 0,
@@ -1590,8 +1540,7 @@ OP *o;
 }
 
 OP *
-fold_constants(o)
-register OP *o;
+fold_constants(register OP *o)
 {
     dTHR;
     register OP *curop;
@@ -1684,8 +1633,7 @@ register OP *o;
 }
 
 OP *
-gen_constant_list(o)
-register OP *o;
+gen_constant_list(register OP *o)
 {
     dTHR;
     register OP *curop;
@@ -1713,10 +1661,7 @@ register OP *o;
 }
 
 OP *
-convert(type, flags, o)
-I32 type;
-I32 flags;
-OP* o;
+convert(I32 type, I32 flags, OP *o)
 {
     OP *kid;
     OP *last = 0;
@@ -1750,10 +1695,7 @@ OP* o;
 /* List constructors */
 
 OP *
-append_elem(type, first, last)
-I32 type;
-OP* first;
-OP* last;
+append_elem(I32 type, OP *first, OP *last)
 {
     if (!first)
        return last;
@@ -1776,10 +1718,7 @@ OP* last;
 }
 
 OP *
-append_list(type, first, last)
-I32 type;
-LISTOP* first;
-LISTOP* last;
+append_list(I32 type, LISTOP *first, LISTOP *last)
 {
     if (!first)
        return (OP*)last;
@@ -1804,10 +1743,7 @@ LISTOP* last;
 }
 
 OP *
-prepend_elem(type, first, last)
-I32 type;
-OP* first;
-OP* last;
+prepend_elem(I32 type, OP *first, OP *last)
 {
     if (!first)
        return last;
@@ -1838,14 +1774,13 @@ OP* last;
 /* Constructors */
 
 OP *
-newNULLLIST()
+newNULLLIST(void)
 {
     return newOP(OP_STUB, 0);
 }
 
 OP *
-force_list(o)
-OP *o;
+force_list(OP *o)
 {
     if (!o || o->op_type != OP_LIST)
        o = newLISTOP(OP_LIST, 0, o, Nullop);
@@ -1854,11 +1789,7 @@ OP *o;
 }
 
 OP *
-newLISTOP(type, flags, first, last)
-I32 type;
-I32 flags;
-OP* first;
-OP* last;
+newLISTOP(I32 type, I32 flags, OP *first, OP *last)
 {
     LISTOP *listop;
 
@@ -1893,9 +1824,7 @@ OP* last;
 }
 
 OP *
-newOP(type, flags)
-I32 type;
-I32 flags;
+newOP(I32 type, I32 flags)
 {
     OP *o;
     Newz(1101, o, 1, OP);
@@ -1913,10 +1842,7 @@ I32 flags;
 }
 
 OP *
-newUNOP(type, flags, first)
-I32 type;
-I32 flags;
-OP* first;
+newUNOP(I32 type, I32 flags, OP *first)
 {
     UNOP *unop;
 
@@ -1940,11 +1866,7 @@ OP* first;
 }
 
 OP *
-newBINOP(type, flags, first, last)
-I32 type;
-I32 flags;
-OP* first;
-OP* last;
+newBINOP(I32 type, I32 flags, OP *first, OP *last)
 {
     BINOP *binop;
     Newz(1101, binop, 1, BINOP);
@@ -1975,10 +1897,7 @@ OP* last;
 }
 
 OP *
-pmtrans(o, expr, repl)
-OP *o;
-OP *expr;
-OP *repl;
+pmtrans(OP *o, OP *expr, OP *repl)
 {
     SV *tstr = ((SVOP*)expr)->op_sv;
     SV *rstr = ((SVOP*)repl)->op_sv;
@@ -1988,13 +1907,13 @@ OP *repl;
     register U8 *r = (U8*)SvPV(rstr, rlen);
     register I32 i;
     register I32 j;
-    I32 delete;
+    I32 Delete;
     I32 complement;
     register short *tbl;
 
     tbl = (short*)cPVOPo->op_pv;
     complement = o->op_private & OPpTRANS_COMPLEMENT;
-    delete     = o->op_private & OPpTRANS_DELETE;
+    Delete     = o->op_private & OPpTRANS_DELETE;
     /* squash  = o->op_private & OPpTRANS_SQUASH; */
 
     if (complement) {
@@ -2004,7 +1923,7 @@ OP *repl;
        for (i = 0, j = 0; i < 256; i++) {
            if (!tbl[i]) {
                if (j >= rlen) {
-                   if (delete)
+                   if (Delete)
                        tbl[i] = -2;
                    else if (rlen)
                        tbl[i] = r[j-1];
@@ -2017,14 +1936,14 @@ OP *repl;
        }
     }
     else {
-       if (!rlen && !delete) {
+       if (!rlen && !Delete) {
            r = t; rlen = tlen;
        }
        for (i = 0; i < 256; i++)
            tbl[i] = -1;
        for (i = 0, j = 0; i < tlen; i++,j++) {
            if (j >= rlen) {
-               if (delete) {
+               if (Delete) {
                    if (tbl[t[i]] == -1)
                        tbl[t[i]] = -2;
                    continue;
@@ -2042,9 +1961,7 @@ OP *repl;
 }
 
 OP *
-newPMOP(type, flags)
-I32 type;
-I32 flags;
+newPMOP(I32 type, I32 flags)
 {
     dTHR;
     PMOP *pmop;
@@ -2068,10 +1985,7 @@ I32 flags;
 }
 
 OP *
-pmruntime(o, expr, repl)
-OP *o;
-OP *expr;
-OP *repl;
+pmruntime(OP *o, OP *expr, OP *repl)
 {
     PMOP *pm;
     LOGOP *rcop;
@@ -2187,10 +2101,7 @@ OP *repl;
 }
 
 OP *
-newSVOP(type, flags, sv)
-I32 type;
-I32 flags;
-SV *sv;
+newSVOP(I32 type, I32 flags, SV *sv)
 {
     SVOP *svop;
     Newz(1101, svop, 1, SVOP);
@@ -2207,10 +2118,7 @@ SV *sv;
 }
 
 OP *
-newGVOP(type, flags, gv)
-I32 type;
-I32 flags;
-GV *gv;
+newGVOP(I32 type, I32 flags, GV *gv)
 {
     dTHR;
     GVOP *gvop;
@@ -2228,10 +2136,7 @@ GV *gv;
 }
 
 OP *
-newPVOP(type, flags, pv)
-I32 type;
-I32 flags;
-char *pv;
+newPVOP(I32 type, I32 flags, char *pv)
 {
     PVOP *pvop;
     Newz(1101, pvop, 1, PVOP);
@@ -2248,8 +2153,7 @@ char *pv;
 }
 
 void
-package(o)
-OP *o;
+package(OP *o)
 {
     dTHR;
     SV *sv;
@@ -2274,12 +2178,7 @@ OP *o;
 }
 
 void
-utilize(aver, floor, version, id, arg)
-int aver;
-I32 floor;
-OP *version;
-OP *id;
-OP *arg;
+utilize(int aver, I32 floor, OP *version, OP *id, OP *arg)
 {
     OP *pack;
     OP *meth;
@@ -2355,10 +2254,7 @@ OP *arg;
 }
 
 OP *
-newSLICEOP(flags, subscript, listval)
-I32 flags;
-OP *subscript;
-OP *listval;
+newSLICEOP(I32 flags, OP *subscript, OP *listval)
 {
     return newBINOP(OP_LSLICE, flags,
            list(force_list(subscript)),
@@ -2366,8 +2262,7 @@ OP *listval;
 }
 
 static I32
-list_assignment(o)
-register OP *o;
+list_assignment(register OP *o)
 {
     if (!o)
        return TRUE;
@@ -2401,11 +2296,7 @@ register OP *o;
 }
 
 OP *
-newASSIGNOP(flags, left, optype, right)
-I32 flags;
-OP *left;
-I32 optype;
-OP *right;
+newASSIGNOP(I32 flags, OP *left, I32 optype, OP *right)
 {
     OP *o;
 
@@ -2534,10 +2425,7 @@ OP *right;
 }
 
 OP *
-newSTATEOP(flags, label, o)
-I32 flags;
-char *label;
-OP *o;
+newSTATEOP(I32 flags, char *label, OP *o)
 {
     dTHR;
     U32 seq = intro_my();
@@ -2589,7 +2477,7 @@ OP *o;
 
 /* "Introduce" my variables to visible status. */
 U32
-intro_my()
+intro_my(void)
 {
     SV **svp;
     SV *sv;
@@ -2611,11 +2499,7 @@ intro_my()
 }
 
 OP *
-newLOGOP(type, flags, first, other)
-I32 type;
-I32 flags;
-OP* first;
-OP* other;
+newLOGOP(I32 type, I32 flags, OP *first, OP *other)
 {
     dTHR;
     LOGOP *logop;
@@ -2716,11 +2600,7 @@ OP* other;
 }
 
 OP *
-newCONDOP(flags, first, trueop, falseop)
-I32 flags;
-OP* first;
-OP* trueop;
-OP* falseop;
+newCONDOP(I32 flags, OP *first, OP *trueop, OP *falseop)
 {
     dTHR;
     CONDOP *condop;
@@ -2773,10 +2653,7 @@ OP* falseop;
 }
 
 OP *
-newRANGE(flags, left, right)
-I32 flags;
-OP *left;
-OP *right;
+newRANGE(I32 flags, OP *left, OP *right)
 {
     dTHR;
     CONDOP *condop;
@@ -2821,11 +2698,7 @@ OP *right;
 }
 
 OP *
-newLOOPOP(flags, debuggable, expr, block)
-I32 flags;
-I32 debuggable;
-OP *expr;
-OP *block;
+newLOOPOP(I32 flags, I32 debuggable, OP *expr, OP *block)
 {
     dTHR;
     OP* listop;
@@ -2861,14 +2734,7 @@ OP *block;
 }
 
 OP *
-newWHILEOP(flags, debuggable, loop, whileline, expr, block, cont)
-I32 flags;
-I32 debuggable;
-LOOP *loop;
-I32 whileline;
-OP *expr;
-OP *block;
-OP *cont;
+newWHILEOP(I32 flags, I32 debuggable, LOOP *loop, I32 whileline, OP *expr, OP *block, OP *cont)
 {
     dTHR;
     OP *redo;
@@ -2989,9 +2855,7 @@ newFOROP(I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *block,OP *cont
 }
 
 OP*
-newLOOPEX(type, label)
-I32 type;
-OP* label;
+newLOOPEX(I32 type, OP *label)
 {
     dTHR;
     OP *o;
@@ -3012,8 +2876,7 @@ OP* label;
 }
 
 void
-cv_undef(cv)
-CV *cv;
+cv_undef(CV *cv)
 {
     dTHR;
 #ifdef USE_THREADS
@@ -3118,9 +2981,7 @@ CV* cv;
 #endif /* DEBUG_CLOSURES */
 
 static CV *
-cv_clone2(proto, outside)
-CV* proto;
-CV* outside;
+cv_clone2(CV *proto, CV *outside)
 {
     dTHR;
     AV* av;
@@ -3252,17 +3113,13 @@ CV* outside;
 }
 
 CV *
-cv_clone(proto)
-CV* proto;
+cv_clone(CV *proto)
 {
     return cv_clone2(proto, CvOUTSIDE(proto));
 }
 
 void
-cv_ckproto(cv, gv, p)
-CV* cv;
-GV* gv;
-char* p;
+cv_ckproto(CV *cv, GV *gv, char *p)
 {
     if ((!p != !SvPOK(cv)) || (p && strNE(p, SvPVX(cv)))) {
        SV* msg = sv_newmortal();
@@ -3285,8 +3142,7 @@ char* p;
 }
 
 SV *
-cv_const_sv(cv)
-CV* cv;
+cv_const_sv(CV *cv)
 {
     OP *o;
     SV *sv;
@@ -3321,11 +3177,7 @@ CV* cv;
 }
 
 CV *
-newSUB(floor,o,proto,block)
-I32 floor;
-OP *o;
-OP *proto;
-OP *block;
+newSUB(I32 floor, OP *o, OP *proto, OP *block)
 {
     dTHR;
     char *name = o ? SvPVx(cSVOPo->op_sv, na) : Nullch;
@@ -3554,10 +3406,7 @@ char *filename;
 #endif
 
 CV *
-newXS(name, subaddr, filename)
-char *name;
-void (*subaddr) _((CV*));
-char *filename;
+newXS(char *name, void (*subaddr) (CV *), char *filename)
 {
     dTHR;
     GV *gv = gv_fetchpv(name ? name : "__ANON__", GV_ADDMULTI, SVt_PVCV);
@@ -3634,10 +3483,7 @@ char *filename;
 }
 
 void
-newFORM(floor,o,block)
-I32 floor;
-OP *o;
-OP *block;
+newFORM(I32 floor, OP *o, OP *block)
 {
     dTHR;
     register CV *cv;
@@ -3681,34 +3527,28 @@ OP *block;
 }
 
 OP *
-newANONLIST(o)
-OP* o;
+newANONLIST(OP *o)
 {
     return newUNOP(OP_REFGEN, 0,
        mod(list(convert(OP_ANONLIST, 0, o)), OP_REFGEN));
 }
 
 OP *
-newANONHASH(o)
-OP* o;
+newANONHASH(OP *o)
 {
     return newUNOP(OP_REFGEN, 0,
        mod(list(convert(OP_ANONHASH, 0, o)), OP_REFGEN));
 }
 
 OP *
-newANONSUB(floor, proto, block)
-I32 floor;
-OP *proto;
-OP *block;
+newANONSUB(I32 floor, OP *proto, OP *block)
 {
     return newUNOP(OP_REFGEN, 0,
        newSVOP(OP_ANONCODE, 0, (SV*)newSUB(floor, 0, proto, block)));
 }
 
 OP *
-oopsAV(o)
-OP *o;
+oopsAV(OP *o)
 {
     switch (o->op_type) {
     case OP_PADSV:
@@ -3730,8 +3570,7 @@ OP *o;
 }
 
 OP *
-oopsHV(o)
-OP *o;
+oopsHV(OP *o)
 {
     switch (o->op_type) {
     case OP_PADSV:
@@ -3755,8 +3594,7 @@ OP *o;
 }
 
 OP *
-newAVREF(o)
-OP *o;
+newAVREF(OP *o)
 {
     if (o->op_type == OP_PADANY) {
        o->op_type = OP_PADAV;
@@ -3767,9 +3605,7 @@ OP *o;
 }
 
 OP *
-newGVREF(type,o)
-I32 type;
-OP *o;
+newGVREF(I32 type, OP *o)
 {
     if (type == OP_MAPSTART)
        return newUNOP(OP_NULL, 0, o);
@@ -3777,8 +3613,7 @@ OP *o;
 }
 
 OP *
-newHVREF(o)
-OP *o;
+newHVREF(OP *o)
 {
     if (o->op_type == OP_PADANY) {
        o->op_type = OP_PADHV;
@@ -3789,8 +3624,7 @@ OP *o;
 }
 
 OP *
-oopsCV(o)
-OP *o;
+oopsCV(OP *o)
 {
     croak("NOT IMPL LINE %d",__LINE__);
     /* STUB */
@@ -3798,16 +3632,13 @@ OP *o;
 }
 
 OP *
-newCVREF(flags, o)
-I32 flags;
-OP *o;
+newCVREF(I32 flags, OP *o)
 {
     return newUNOP(OP_RV2CV, flags, scalar(o));
 }
 
 OP *
-newSVREF(o)
-OP *o;
+newSVREF(OP *o)
 {
     if (o->op_type == OP_PADANY) {
        o->op_type = OP_PADSV;
@@ -3820,8 +3651,7 @@ OP *o;
 /* Check routines. */
 
 OP *
-ck_anoncode(o)
-OP *o;
+ck_anoncode(OP *o)
 {
     PADOFFSET ix;
     SV* name;
@@ -3841,16 +3671,14 @@ OP *o;
 }
 
 OP *
-ck_bitop(o)
-OP *o;
+ck_bitop(OP *o)
 {
     o->op_private = hints;
     return o;
 }
 
 OP *
-ck_concat(o)
-OP *o;
+ck_concat(OP *o)
 {
     if (cUNOPo->op_first->op_type == OP_CONCAT)
        o->op_flags |= OPf_STACKED;
@@ -3858,8 +3686,7 @@ OP *o;
 }
 
 OP *
-ck_spair(o)
-OP *o;
+ck_spair(OP *o)
 {
     if (o->op_flags & OPf_KIDS) {
        OP* newop;
@@ -3884,8 +3711,7 @@ OP *o;
 }
 
 OP *
-ck_delete(o)
-OP *o;
+ck_delete(OP *o)
 {
     o = ck_fun(o);
     o->op_private = 0;
@@ -3902,8 +3728,7 @@ OP *o;
 }
 
 OP *
-ck_eof(o)
-OP *o;
+ck_eof(OP *o)
 {
     I32 type = o->op_type;
 
@@ -3919,8 +3744,7 @@ OP *o;
 }
 
 OP *
-ck_eval(o)
-OP *o;
+ck_eval(OP *o)
 {
     hints |= HINT_BLOCK_SCOPE;
     if (o->op_flags & OPf_KIDS) {
@@ -3961,8 +3785,7 @@ OP *o;
 }
 
 OP *
-ck_exec(o)
-OP *o;
+ck_exec(OP *o)
 {
     OP *kid;
     if (o->op_flags & OPf_STACKED) {
@@ -3977,8 +3800,7 @@ OP *o;
 }
 
 OP *
-ck_exists(o)
-OP *o;
+ck_exists(OP *o)
 {
     o = ck_fun(o);
     if (o->op_flags & OPf_KIDS) {
@@ -3991,8 +3813,7 @@ OP *o;
 }
 
 OP *
-ck_gvconst(o)
-register OP *o;
+ck_gvconst(register OP *o)
 {
     o = fold_constants(o);
     if (o->op_type == OP_CONST)
@@ -4001,8 +3822,7 @@ register OP *o;
 }
 
 OP *
-ck_rvconst(o)
-register OP *o;
+ck_rvconst(register OP *o)
 {
     dTHR;
     SVOP *kid = (SVOP*)cUNOPo->op_first;
@@ -4062,8 +3882,7 @@ register OP *o;
 }
 
 OP *
-ck_ftst(o)
-OP *o;
+ck_ftst(OP *o)
 {
     dTHR;
     I32 type = o->op_type;
@@ -4093,8 +3912,7 @@ OP *o;
 }
 
 OP *
-ck_fun(o)
-OP *o;
+ck_fun(OP *o)
 {
     dTHR;
     register OP *kid;
@@ -4232,8 +4050,7 @@ OP *o;
 }
 
 OP *
-ck_glob(o)
-OP *o;
+ck_glob(OP *o)
 {
     GV *gv;
 
@@ -4268,8 +4085,7 @@ OP *o;
 }
 
 OP *
-ck_grep(o)
-OP *o;
+ck_grep(OP *o)
 {
     LOGOP *gwop;
     OP *kid;
@@ -4320,8 +4136,7 @@ OP *o;
 }
 
 OP *
-ck_index(o)
-OP *o;
+ck_index(OP *o)
 {
     if (o->op_flags & OPf_KIDS) {
        OP *kid = cLISTOPo->op_first->op_sibling;       /* get past pushmark */
@@ -4332,32 +4147,28 @@ OP *o;
 }
 
 OP *
-ck_lengthconst(o)
-OP *o;
+ck_lengthconst(OP *o)
 {
     /* XXX length optimization goes here */
     return ck_fun(o);
 }
 
 OP *
-ck_lfun(o)
-OP *o;
+ck_lfun(OP *o)
 {
     OPCODE type = o->op_type;
     return modkids(ck_fun(o), type);
 }
 
 OP *
-ck_rfun(o)
-OP *o;
+ck_rfun(OP *o)
 {
     OPCODE type = o->op_type;
     return refkids(ck_fun(o), type);
 }
 
 OP *
-ck_listiob(o)
-OP *o;
+ck_listiob(OP *o)
 {
     register OP *kid;
     
@@ -4395,8 +4206,7 @@ OP *o;
 }
 
 OP *
-ck_fun_locale(o)
-OP *o;
+ck_fun_locale(OP *o)
 {
     o = ck_fun(o);
 
@@ -4410,8 +4220,7 @@ OP *o;
 }
 
 OP *
-ck_scmp(o)
-OP *o;
+ck_scmp(OP *o)
 {
     o->op_private = 0;
 #ifdef USE_LOCALE
@@ -4423,23 +4232,20 @@ OP *o;
 }
 
 OP *
-ck_match(o)
-OP *o;
+ck_match(OP *o)
 {
     o->op_private |= OPpRUNTIME;
     return o;
 }
 
 OP *
-ck_null(o)
-OP *o;
+ck_null(OP *o)
 {
     return o;
 }
 
 OP *
-ck_repeat(o)
-OP *o;
+ck_repeat(OP *o)
 {
     if (cBINOPo->op_first->op_flags & OPf_PARENS) {
        o->op_private |= OPpREPEAT_DOLIST;
@@ -4451,8 +4257,7 @@ OP *o;
 }
 
 OP *
-ck_require(o)
-OP *o;
+ck_require(OP *o)
 {
     if (o->op_flags & OPf_KIDS) {      /* Shall we supply missing .pm? */
        SVOP *kid = (SVOP*)cUNOPo->op_first;
@@ -4473,8 +4278,7 @@ OP *o;
 }
 
 OP *
-ck_retarget(o)
-OP *o;
+ck_retarget(OP *o)
 {
     croak("NOT IMPL LINE %d",__LINE__);
     /* STUB */
@@ -4482,8 +4286,7 @@ OP *o;
 }
 
 OP *
-ck_select(o)
-OP *o;
+ck_select(OP *o)
 {
     OP* kid;
     if (o->op_flags & OPf_KIDS) {
@@ -4503,8 +4306,7 @@ OP *o;
 }
 
 OP *
-ck_shift(o)
-OP *o;
+ck_shift(OP *o)
 {
     I32 type = o->op_type;
 
@@ -4533,8 +4335,7 @@ OP *o;
 }
 
 OP *
-ck_sort(o)
-OP *o;
+ck_sort(OP *o)
 {
     o->op_private = 0;
 #ifdef USE_LOCALE
@@ -4583,8 +4384,7 @@ OP *o;
 }
 
 OP *
-ck_split(o)
-OP *o;
+ck_split(OP *o)
 {
     register OP *kid;
     PMOP* pm;
@@ -4641,8 +4441,7 @@ OP *o;
 }
 
 OP *
-ck_subr(o)
-OP *o;
+ck_subr(OP *o)
 {
     dTHR;
     OP *prev = ((cUNOPo->op_first->op_sibling)
@@ -4767,16 +4566,14 @@ OP *o;
 }
 
 OP *
-ck_svconst(o)
-OP *o;
+ck_svconst(OP *o)
 {
     SvREADONLY_on(cSVOPo->op_sv);
     return o;
 }
 
 OP *
-ck_trunc(o)
-OP *o;
+ck_trunc(OP *o)
 {
     if (o->op_flags & OPf_KIDS) {
        SVOP *kid = (SVOP*)cUNOPo->op_first;
@@ -4793,8 +4590,7 @@ OP *o;
 /* A peephole optimizer.  We visit the ops in the order they're to execute. */
 
 void
-peep(o)
-register OP* o;
+peep(register OP *o)
 {
     dTHR;
     register OP* oldop = 0;
@@ -4886,6 +4682,24 @@ register OP* o;
            o->op_seq = op_seqmax++;
            break;
 
+       case OP_PADAV:
+           if (o->op_next->op_type == OP_RV2AV
+               && (o->op_next->op_flags && OPf_REF))
+           {
+               null(o->op_next);
+               o->op_next = o->op_next->op_next;
+           }
+           break;
+           
+       case OP_PADHV:
+           if (o->op_next->op_type == OP_RV2HV
+               && (o->op_next->op_flags && OPf_REF))
+           {
+               null(o->op_next);
+               o->op_next = o->op_next->op_next;
+           }
+           break;
+
        case OP_MAPWHILE:
        case OP_GREPWHILE:
        case OP_AND: