diff options
-rw-r--r-- | dist/ExtUtils-ParseXS/lib/perlxstut.pod | 6 | ||||
-rw-r--r-- | pod/perlembed.pod | 2 | ||||
-rw-r--r-- | pp_sort.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/dist/ExtUtils-ParseXS/lib/perlxstut.pod b/dist/ExtUtils-ParseXS/lib/perlxstut.pod index 0afa408920..d36f4256e8 100644 --- a/dist/ExtUtils-ParseXS/lib/perlxstut.pod +++ b/dist/ExtUtils-ParseXS/lib/perlxstut.pod @@ -1095,7 +1095,7 @@ Mytest.xs: SvGETMAGIC(paths); if ((!SvROK(paths)) || (SvTYPE(SvRV(paths)) != SVt_PVAV) - || ((numpaths = av_len((AV *)SvRV(paths))) < 0)) + || ((numpaths = av_top_index((AV *)SvRV(paths))) < 0)) { XSRETURN_UNDEF; } @@ -1158,7 +1158,7 @@ true, which indicates that paths is a valid reference. (Simply checking C<SvROK> won't trigger FETCH on a tied variable.) It then verifies that the object referenced by paths is an array, using C<SvRV> to dereference paths, and C<SvTYPE> to discover its type. As an added test, -it checks that the array referenced by paths is non-empty, using the C<av_len> +it checks that the array referenced by paths is non-empty, using the C<av_top_index> function (which returns -1 if the array is empty). The XSRETURN_UNDEF macro is used to abort the XSUB and return the undefined value whenever all three of these conditions are not met. @@ -1167,7 +1167,7 @@ these conditions are not met. We manipulate several arrays in this XSUB. Note that an array is represented internally by an AV* pointer. The functions and macros for manipulating -arrays are similar to the functions in Perl: C<av_len> returns the highest +arrays are similar to the functions in Perl: C<av_top_index> returns the highest index in an AV*, much like $#array; C<av_fetch> fetches a single scalar value from an array, given its index; C<av_push> pushes a scalar value onto the end of the array, automatically extending the array as necessary. diff --git a/pod/perlembed.pod b/pod/perlembed.pod index e40035eb71..1596df886b 100644 --- a/pod/perlembed.pod +++ b/pod/perlembed.pod @@ -490,7 +490,7 @@ been wrapped here): SvREFCNT_dec(command); *match_list = get_av("array", 0); - num_matches = av_len(*match_list) + 1; + num_matches = av_top_index(*match_list) + 1; return num_matches; } @@ -1432,7 +1432,7 @@ S_qsortsv(pTHX_ gptr *list1, size_t nmemb, SVCOMPARE_t cmp, U32 flags) Sort an array. Here is an example: - sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale); + sortsv(AvARRAY(av), av_top_index(av)+1, Perl_sv_cmp_locale); Currently this always uses mergesort. See sortsv_flags for a more flexible routine. |