Remove I32 casts from pp_stat, these make stat()
Phil Lobbes [Mon, 9 Aug 1999 21:38:54 +0000 (14:38 -0700)]
very broken e.g. on files larger than 2 gigabytes.
Reported by
To: perl5-porters@perl.org
Subject: [ID 19990810.001] Possible bug using stat w/large files Digital
    UNIX Perl 5.005_03
Message-Id: <199908100438.VAA08292@ultra.finchcomputer.com>

There are more of these I32 casts all over pp_sys.c,
all of them should be checked.

p4raw-id: //depot/cfgperl@3944

pp_sys.c

index e081d67..23d1535 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2472,30 +2472,30 @@ PP(pp_stat)
     if (max) {
        EXTEND(SP, max);
        EXTEND_MORTAL(max);
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_dev)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_ino)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_mode)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_nlink)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_uid)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_gid)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_dev)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_ino)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_mode)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_nlink)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_uid)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_gid)));
 #ifdef USE_STAT_RDEV
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_rdev)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_rdev)));
 #else
        PUSHs(sv_2mortal(newSVpvn("", 0)));
 #endif
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_size)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_size)));
 #ifdef BIG_TIME
        PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_atime)));
        PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_mtime)));
        PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_ctime)));
 #else
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_atime)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_mtime)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_ctime)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_atime)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_mtime)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_ctime)));
 #endif
 #ifdef USE_STAT_BLOCKS
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_blksize)));
-       PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_blocks)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_blksize)));
+       PUSHs(sv_2mortal(newSViv(PL_statcache.st_blocks)));
 #else
        PUSHs(sv_2mortal(newSVpvn("", 0)));
        PUSHs(sv_2mortal(newSVpvn("", 0)));