Skip to content

Commit fd7517d

Browse files
committed
Change _invlist to invlist_
The previous spelling is undefined behavior in C
1 parent 05e5fd1 commit fd7517d

File tree

19 files changed

+285
-285
lines changed

19 files changed

+285
-285
lines changed

doop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ S_do_trans_count_invmap(pTHX_ SV * const sv, AV * const invmap)
375375

376376
/* Look the code point up in the data structure for this tr/// to get
377377
* what it maps to */
378-
i = _invlist_search(from_invlist, from);
378+
i = invlist_search_(from_invlist, from);
379379
assert(i >= 0);
380380

381381
if (map[i] != (UV) TR_UNLISTED) {
@@ -491,7 +491,7 @@ S_do_trans_invmap(pTHX_ SV * const sv, AV * const invmap)
491491

492492
/* Look the code point up in the data structure for this tr/// to get
493493
* what it maps to */
494-
i = _invlist_search(from_invlist, from);
494+
i = invlist_search_(from_invlist, from);
495495
assert(i >= 0);
496496

497497
to = map[i];

dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
22012201
if (type == SVt_INVLIST) {
22022202
PerlIO_printf(file, "\n");
22032203
/* 4 blanks indents 2 beyond the PV, etc */
2204-
_invlist_dump(file, level, " ", sv);
2204+
invlist_dump_(file, level, " ", sv);
22052205
}
22062206
else {
22072207
PerlIO_printf(file, "%s", _pv_display_for_dump(d, ptr, SvCUR(sv),

embed.fnc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4337,11 +4337,11 @@ RS |Size_t |do_trans_simple|NN SV * const sv \
43374337
ERTi |bool * |get_invlist_offset_addr \
43384338
|NN SV *invlist
43394339
ERTi |UV * |invlist_array |NN SV * const invlist
4340-
ERTi |bool |_invlist_contains_cp \
4340+
ERTi |bool |invlist_contains_cp_ \
43414341
|NN SV * const invlist \
43424342
|const UV cp
4343-
ERTi |UV |_invlist_len |NN SV * const invlist
4344-
ERTXp |SSize_t|_invlist_search|NN SV * const invlist \
4343+
ERTi |UV |invlist_len_ |NN SV * const invlist
4344+
ERTXp |SSize_t|invlist_search_|NN SV * const invlist \
43454345
|const UV cp
43464346
ERTi |bool |is_invlist |NULLOK const SV * const invlist
43474347
#endif
@@ -4363,24 +4363,24 @@ ERXp |SV * |_add_range_to_invlist \
43634363
|NULLOK SV *invlist \
43644364
|UV start \
43654365
|UV end
4366-
m |void |_invlist_intersection \
4366+
m |void |invlist_intersection_ \
43674367
|NN SV * const a \
43684368
|NN SV * const b \
43694369
|NN SV **i
4370-
EXp |void |_invlist_intersection_maybe_complement_2nd \
4370+
EXp |void |invlist_intersection_maybe_complement_2nd_ \
43714371
|NULLOK SV * const a \
43724372
|NN SV * const b \
43734373
|const bool complement_b \
43744374
|NN SV **i
4375-
EXp |void |_invlist_invert|NN SV * const invlist
4376-
m |void |_invlist_subtract \
4375+
EXp |void |invlist_invert_|NN SV * const invlist
4376+
m |void |invlist_subtract_ \
43774377
|NN SV * const a \
43784378
|NN SV * const b \
43794379
|NN SV **result
4380-
Cm |void |_invlist_union |NULLOK SV * const a \
4380+
Cm |void |invlist_union_ |NULLOK SV * const a \
43814381
|NN SV * const b \
43824382
|NN SV **output
4383-
EXp |void |_invlist_union_maybe_complement_2nd \
4383+
EXp |void |invlist_union_maybe_complement_2nd_ \
43844384
|NULLOK SV * const a \
43854385
|NN SV * const b \
43864386
|const bool complement_b \
@@ -4443,7 +4443,7 @@ opx |void |hv_kill_backrefs \
44434443
#endif
44444444
#if defined(PERL_IN_DUMP_C) || defined(PERL_IN_OP_C) || \
44454445
defined(PERL_IN_REGCOMP_ANY)
4446-
EXp |void |_invlist_dump |NN PerlIO *file \
4446+
EXp |void |invlist_dump_ |NN PerlIO *file \
44474447
|I32 level \
44484448
|NN const char * const indent \
44494449
|NN SV * const invlist
@@ -5057,7 +5057,7 @@ So |void |validate_suid |NN PerlIO *rsfp
50575057
#endif /* defined(PERL_IN_PERL_C) */
50585058
#if defined(PERL_IN_PERL_C) || defined(PERL_IN_REGCOMP_ANY) || \
50595059
defined(PERL_IN_UTF8_C)
5060-
EXp |bool |_invlistEQ |NN SV * const a \
5060+
EXp |bool |invlistEQ_ |NN SV * const a \
50615061
|NN SV * const b \
50625062
|const bool complement_b
50635063
ERXp |SV * |_new_invlist_C_array \
@@ -5602,7 +5602,7 @@ ERTi |IV * |get_invlist_previous_index_addr \
56025602
S |void |initialize_invlist_guts \
56035603
|NN SV *invlist \
56045604
|const Size_t initial_size
5605-
ERTi |UV * |_invlist_array_init \
5605+
ERTi |UV * |invlist_array_init_ \
56065606
|NN SV * const invlist \
56075607
|const bool will_have_0
56085608
Ei |void |invlist_clear |NN SV *invlist

embed.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,11 +1896,11 @@
18961896
defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_ANY) || \
18971897
defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C) || \
18981898
defined(PERL_IN_UTF8_C)
1899-
# define _invlist_contains_cp S__invlist_contains_cp
1900-
# define _invlist_len S__invlist_len
1901-
# define _invlist_search Perl__invlist_search
19021899
# define get_invlist_offset_addr S_get_invlist_offset_addr
19031900
# define invlist_array S_invlist_array
1901+
# define invlist_contains_cp_ S_invlist_contains_cp_
1902+
# define invlist_len_ S_invlist_len_
1903+
# define invlist_search_ Perl_invlist_search_
19041904
# define is_invlist S_is_invlist
19051905
# endif
19061906
# if defined(PERL_IN_DOOP_C) || defined(PERL_IN_OP_C) || \
@@ -1913,11 +1913,11 @@
19131913
# if defined(PERL_IN_DOOP_C) || defined(PERL_IN_OP_C) || \
19141914
defined(PERL_IN_REGCOMP_ANY) || defined(PERL_IN_UTF8_C)
19151915
# define _add_range_to_invlist(a,b,c) Perl__add_range_to_invlist(aTHX_ a,b,c)
1916-
# define _invlist_intersection_maybe_complement_2nd(a,b,c,d) Perl__invlist_intersection_maybe_complement_2nd(aTHX_ a,b,c,d)
1917-
# define _invlist_invert(a) Perl__invlist_invert(aTHX_ a)
1918-
# define _invlist_union_maybe_complement_2nd(a,b,c,d) Perl__invlist_union_maybe_complement_2nd(aTHX_ a,b,c,d)
19191916
# define _new_invlist(a) Perl__new_invlist(aTHX_ a)
19201917
# define _setup_canned_invlist(a,b,c) Perl__setup_canned_invlist(aTHX_ a,b,c)
1918+
# define invlist_intersection_maybe_complement_2nd_(a,b,c,d) Perl_invlist_intersection_maybe_complement_2nd_(aTHX_ a,b,c,d)
1919+
# define invlist_invert_(a) Perl_invlist_invert_(aTHX_ a)
1920+
# define invlist_union_maybe_complement_2nd_(a,b,c,d) Perl_invlist_union_maybe_complement_2nd_(aTHX_ a,b,c,d)
19211921
# endif
19221922
# if defined(PERL_IN_DQUOTE_C) || defined(PERL_IN_REGCOMP_C) || \
19231923
defined(PERL_IN_TOKE_C)
@@ -1932,7 +1932,7 @@
19321932
# endif
19331933
# if defined(PERL_IN_DUMP_C) || defined(PERL_IN_OP_C) || \
19341934
defined(PERL_IN_REGCOMP_ANY)
1935-
# define _invlist_dump(a,b,c,d) Perl__invlist_dump(aTHX_ a,b,c,d)
1935+
# define invlist_dump_(a,b,c,d) Perl_invlist_dump_(aTHX_ a,b,c,d)
19361936
# endif
19371937
# if defined(PERL_IN_GV_C) || defined(PERL_IN_UNIVERSAL_C)
19381938
# define gv_stashsvpvn_cached(a,b,c,d) Perl_gv_stashsvpvn_cached(aTHX_ a,b,c,d)
@@ -1945,8 +1945,8 @@
19451945
# endif
19461946
# if defined(PERL_IN_PERL_C) || defined(PERL_IN_REGCOMP_ANY) || \
19471947
defined(PERL_IN_UTF8_C)
1948-
# define _invlistEQ(a,b,c) Perl__invlistEQ(aTHX_ a,b,c)
19491948
# define _new_invlist_C_array(a) Perl__new_invlist_C_array(aTHX_ a)
1949+
# define invlistEQ_(a,b,c) Perl_invlistEQ_(aTHX_ a,b,c)
19501950
# endif
19511951
# if defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_ANY) || \
19521952
defined(PERL_IN_TOKE_C) || defined(PERL_IN_UNIVERSAL_C)
@@ -2053,8 +2053,8 @@
20532053
# endif
20542054
# if defined(PERL_IN_REGCOMP_INVLIST_C) && !defined(PERL_EXT_RE_BUILD)
20552055
# define _append_range_to_invlist(a,b,c) S__append_range_to_invlist(aTHX_ a,b,c)
2056-
# define _invlist_array_init S__invlist_array_init
20572056
# define get_invlist_previous_index_addr S_get_invlist_previous_index_addr
2057+
# define invlist_array_init_ S_invlist_array_init_
20582058
# define invlist_clear(a) S_invlist_clear(aTHX_ a)
20592059
# define invlist_max S_invlist_max
20602060
# define invlist_previous_index S_invlist_previous_index

ext/B/B.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sub import {
2020
# walkoptree comes from B.xs
2121

2222
BEGIN {
23-
$B::VERSION = '1.89';
23+
$B::VERSION = '1.90';
2424
@B::EXPORT_OK = ();
2525

2626
# Our BOOT code needs $VERSION set, and will append to @EXPORT_OK.

ext/B/B.xs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ PPCODE:
16941694
UV len;
16951695

16961696
len = 0;
1697-
/* should use _invlist_len (or not) */
1697+
/* should use invlist_len_ (or not) */
16981698
if (SvCUR(invlist) > 0)
16991699
len = FROM_INTERNAL_SIZE(SvCUR(invlist)); /* - ((XINVLIST*) SvANY(invlist))->is_offset; */ /* <- for iteration */
17001700

invlist_inline.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ S_get_invlist_offset_addr(SV* invlist)
4545
}
4646

4747
PERL_STATIC_INLINE UV
48-
S__invlist_len(SV* const invlist)
48+
S_invlist_len_(SV* const invlist)
4949
{
5050
/* Returns the current number of elements stored in the inversion list's
5151
* array */
5252

53-
PERL_ARGS_ASSERT__INVLIST_LEN;
53+
PERL_ARGS_ASSERT_INVLIST_LEN_;
5454

5555
assert(is_invlist(invlist));
5656

@@ -60,13 +60,13 @@ S__invlist_len(SV* const invlist)
6060
}
6161

6262
PERL_STATIC_INLINE bool
63-
S__invlist_contains_cp(SV* const invlist, const UV cp)
63+
S_invlist_contains_cp_(SV* const invlist, const UV cp)
6464
{
6565
/* Does <invlist> contain code point <cp> as part of the set? */
6666

67-
IV index = _invlist_search(invlist, cp);
67+
IV index = invlist_search_(invlist, cp);
6868

69-
PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP;
69+
PERL_ARGS_ASSERT_INVLIST_CONTAINS_CP_;
7070

7171
return index >= 0 && ELEMENT_RANGE_MATCHES_INVLIST(index);
7272
}
@@ -82,7 +82,7 @@ S_invlist_array(SV* const invlist)
8282

8383
/* Must not be empty. If these fail, you probably didn't check for <len>
8484
* being non-zero before trying to get the array */
85-
assert(_invlist_len(invlist));
85+
assert(invlist_len_(invlist));
8686

8787
/* The very first element always contains zero, The array begins either
8888
* there, or if the inversion list is offset, at the element after it.
@@ -139,7 +139,7 @@ S_invlist_highest(SV* const invlist)
139139
* 0, or if the list is empty. If this distinction matters to you, check
140140
* for emptiness before calling this function */
141141

142-
UV len = _invlist_len(invlist);
142+
UV len = invlist_len_(invlist);
143143
UV *array;
144144

145145
PERL_ARGS_ASSERT_INVLIST_HIGHEST;
@@ -172,7 +172,7 @@ S_invlist_highest_range_start(SV* const invlist)
172172
* distinction matters to you, check for emptiness before calling this
173173
* function. */
174174

175-
UV len = _invlist_len(invlist);
175+
UV len = invlist_len_(invlist);
176176
UV *array;
177177

178178
PERL_ARGS_ASSERT_INVLIST_HIGHEST_RANGE_START;
@@ -249,7 +249,7 @@ S_invlist_iternext(SV* invlist, UV* start, UV* end)
249249
* will start over at the beginning of the list */
250250

251251
STRLEN* pos = get_invlist_iter_addr(invlist);
252-
UV len = _invlist_len(invlist);
252+
UV len = invlist_len_(invlist);
253253
UV *array;
254254

255255
PERL_ARGS_ASSERT_INVLIST_ITERNEXT;
@@ -356,7 +356,7 @@ S_invlist_lowest(SV* const invlist)
356356
* 0, or if the list is empty. If this distinction matters to you, check
357357
* for emptiness before calling this function */
358358

359-
UV len = _invlist_len(invlist);
359+
UV len = invlist_len_(invlist);
360360
UV *array;
361361

362362
PERL_ARGS_ASSERT_INVLIST_LOWEST;

op.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6094,7 +6094,7 @@ Perl_invmap_dump(pTHX_ SV* invlist, UV *map)
60946094

60956095
const unsigned int indent = 4;
60966096

6097-
UV len = _invlist_len(invlist);
6097+
UV len = invlist_len_(invlist);
60986098
UV * array = invlist_array(invlist);
60996099

61006100
if (len == 0) {
@@ -6567,7 +6567,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
65676567
} /* End of parse through tstr */
65686568

65696569
/* The inversion list is done; now invert it */
6570-
_invlist_invert(inverted_tlist);
6570+
invlist_invert_(inverted_tlist);
65716571

65726572
/* Now go through the inverted list and create a new tstr for the rest
65736573
* of the routine to use. Since the UTF-8 version can have ranges, and
@@ -6834,7 +6834,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
68346834
* the return value is the index into the list's array of the range
68356835
* that contains <cp>, that is, 'i' such that
68366836
* array[i] <= cp < * array[i+1] */
6837-
j = _invlist_search(t_invlist, t_cp);
6837+
j = invlist_search_(t_invlist, t_cp);
68386838
assert(j >= 0);
68396839
i = j;
68406840

pp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4593,7 +4593,7 @@ PP_wrapped(pp_uc, 1, 0)
45934593
if (UNLIKELY(in_iota_subscript)) {
45944594
UV cp = utf8_to_uv_or_die(s, send, NULL);
45954595

4596-
if (! _invlist_contains_cp(PL_utf8_mark, cp)) {
4596+
if (! invlist_contains_cp_(PL_utf8_mark, cp)) {
45974597

45984598
/* A non-mark. Time to output the iota subscript */
45994599
*d++ = UTF8_TWO_BYTE_HI(GREEK_CAPITAL_LETTER_IOTA);

0 commit comments

Comments
 (0)