EiMR |UV* |_invlist_array_init |NN SV* const invlist|const bool will_have_0
EiMR |UV* |invlist_array |NN SV* const invlist
EsM |void |invlist_extend |NN SV* const invlist|const UV len
-EiMR |UV*|get_invlist_offset_addr|NN SV* invlist
+EiMR |UV* |get_invlist_zero_addr |NN SV* invlist
EiMR |UV |invlist_max |NN SV* const invlist
EiM |void |invlist_set_len|NN SV* const invlist|const UV len
EiMR |IV* |get_invlist_previous_index_addr|NN SV* invlist
#define compute_EXACTish(a) S_compute_EXACTish(aTHX_ a)
#define could_it_be_a_POSIX_class(a) S_could_it_be_a_POSIX_class(aTHX_ a)
#define get_invlist_iter_addr(a) S_get_invlist_iter_addr(aTHX_ a)
-#define get_invlist_offset_addr(a) S_get_invlist_offset_addr(aTHX_ a)
#define get_invlist_previous_index_addr(a) S_get_invlist_previous_index_addr(aTHX_ a)
+#define get_invlist_zero_addr(a) S_get_invlist_zero_addr(aTHX_ a)
#define grok_bslash_N(a,b,c,d,e,f,g) S_grok_bslash_N(aTHX_ a,b,c,d,e,f,g)
#define handle_regex_sets(a,b,c,d,e) S_handle_regex_sets(aTHX_ a,b,c,d,e)
#define invlist_array(a) S_invlist_array(aTHX_ a)
#define INVLIST_VERSION_ID_OFFSET 1
#define INVLIST_VERSION_ID 1511554547
-#define INVLIST_OFFSET_OFFSET 2 /* 0 or 1 */
-/* The UV at this position contains either 0 or 1. If 0, the inversion list
+#define INVLIST_ZERO_OFFSET 2 /* 0 or 1 */
+/* The UV at position ZERO contains either 0 or 1. If 0, the inversion list
* contains the code point U+00000, and begins at element [0] in the array,
* which always contains 0. If 1, the inversion list doesn't contain U+0000,
* and it begins at element [1]. Inverting an inversion list consists of
/* For safety, when adding new elements, remember to #undef them at the end of
* the inversion list code section */
-#define HEADER_LENGTH (INVLIST_OFFSET_OFFSET + 2) /* includes 1 for the constant
+#define HEADER_LENGTH (INVLIST_ZERO_OFFSET + 2) /* includes 1 for the constant
0 element */
/* An element is in an inversion list iff its index is even numbered: 0, 2, 4,
#define PERL_ARGS_ASSERT_GET_INVLIST_ITER_ADDR \
assert(invlist)
-PERL_STATIC_INLINE UV* S_get_invlist_offset_addr(pTHX_ SV* invlist)
+PERL_STATIC_INLINE IV* S_get_invlist_previous_index_addr(pTHX_ SV* invlist)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_GET_INVLIST_OFFSET_ADDR \
+#define PERL_ARGS_ASSERT_GET_INVLIST_PREVIOUS_INDEX_ADDR \
assert(invlist)
-PERL_STATIC_INLINE IV* S_get_invlist_previous_index_addr(pTHX_ SV* invlist)
+PERL_STATIC_INLINE UV* S_get_invlist_zero_addr(pTHX_ SV* invlist)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_GET_INVLIST_PREVIOUS_INDEX_ADDR \
+#define PERL_ARGS_ASSERT_GET_INVLIST_ZERO_ADDR \
assert(invlist)
STATIC bool S_grok_bslash_N(pTHX_ struct RExC_state_t *pRExC_state, regnode** nodep, UV *valuep, I32 *flagp, U32 depth, bool in_char_class, const bool strict)
* element is either the final part of the header reserved for 0, if TRUE,
* or the first element of the non-heading part, if FALSE */
- UV* offset = get_invlist_offset_addr(invlist);
+ UV* zero = get_invlist_zero_addr(invlist);
PERL_ARGS_ASSERT__INVLIST_ARRAY_INIT;
assert(! *_get_invlist_len_addr(invlist));
/* 1^1 = 0; 1^0 = 1 */
- *offset = 1 ^ will_have_0;
- *(offset + 1) = 0;
- return (UV *) (1 + offset + *offset);
+ *zero = 1 ^ will_have_0;
+ *(zero + 1) = 0;
+ return 1 + zero + *zero;
}
PERL_STATIC_INLINE UV*
/* Must not be empty. If these fail, you probably didn't check for <len>
* being non-zero before trying to get the array */
assert(*_get_invlist_len_addr(invlist));
- assert(*get_invlist_offset_addr(invlist) == 0
- || *get_invlist_offset_addr(invlist) == 1);
+ assert(*get_invlist_zero_addr(invlist) == 0
+ || *get_invlist_zero_addr(invlist) == 1);
/* The array begins either at the header element reserved for zero or the
- * element after that. The reserved element is 1 past the offset_addr
+ * element after that. The reserved element is 1 past the zero_addr
* element; the latter contains 0 or 1 to indicate how much additionally to
* add */
- assert(0 == *(1 + get_invlist_offset_addr(invlist)));
- return (UV *) (1 + get_invlist_offset_addr(invlist)
- + *get_invlist_offset_addr(invlist));
+ assert(0 == *(1 + get_invlist_zero_addr(invlist)));
+ return (UV *) (1 + get_invlist_zero_addr(invlist)
+ + *get_invlist_zero_addr(invlist));
}
PERL_STATIC_INLINE void
}
PERL_STATIC_INLINE UV*
-S_get_invlist_offset_addr(pTHX_ SV* invlist)
+S_get_invlist_zero_addr(pTHX_ SV* invlist)
{
/* Return the address of the UV that says whether the inversion list is
* offset (it contains 1) or not (contains 0) */
- PERL_ARGS_ASSERT_GET_INVLIST_OFFSET_ADDR;
+ PERL_ARGS_ASSERT_GET_INVLIST_ZERO_ADDR;
- return (UV *) (SvPVX(invlist) + (INVLIST_OFFSET_OFFSET * sizeof (UV)));
+ return (UV *) (SvPVX(invlist) + (INVLIST_ZERO_OFFSET * sizeof (UV)));
}
#ifndef PERL_IN_XSUB_RE
* system default is used instead */
SV* new_list;
- UV* offset_addr;
+ UV* zero_addr;
if (initial_size < 0) {
initial_size = INVLIST_INITIAL_LEN;
/* This should force a segfault if a method doesn't initialize this
* properly */
- offset_addr = get_invlist_offset_addr(new_list);
- *offset_addr = (unsigned) UV_MAX;
- *(offset_addr + 1) = 0;
+ zero_addr = get_invlist_zero_addr(new_list);
+ *zero_addr = UV_MAX;
+ *(zero_addr + 1) = 0;
*get_invlist_previous_index_addr(new_list) = 0;
#if HEADER_LENGTH != 4
/* The exclusive or complents 0 to 1; and 1 to 0. If the result is 1, the
* zero element was a 0, so it is being removed, so the length decrements
* by 1; and vice-versa. SvCUR is unaffected */
- if (*get_invlist_offset_addr(invlist) ^= 1) {
+ if (*get_invlist_zero_addr(invlist) ^= 1) {
(*len_pos)--;
}
else {
#undef TO_INTERNAL_SIZE
#undef FROM_INTERNAL_SIZE
#undef INVLIST_LEN_OFFSET
-#undef INVLIST_OFFSET_OFFSET
+#undef INVLIST_ZERO_OFFSET
#undef INVLIST_VERSION_ID
/* End of inversion list object */