From c70927a6ffc3cac8e5ec375a3f7e13b4f7bd1ee4 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 25 Aug 2013 00:08:21 -0700 Subject: 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. --- pod/perlguts.pod | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pod/perlguts.pod') diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 29a30bf2ee..ac9224cb70 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -332,7 +332,7 @@ empty AV: The second method both creates the AV and initially populates it with SVs: - AV* av_make(I32 num, SV **ptr); + AV* av_make(SSize_t num, SV **ptr); The second argument points to an array containing C C's. Once the AV has been created, the SVs can be destroyed, if so desired. @@ -342,7 +342,7 @@ Once the AV has been created, the following operations are possible on it: void av_push(AV*, SV*); SV* av_pop(AV*); SV* av_shift(AV*); - void av_unshift(AV*, I32 num); + void av_unshift(AV*, SSize_t num); These should be familiar operations, with the exception of C. This routine adds C elements at the front of the array with the C @@ -351,9 +351,9 @@ to these new elements. Here are some other functions: - I32 av_top_index(AV*); - SV** av_fetch(AV*, I32 key, I32 lval); - SV** av_store(AV*, I32 key, SV* val); + SSize_t av_top_index(AV*); + SV** av_fetch(AV*, SSize_t key, I32 lval); + SV** av_store(AV*, SSize_t key, SV* val); The C function returns the highest index value in an array (just like $#array in Perl). If the array is empty, -1 is returned. The @@ -370,7 +370,7 @@ A few more: void av_clear(AV*); void av_undef(AV*); - void av_extend(AV*, I32 key); + void av_extend(AV*, SSize_t key); The C function deletes all the elements in the AV* array, but does not actually delete the array itself. The C function will -- cgit v1.2.1