Revert "regcomp.c: Change, variable, fcn name"
authorKarl Williamson <public@khwilliamson.com>
Fri, 5 Jul 2013 04:00:43 +0000 (22:00 -0600)
committerKarl Williamson <public@khwilliamson.com>
Fri, 5 Jul 2013 04:44:52 +0000 (22:44 -0600)
This reverts commit 875c4e2c5193b5245da578b222e9c93aad31d93b.
This continues the backing out of this topic branch.  A bisect shows
that the first commit exhibiting an error is the first one in the
branch.

embed.fnc
embed.h
inline_invlist.c
proto.h
regcomp.c

index 3ec96bd..c4d0e47 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1428,7 +1428,7 @@ EsM       |void   |_append_range_to_invlist   |NN SV* const invlist|const UV start|const
 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
diff --git a/embed.h b/embed.h
index c158755..0382be5 100644 (file)
--- a/embed.h
+++ b/embed.h
 #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)
index 21d6282..5d239bd 100644 (file)
@@ -18,8 +18,8 @@
 #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
@@ -29,7 +29,7 @@
 /* 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,
diff --git a/proto.h b/proto.h
index fc4a9a0..5f47a84 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6486,16 +6486,16 @@ PERL_STATIC_INLINE STRLEN*      S_get_invlist_iter_addr(pTHX_ SV* invlist)
 #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)
index 9ff7b3f..4b4850c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7084,7 +7084,7 @@ S__invlist_array_init(pTHX_ SV* const invlist, const bool will_have_0)
      * 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;
 
@@ -7092,9 +7092,9 @@ S__invlist_array_init(pTHX_ SV* const invlist, const bool will_have_0)
     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*
@@ -7109,16 +7109,16 @@ S_invlist_array(pTHX_ SV* const invlist)
     /* 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
@@ -7183,14 +7183,14 @@ S_invlist_max(pTHX_ SV* const invlist)
 }
 
 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
@@ -7203,7 +7203,7 @@ Perl__new_invlist(pTHX_ IV initial_size)
      * system default is used instead */
 
     SV* new_list;
-    UV* offset_addr;
+    UV* zero_addr;
 
     if (initial_size < 0) {
        initial_size = INVLIST_INITIAL_LEN;
@@ -7220,9 +7220,9 @@ Perl__new_invlist(pTHX_ IV initial_size)
 
     /* 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
@@ -8060,7 +8060,7 @@ Perl__invlist_invert(pTHX_ SV* const invlist)
     /* 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 {
@@ -8372,7 +8372,7 @@ S__invlistEQ(pTHX_ SV* const a, SV* const b, const bool complement_b)
 #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 */