diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-25 00:08:21 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-25 06:40:34 -0700 |
commit | c70927a6ffc3cac8e5ec375a3f7e13b4f7bd1ee4 (patch) | |
tree | 477e6abc58c0898bee5727b3feb27c9af685f49b /pod/perlembed.pod | |
parent | 9a543cee73966ca61d6dc71cc7322f271f5b6b8b (diff) | |
download | perl-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 'pod/perlembed.pod')
-rw-r--r-- | pod/perlembed.pod | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pod/perlembed.pod b/pod/perlembed.pod index b06a242c16..979c944670 100644 --- a/pod/perlembed.pod +++ b/pod/perlembed.pod @@ -391,7 +391,7 @@ C<s/bob/robert/g> or C<tr[A-Z][a-z]>), substitute() modifies the string within the C<SV> as according to the operation, returning the number of substitutions made. - int matches(SV *string, char *pattern, AV **matches); + SSize_t matches(SV *string, char *pattern, AV **matches); Given an C<SV>, a pattern, and a pointer to an empty C<AV>, matches() evaluates C<$string =~ $pattern> in a list context, and @@ -478,10 +478,10 @@ been wrapped here): ** and fills in **matches with the matching substrings **/ - I32 matches(SV *string, char *pattern, AV **match_list) + SSize_t matches(SV *string, char *pattern, AV **match_list) { SV *command = newSV(0); - I32 num_matches; + SSize_t num_matches; sv_setpvf(command, "my $string = '%s'; @array = ($string =~ %s)", SvPV_nolen(string), pattern); @@ -541,8 +541,8 @@ been wrapped here): /** Remove all vowels from text **/ num_matches = substitute(&text, "s/[aeiou]//gi"); if (num_matches) { - printf("substitute: s/[aeiou]//gi...%d substitutions made.\n", - num_matches); + printf("substitute: s/[aeiou]//gi...%lu substitutions made.\n", + (unsigned long)num_matches); printf("Now text is: %s\n\n", SvPV_nolen(text)); } |