This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate (SV *) casts from the rest of *.c, picking up one (further)
[perl5.git] / pp_sort.c
index d06a953..d520f81 100644 (file)
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1516,7 +1516,7 @@ PP(pp_sort)
        else {
            cv = sv_2cv(*++MARK, &stash, &gv, 0);
            if (cv && SvPOK(cv)) {
-               const char * const proto = SvPV_nolen_const((SV*)cv);
+               const char * const proto = SvPV_nolen_const(MUTABLE_SV(cv));
                if (proto && strEQ(proto, "$$")) {
                    hasargs = TRUE;
                }
@@ -1553,7 +1553,7 @@ PP(pp_sort)
     if (priv & OPpSORT_INPLACE) {
        assert( MARK+1 == SP && *SP && SvTYPE(*SP) == SVt_PVAV);
        (void)POPMARK; /* remove mark associated with ex-OP_AASSIGN */
-       av = (AV*)(*SP);
+       av = MUTABLE_AV((*SP));
        max = AvFILL(av) + 1;
        if (SvMAGICAL(av)) {
            MEXTEND(SP, max);
@@ -1663,10 +1663,10 @@ PP(pp_sort)
 
                    if (hasargs) {
                        /* This is mostly copied from pp_entersub */
-                       AV * const av = (AV*)PAD_SVl(0);
+                       AV * const av = MUTABLE_AV(PAD_SVl(0));
 
                        cx->blk_sub.savearray = GvAV(PL_defgv);
-                       GvAV(PL_defgv) = (AV*)SvREFCNT_inc_simple(av);
+                       GvAV(PL_defgv) = MUTABLE_AV(SvREFCNT_inc_simple(av));
                        CX_CURPAD_SAVE(cx->blk_sub);
                        cx->blk_sub.argarray = av;
                    }