diff options
-rw-r--r-- | av.c | 12 | ||||
-rw-r--r-- | av.h | 2 | ||||
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | embed.h | 2 | ||||
-rw-r--r-- | pod/perlguts.pod | 4 | ||||
-rw-r--r-- | proto.h | 4 | ||||
-rw-r--r-- | regcomp.c | 8 |
7 files changed, 17 insertions, 17 deletions
@@ -759,16 +759,16 @@ Perl_av_shift(pTHX_ AV *av) } /* -=for apidoc av_top +=for apidoc av_top_index Returns the highest index in the array. The number of elements in the -array is C<av_top(av) + 1>. Returns -1 if the array is empty. +array is C<av_top_index(av) + 1>. Returns -1 if the array is empty. The Perl equivalent for this is C<$#myarray>. =for apidoc av_len -Same as L</av_top>. Returns the highest index in the array. Note that the +Same as L</av_top_index>. Returns the highest index in the array. Note that the return value is +1 what its name implies it returns; and hence differs in meaning from what the similarly named L</sv_len> returns. @@ -778,7 +778,7 @@ meaning from what the similarly named L</sv_len> returns. I32 Perl_av_len(pTHX_ AV *av) { - /* If change this, must change identical Perl_av_top() just below */ + /* If change this, must change identical Perl_av_top_index() just below */ PERL_ARGS_ASSERT_AV_LEN; assert(SvTYPE(av) == SVt_PVAV); @@ -787,12 +787,12 @@ Perl_av_len(pTHX_ AV *av) } I32 -Perl_av_top(pTHX_ AV *av) +Perl_av_top_index(pTHX_ AV *av) { /* So short, that it is just a duplicate of Perl_av_len(). Must keep them * in sync */ - PERL_ARGS_ASSERT_AV_TOP; + PERL_ARGS_ASSERT_AV_TOP_INDEX; assert(SvTYPE(av) == SVt_PVAV); return AvFILL(av); @@ -47,7 +47,7 @@ Null AV pointer. =head1 Array Manipulation Functions =for apidoc Am|int|AvFILL|AV* av -Same as C<av_top()>. Deprecated, use C<av_top()> instead. +Same as C<av_top_index()>. Deprecated, use C<av_top_index()> instead. =cut */ @@ -219,7 +219,7 @@ Apd |void |av_push |NN AV *av|NN SV *val EXp |void |av_reify |NN AV *av ApdR |SV* |av_shift |NN AV *av Apd |SV** |av_store |NN AV *av|I32 key|NULLOK SV *val -ApdR |I32 |av_top |NN AV *av +ApdR |I32 |av_top_index |NN AV *av Apd |void |av_undef |NN AV *av ApdoxM |SV** |av_create_and_unshift_one|NN AV **const avp|NN SV *const val Apd |void |av_unshift |NN AV *av|I32 num @@ -56,7 +56,7 @@ #define av_push(a,b) Perl_av_push(aTHX_ a,b) #define av_shift(a) Perl_av_shift(aTHX_ a) #define av_store(a,b,c) Perl_av_store(aTHX_ a,b,c) -#define av_top(a) Perl_av_top(aTHX_ a) +#define av_top_index(a) Perl_av_top_index(aTHX_ a) #define av_undef(a) Perl_av_undef(aTHX_ a) #define av_unshift(a,b) Perl_av_unshift(aTHX_ a,b) #define block_gimme() Perl_block_gimme(aTHX) diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 4fb9ce1289..339ecce203 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -351,11 +351,11 @@ to these new elements. Here are some other functions: - I32 av_top(AV*); + I32 av_top_index(AV*); SV** av_fetch(AV*, I32 key, I32 lval); SV** av_store(AV*, I32 key, SV* val); -The C<av_top> function returns the highest index value in an array (just +The C<av_top_index> function returns the highest index value in an array (just like $#array in Perl). If the array is empty, -1 is returned. The C<av_fetch> function returns the value at index C<key>, but if C<lval> is non-zero, then C<av_fetch> will store an undef value at that index. @@ -227,10 +227,10 @@ PERL_CALLCONV SV** Perl_av_store(pTHX_ AV *av, I32 key, SV *val) #define PERL_ARGS_ASSERT_AV_STORE \ assert(av) -PERL_CALLCONV I32 Perl_av_top(pTHX_ AV *av) +PERL_CALLCONV I32 Perl_av_top_index(pTHX_ AV *av) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_AV_TOP \ +#define PERL_ARGS_ASSERT_AV_TOP_INDEX \ assert(av) PERL_CALLCONV void Perl_av_undef(pTHX_ AV *av) @@ -11560,7 +11560,7 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist, I32 *f stack = newAV(); while (RExC_parse < RExC_end) { - I32 top_index = av_top(stack); + I32 top_index = av_top_index(stack); SV** top_ptr; SV* current = NULL; @@ -11577,7 +11577,7 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist, I32 *f switch (curchar) { case '?': - if (av_top(stack) >= 0 /* This makes sure that we can + if (av_top_index(stack) >= 0 /* This makes sure that we can safely subtract 1 from RExC_parse in the next clause. If we have something on the @@ -11814,10 +11814,10 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist, I32 *f RExC_parse += (UTF) ? UTF8SKIP(RExC_parse) : 1; } - if (av_top(stack) < 0 /* Was empty */ + if (av_top_index(stack) < 0 /* Was empty */ || ((final = av_pop(stack)) == NULL) || ! IS_OPERAND(final) - || av_top(stack) >= 0) /* More left on stack */ + || av_top_index(stack) >= 0) /* More left on stack */ { vFAIL("Incomplete expression within '(?[ ])'"); } |