summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6be5804)
I looked at the code I'm familiar with, and converted the av_tindex
calls on arrays I was confident don't have magic to av_tindex_nomg().
This saves a little work each time.
{
AV* list = (AV*) *listp;
IV k;
{
AV* list = (AV*) *listp;
IV k;
- for (k = 0; k <= av_tindex(list); k++) {
+ for (k = 0; k <= av_tindex_nomg(list); k++) {
SV** c_p = av_fetch(list, k, FALSE);
UV c;
assert(c_p);
SV** c_p = av_fetch(list, k, FALSE);
UV c;
assert(c_p);
no_close:
/* We output the messages even if warnings are off, because we'll fail
* the very next thing, and these give a likely diagnosis for that */
no_close:
/* We output the messages even if warnings are off, because we'll fail
* the very next thing, and these give a likely diagnosis for that */
- if (posix_warnings && av_tindex(posix_warnings) >= 0) {
+ if (posix_warnings && av_tindex_nomg(posix_warnings) >= 0) {
output_or_return_posix_warnings(pRExC_state, posix_warnings, NULL);
}
output_or_return_posix_warnings(pRExC_state, posix_warnings, NULL);
}
- top_index = av_tindex(stack);
+ top_index = av_tindex_nomg(stack);
switch (curchar) {
SV** stacked_ptr; /* Ptr to something already on 'stack' */
switch (curchar) {
SV** stacked_ptr; /* Ptr to something already on 'stack' */
- if (av_tindex(fence_stack) < 0) {
+ if (av_tindex_nomg(fence_stack) < 0) {
RExC_parse++;
vFAIL("Unexpected ')'");
}
RExC_parse++;
vFAIL("Unexpected ')'");
}
handle_operand:
/* Here 'current' is the operand. If something is already on the
handle_operand:
/* Here 'current' is the operand. If something is already on the
- * stack, we have to check if it is a !. */
- top_index = av_tindex(stack); /* Code above may have altered the
- * stack in the time since we
- * earlier set 'top_index'. */
+ * stack, we have to check if it is a !. But first, the code above
+ * may have altered the stack in the time since we earlier set
+ * 'top_index'. */
+ top_index = av_tindex_nomg(stack);
if (top_index - fence >= 0) {
/* If the top entry on the stack is an operator, it had better
* be a '!', otherwise the entry below the top operand should
if (top_index - fence >= 0) {
/* If the top entry on the stack is an operator, it had better
* be a '!', otherwise the entry below the top operand should
} /* End of loop parsing through the construct */
done:
} /* End of loop parsing through the construct */
done:
- if (av_tindex(fence_stack) >= 0) {
+ if (av_tindex_nomg(fence_stack) >= 0) {
- if (av_tindex(stack) < 0 /* Was empty */
+ if (av_tindex_nomg(stack) < 0 /* Was empty */
|| ((final = av_pop(stack)) == NULL)
|| ! IS_OPERAND(final)
|| SvTYPE(final) != SVt_INVLIST
|| ((final = av_pop(stack)) == NULL)
|| ! IS_OPERAND(final)
|| SvTYPE(final) != SVt_INVLIST
- || av_tindex(stack) >= 0) /* More left on stack */
+ || av_tindex_nomg(stack) >= 0) /* More left on stack */
{
bad_syntax:
SvREFCNT_dec(final);
{
bad_syntax:
SvREFCNT_dec(final);
while (1) {
if ( posix_warnings
while (1) {
if ( posix_warnings
- && av_tindex(posix_warnings) >= 0
+ && av_tindex_nomg(posix_warnings) >= 0
&& RExC_parse > not_posix_region_end)
{
/* Warnings about posix class issues are considered tentative until
&& RExC_parse > not_posix_region_end)
{
/* Warnings about posix class issues are considered tentative until
* posix class, and it failed, it was a false alarm, as this
* successful one proves */
if ( posix_warnings
* posix class, and it failed, it was a false alarm, as this
* successful one proves */
if ( posix_warnings
- && av_tindex(posix_warnings) >= 0
+ && av_tindex_nomg(posix_warnings) >= 0
&& not_posix_region_end >= RExC_parse
&& not_posix_region_end <= posix_class_end)
{
&& not_posix_region_end >= RExC_parse
&& not_posix_region_end <= posix_class_end)
{
} /* End of loop through all the text within the brackets */
} /* End of loop through all the text within the brackets */
- if ( posix_warnings && av_tindex(posix_warnings) >= 0) {
+ if ( posix_warnings && av_tindex_nomg(posix_warnings) >= 0) {
output_or_return_posix_warnings(pRExC_state, posix_warnings,
return_posix_warnings);
}
output_or_return_posix_warnings(pRExC_state, posix_warnings,
return_posix_warnings);
}
#endif
/* Look at the longest folds first */
#endif
/* Look at the longest folds first */
- for (cp_count = av_tindex(multi_char_matches); cp_count > 0; cp_count--) {
+ for (cp_count = av_tindex_nomg(multi_char_matches);
+ cp_count > 0;
+ cp_count--)
+ {
if (av_exists(multi_char_matches, cp_count)) {
AV** this_array_ptr;
if (av_exists(multi_char_matches, cp_count)) {
AV** this_array_ptr;
{
AV* list = (AV*) *listp;
IV k;
{
AV* list = (AV*) *listp;
IV k;
- for (k = 0; k <= av_tindex(list); k++) {
+ for (k = 0; k <= av_tindex_nomg(list); k++) {
SV** c_p = av_fetch(list, k, FALSE);
UV c;
assert(c_p);
SV** c_p = av_fetch(list, k, FALSE);
UV c;
assert(c_p);
si = *ary; /* ary[0] = the string to initialize the swash with */
si = *ary; /* ary[0] = the string to initialize the swash with */
- if (av_tindex(av) >= 2) {
+ if (av_tindex_nomg(av) >= 2) {
if (only_utf8_locale_ptr
&& ary[2]
&& ary[2] != &PL_sv_undef)
if (only_utf8_locale_ptr
&& ary[2]
&& ary[2] != &PL_sv_undef)
* is any inversion list generated at compile time; [4]
* indicates if that inversion list has any user-defined
* properties in it. */
* is any inversion list generated at compile time; [4]
* indicates if that inversion list has any user-defined
* properties in it. */
- if (av_tindex(av) >= 3) {
+ if (av_tindex_nomg(av) >= 3) {
invlist = ary[3];
if (SvUV(ary[4])) {
swash_init_flags |= _CORE_SWASH_INIT_USER_DEFINED_PROPERTY;
invlist = ary[3];
if (SvUV(ary[4])) {
swash_init_flags |= _CORE_SWASH_INIT_USER_DEFINED_PROPERTY;
}
else { /* Does participate in folds */
AV* list = (AV*) *listp;
}
else { /* Does participate in folds */
AV* list = (AV*) *listp;
- if (av_tindex(list) != 1) {
+ if (av_tindex_nomg(list) != 1) {
/* If there aren't exactly two folds to this, it is
* outside the scope of this function */
/* If there aren't exactly two folds to this, it is
* outside the scope of this function */
while ((from_list = (AV *) hv_iternextsv(specials_inverse,
&char_to, &to_len)))
{
while ((from_list = (AV *) hv_iternextsv(specials_inverse,
&char_to, &to_len)))
{
- if (av_tindex(from_list) > 0) {
+ if (av_tindex_nomg(from_list) > 0) {
SSize_t i;
/* We iterate over all combinations of i,j to place each code
* point on each list */
SSize_t i;
/* We iterate over all combinations of i,j to place each code
* point on each list */
- for (i = 0; i <= av_tindex(from_list); i++) {
+ for (i = 0; i <= av_tindex_nomg(from_list); i++) {
SSize_t j;
AV* i_list = newAV();
SV** entryp = av_fetch(from_list, i, FALSE);
SSize_t j;
AV* i_list = newAV();
SV** entryp = av_fetch(from_list, i, FALSE);
}
/* For DEBUG_U: UV u = valid_utf8_to_uvchr((U8*) SvPVX(*entryp), 0);*/
}
/* For DEBUG_U: UV u = valid_utf8_to_uvchr((U8*) SvPVX(*entryp), 0);*/
- for (j = 0; j <= av_tindex(from_list); j++) {
+ for (j = 0; j <= av_tindex_nomg(from_list); j++) {
entryp = av_fetch(from_list, j, FALSE);
if (entryp == NULL) {
Perl_croak(aTHX_ "panic: av_fetch() unexpectedly failed");
entryp = av_fetch(from_list, j, FALSE);
if (entryp == NULL) {
Perl_croak(aTHX_ "panic: av_fetch() unexpectedly failed");
/* Look through list to see if this inverse mapping already is
* listed, or if there is a mapping to itself already */
/* Look through list to see if this inverse mapping already is
* listed, or if there is a mapping to itself already */
- for (i = 0; i <= av_tindex(list); i++) {
+ for (i = 0; i <= av_tindex_nomg(list); i++) {
SV** entryp = av_fetch(list, i, FALSE);
SV* entry;
UV uv;
SV** entryp = av_fetch(list, i, FALSE);
SV* entry;
UV uv;