The gcc attribute "deprecated" seems to have been available since gcc 3.1
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index 39cda9a..0917018 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -9,10 +9,12 @@
  */
 
 /*
- * "Far below them they saw the white waters pour into a foaming bowl, and
- * then swirl darkly about a deep oval basin in the rocks, until they found
- * their way out again through a narrow gate, and flowed away, fuming and
- * chattering, into calmer and more level reaches."
+ *  Far below them they saw the white waters pour into a foaming bowl, and
+ *  then swirl darkly about a deep oval basin in the rocks, until they found
+ *  their way out again through a narrow gate, and flowed away, fuming and
+ *  chattering, into calmer and more level reaches.
+ *
+ *     [p.684 of _The Lord of the Rings_, IV/vi: "The Forbidden Pool"]
  */
 
 /* This file contains functions that do the actual I/O on behalf of ops.
@@ -212,7 +214,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
                goto say_false;
            }
 #endif /* USE_STDIO */
-           name = SvOK(*svp) ? savesvpv (*svp) : savepvn ("", 0);
+           name = SvOK(*svp) ? savesvpv (*svp) : savepvs ("");
            SAVEFREEPV(name);
        }
        else {
@@ -766,7 +768,7 @@ Perl_nextargv(pTHX_ register GV *gv)
                    const char *star = strchr(PL_inplace, '*');
                    if (star) {
                        const char *begin = PL_inplace;
-                       sv_setpvn(sv, "", 0);
+                       sv_setpvs(sv, "");
                        do {
                            sv_catpvn(sv, begin, star - begin);
                            sv_catpvn(sv, PL_oldname, oldlen);
@@ -906,7 +908,7 @@ Perl_nextargv(pTHX_ register GV *gv)
        if (io && (IoFLAGS(io) & IOf_ARGV)
            && PL_argvout_stack && AvFILLp(PL_argvout_stack) >= 0)
        {
-           GV * const oldout = (GV*)av_pop(PL_argvout_stack);
+           GV * const oldout = MUTABLE_GV(av_pop(PL_argvout_stack));
            setdefout(oldout);
            SvREFCNT_dec(oldout);
            return NULL;
@@ -1282,7 +1284,7 @@ Perl_my_stat(pTHX)
         do_fstat_have_io:
         PL_laststype = OP_STAT;
         PL_statgv = gv;
-        sv_setpvn(PL_statname, "", 0);
+        sv_setpvs(PL_statname, "");
         if(io) {
            if (IoIFP(io)) {
                return (PL_laststatval = PerlLIO_fstat(PerlIO_fileno(IoIFP(io)), &PL_statcache));
@@ -1308,15 +1310,15 @@ Perl_my_stat(pTHX)
        STRLEN len;
        PUTBACK;
        if (isGV_with_GP(sv)) {
-           gv = (GV*)sv;
+           gv = MUTABLE_GV(sv);
            goto do_fstat;
        }
        else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
-           gv = (GV*)SvRV(sv);
+           gv = MUTABLE_GV(SvRV(sv));
            goto do_fstat;
        }
         else if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVIO) {
-            io = (IO*)SvRV(sv);
+            io = MUTABLE_IO(SvRV(sv));
            gv = NULL;
             goto do_fstat_have_io;
         }
@@ -1365,7 +1367,7 @@ Perl_my_lstat(pTHX)
     PUTBACK;
     if (SvROK(sv) && isGV_with_GP(SvRV(sv)) && ckWARN(WARN_IO)) {
        Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
-               GvENAME((GV*) SvRV(sv)));
+               GvENAME((const GV *)SvRV(sv)));
        return (PL_laststatval = -1);
     }
     file = SvPV_nolen_const(sv);
@@ -1625,7 +1627,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
            while (++mark <= sp) {
                 GV* gv;
                 if (isGV_with_GP(*mark)) {
-                    gv = (GV*)*mark;
+                    gv = MUTABLE_GV(*mark);
                do_fchmod:
                    if (GvIO(gv) && IoIFP(GvIOp(gv))) {
 #ifdef HAS_FCHMOD
@@ -1641,7 +1643,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
                    }
                }
                else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
-                   gv = (GV*)SvRV(*mark);
+                   gv = MUTABLE_GV(SvRV(*mark));
                    goto do_fchmod;
                }
                else {
@@ -1665,7 +1667,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
            while (++mark <= sp) {
                 GV* gv;
                 if (isGV_with_GP(*mark)) {
-                    gv = (GV*)*mark;
+                    gv = MUTABLE_GV(*mark);
                do_fchown:
                    if (GvIO(gv) && IoIFP(GvIOp(gv))) {
 #ifdef HAS_FCHOWN
@@ -1681,7 +1683,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
                    }
                }
                else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
-                   gv = (GV*)SvRV(*mark);
+                   gv = MUTABLE_GV(SvRV(*mark));
                    goto do_fchown;
                }
                else {
@@ -1837,7 +1839,7 @@ nothing in the core.
            while (++mark <= sp) {
                 GV* gv;
                 if (isGV_with_GP(*mark)) {
-                    gv = (GV*)*mark;
+                    gv = MUTABLE_GV(*mark);
                do_futimes:
                    if (GvIO(gv) && IoIFP(GvIOp(gv))) {
 #ifdef HAS_FUTIMES
@@ -1854,7 +1856,7 @@ nothing in the core.
                    }
                }
                else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
-                   gv = (GV*)SvRV(*mark);
+                   gv = MUTABLE_GV(SvRV(*mark));
                    goto do_futimes;
                }
                else {
@@ -1941,8 +1943,8 @@ Perl_cando(pTHX_ Mode_t mode, bool effective, register const Stat_t *statbufp)
 }
 #endif /* ! VMS */
 
-bool
-Perl_ingroup(pTHX_ Gid_t testgid, bool effective)
+static bool
+S_ingroup(pTHX_ Gid_t testgid, bool effective)
 {
 #ifdef MACOS_TRADITIONAL
     /* This is simply not correct for AppleShare, but fix it yerself. */
@@ -2179,7 +2181,7 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp)
 
     /* suppress warning when reading into undef var --jhi */
     if (! SvOK(mstr))
-       sv_setpvn(mstr, "", 0);
+       sv_setpvs(mstr, "");
     msize = SvIVx(*++mark);
     mtype = (long)SvIVx(*++mark);
     flags = SvIVx(*++mark);
@@ -2288,7 +2290,7 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
        char *mbuf;
        /* suppress warning when reading into undef var (tchrist 3/Mar/00) */
        if (! SvOK(mstr))
-           sv_setpvn(mstr, "", 0);
+           sv_setpvs(mstr, "");
        SvPV_force_nolen(mstr);
        mbuf = SvGROW(mstr, (STRLEN)msize+1);