summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-25 00:08:21 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-25 06:40:34 -0700
commitc70927a6ffc3cac8e5ec375a3f7e13b4f7bd1ee4 (patch)
tree477e6abc58c0898bee5727b3feb27c9af685f49b /pp_hot.c
parent9a543cee73966ca61d6dc71cc7322f271f5b6b8b (diff)
downloadperl-c70927a6ffc3cac8e5ec375a3f7e13b4f7bd1ee4.tar.gz
Use SSize_t for arrays
Make the array interface 64-bit safe by using SSize_t instead of I32 for array indices. This is based on a patch by Chip Salzenberg. This completes what the previous commit began when it changed av_extend.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 75e5d652b1..6068d21973 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -326,11 +326,11 @@ STATIC void
S_pushav(pTHX_ AV* const av)
{
dSP;
- const I32 maxarg = AvFILL(av) + 1;
+ const SSize_t maxarg = AvFILL(av) + 1;
EXTEND(SP, maxarg);
if (SvRMAGICAL(av)) {
- U32 i;
- for (i=0; i < (U32)maxarg; i++) {
+ PADOFFSET i;
+ for (i=0; i < (PADOFFSET)maxarg; i++) {
SV ** const svp = av_fetch(av, i, FALSE);
/* See note in pp_helem, and bug id #27839 */
SP[i+1] = svp
@@ -339,8 +339,8 @@ S_pushav(pTHX_ AV* const av)
}
}
else {
- U32 i;
- for (i=0; i < (U32)maxarg; i++) {
+ PADOFFSET i;
+ for (i=0; i < (PADOFFSET)maxarg; i++) {
SV * const sv = AvARRAY(av)[i];
SP[i+1] = sv ? sv : &PL_sv_undef;
}
@@ -924,7 +924,7 @@ PP(pp_rv2av)
}
else if (gimme == G_SCALAR) {
dTARGET;
- const I32 maxarg = AvFILL(av) + 1;
+ const SSize_t maxarg = AvFILL(av) + 1;
SETi(maxarg);
}
} else {
@@ -994,7 +994,7 @@ PP(pp_aassign)
I32 gimme;
HV *hash;
- I32 i;
+ SSize_t i;
int magic;
U32 lval = 0;