Don't test the core XS code yet with PERL_DEBUG_COW > 1
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index 81a0f65..79ca1fd 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -673,11 +673,11 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
 
                 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;
             }
@@ -1176,7 +1176,7 @@ Perl_mode_from_discipline(pTHX_ SV *discp)
     int mode = O_BINARY;
     if (discp) {
        STRLEN len;
-       const char *s = SvPV(discp,len);
+       const char *s = SvPV_const(discp,len);
        while (*s) {
            if (*s == ':') {
                switch (s[1]) {
@@ -1345,7 +1345,7 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
                Perl_warner(aTHX_ packWARN(WARN_UTF8), "Wide character in print");
            }
        }
-       tmps = SvPV(sv, len);
+       tmps = SvPV_const(sv, len);
        break;
     }
     /* To detect whether the process is about to overstep its
@@ -1404,7 +1404,7 @@ Perl_my_stat(pTHX)
            goto do_fstat;
        }
 
-       s = SvPV(sv, len);
+       s = SvPV_const(sv, len);
        PL_statgv = Nullgv;
        sv_setpvn(PL_statname, s, len);
        s = SvPVX_const(PL_statname);           /* s now NUL-terminated */
@@ -1423,7 +1423,6 @@ Perl_my_lstat(pTHX)
 {
     dSP;
     SV *sv;
-    STRLEN n_a;
     if (PL_op->op_flags & OPf_REF) {
        EXTEND(SP,1);
        if (cGVOP_gv == PL_defgv) {
@@ -1451,9 +1450,9 @@ Perl_my_lstat(pTHX)
        return (PL_laststatval = -1);
     }
     /* XXX Do really need to be calling SvPV() all these times? */
-    sv_setpv(PL_statname,SvPV(sv, n_a));
-    PL_laststatval = PerlLIO_lstat(SvPV(sv, n_a),&PL_statcache);
-    if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV(sv, n_a), '\n'))
+    sv_setpv(PL_statname,SvPV_nolen_const(sv));
+    PL_laststatval = PerlLIO_lstat(SvPV_nolen_const(sv),&PL_statcache);
+    if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV_nolen_const(sv), '\n'))
        Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "lstat");
     return PL_laststatval;
 }
@@ -1476,20 +1475,19 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
 #else
     register char **a;
     const char *tmps = Nullch;
-    STRLEN n_a;
 
     if (sp > mark) {
        New(401,PL_Argv, sp - mark + 1, char*);
        a = PL_Argv;
        while (++mark <= sp) {
            if (*mark)
-               *a++ = SvPVx(*mark, n_a);
+               *a++ = (char*)SvPV_nolen_const(*mark);
            else
                *a++ = "";
        }
        *a = Nullch;
        if (really)
-           tmps = SvPV(really, n_a);
+           tmps = SvPV_nolen_const(really);
        if ((!really && *PL_Argv[0] != '/') ||
            (really && *tmps != '/'))           /* will execvp use PATH? */
            TAINT_ENV();                /* testing IFS here is overkill, probably */
@@ -1672,9 +1670,8 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
     register I32 val;
     register I32 tot = 0;
     const char *what;
-    char *s;
+    const char *s;
     SV **oldmark = mark;
-    STRLEN n_a;
 
 #define APPLY_TAINT_PROPER() \
     STMT_START {                                                       \
@@ -1700,7 +1697,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
            APPLY_TAINT_PROPER();
            tot = sp - mark;
            while (++mark <= sp) {
-               const char *name = SvPVx(*mark, n_a);
+               const char *name = SvPV_nolen_const(*mark);
                APPLY_TAINT_PROPER();
                if (PerlLIO_chmod(name, val))
                    tot--;
@@ -1718,7 +1715,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
            APPLY_TAINT_PROPER();
            tot = sp - mark;
            while (++mark <= sp) {
-               const char *name = SvPVx(*mark, n_a);
+               const char *name = SvPV_nolen_const(*mark);
                APPLY_TAINT_PROPER();
                if (PerlLIO_chown(name, val, val2))
                    tot--;
@@ -1738,7 +1735,7 @@ nothing in the core.
        APPLY_TAINT_PROPER();
        if (mark == sp)
            break;
-       s = SvPVx(*++mark, n_a);
+       s = SvPVx_nolen_const(*++mark);
        if (isALPHA(*s)) {
            if (*s == 'S' && s[1] == 'I' && s[2] == 'G')
                s += 3;
@@ -1808,7 +1805,7 @@ nothing in the core.
        APPLY_TAINT_PROPER();
        tot = sp - mark;
        while (++mark <= sp) {
-           s = SvPVx(*mark, n_a);
+           s = SvPV_nolen_const(*mark);
            APPLY_TAINT_PROPER();
            if (PL_euid || PL_unsafe) {
                if (UNLINK(s))
@@ -1862,8 +1859,7 @@ nothing in the core.
            APPLY_TAINT_PROPER();
            tot = sp - mark;
            while (++mark <= sp) {
-               STRLEN n_a;
-               const char *name = SvPVx(*mark, n_a);
+               const char *name = SvPV_nolen_const(*mark);
                APPLY_TAINT_PROPER();
                if (PerlLIO_utime(name, utbufp))
                    tot--;