Skip to content

Commit 69ab709

Browse files
committed
Change invlist function names to be legal
This continues the process started in #23592 to change names with leading underscores to be legal C. See that p.r. or 4bb3572 for extensive discussion. This commit simply moves the leading underscore to be trailing
1 parent e8829bd commit 69ab709

File tree

17 files changed

+410
-410
lines changed

17 files changed

+410
-410
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
@@ -2444,7 +2444,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
24442444
if (type == SVt_INVLIST) {
24452445
PerlIO_printf(file, "\n");
24462446
/* 4 blanks indents 2 beyond the PV, etc */
2447-
_invlist_dump(file, level, " ", sv);
2447+
invlist_dump_(file, level, " ", sv);
24482448
}
24492449
else {
24502450
PerlIO_printf(file, "%s", pv_display_for_dump(d, ptr, SvCUR(sv),

embed.fnc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4389,11 +4389,11 @@ RS |Size_t |do_trans_simple|NN SV * const sv \
43894389
ERTi |bool * |get_invlist_offset_addr \
43904390
|NN SV *invlist
43914391
ERTi |UV * |invlist_array |NN SV * const invlist
4392-
ERTi |bool |_invlist_contains_cp \
4392+
ERTi |bool |invlist_contains_cp_ \
43934393
|NN SV * const invlist \
43944394
|const UV cp
4395-
ERTi |UV |_invlist_len |NN SV * const invlist
4396-
ERTXp |SSize_t|_invlist_search|NN SV * const invlist \
4395+
ERTi |UV |invlist_len_ |NN SV * const invlist
4396+
ERTXp |SSize_t|invlist_search_|NN SV * const invlist \
43974397
|const UV cp
43984398
ERTi |bool |is_invlist |NULLOK const SV * const invlist
43994399
#endif
@@ -4411,34 +4411,34 @@ Ei |void |invlist_set_len|NN SV * const invlist \
44114411
#endif
44124412
#if defined(PERL_IN_DOOP_C) || defined(PERL_IN_OP_C) || \
44134413
defined(PERL_IN_REGCOMP_ANY) || defined(PERL_IN_UTF8_C)
4414-
ERXp |SV * |_add_range_to_invlist \
4414+
ERXp |SV * |add_range_to_invlist_ \
44154415
|NULLOK SV *invlist \
44164416
|UV start \
44174417
|UV end
4418-
m |void |_invlist_intersection \
4418+
m |void |invlist_intersection_ \
44194419
|NN SV * const a \
44204420
|NN SV * const b \
44214421
|NN SV **i
4422-
EXp |void |_invlist_intersection_maybe_complement_2nd \
4422+
EXp |void |invlist_intersection_maybe_complement_2nd_ \
44234423
|NULLOK SV * const a \
44244424
|NN SV * const b \
44254425
|const bool complement_b \
44264426
|NN SV **i
4427-
EXp |void |_invlist_invert|NN SV * const invlist
4428-
m |void |_invlist_subtract \
4427+
EXp |void |invlist_invert_|NN SV * const invlist
4428+
m |void |invlist_subtract_ \
44294429
|NN SV * const a \
44304430
|NN SV * const b \
44314431
|NN SV **result
4432-
m |void |_invlist_union |NULLOK SV * const a \
4432+
m |void |invlist_union_ |NULLOK SV * const a \
44334433
|NN SV * const b \
44344434
|NN SV **output
4435-
EXp |void |_invlist_union_maybe_complement_2nd \
4435+
EXp |void |invlist_union_maybe_complement_2nd_ \
44364436
|NULLOK SV * const a \
44374437
|NN SV * const b \
44384438
|const bool complement_b \
44394439
|NN SV **output
4440-
ERXp |SV * |_new_invlist |IV initial_size
4441-
ERXp |SV * |_setup_canned_invlist \
4440+
ERXp |SV * |new_invlist_ |IV initial_size
4441+
ERXp |SV * |setup_canned_invlist_ \
44424442
|const STRLEN size \
44434443
|const UV element0 \
44444444
|NN UV **other_elements_ptr
@@ -4502,7 +4502,7 @@ opx |void |hv_kill_backrefs \
45024502
#endif
45034503
#if defined(PERL_IN_DUMP_C) || defined(PERL_IN_OP_C) || \
45044504
defined(PERL_IN_REGCOMP_ANY)
4505-
EXp |void |_invlist_dump |NN PerlIO *file \
4505+
EXp |void |invlist_dump_ |NN PerlIO *file \
45064506
|I32 level \
45074507
|NN const char * const indent \
45084508
|NN SV * const invlist
@@ -5123,10 +5123,10 @@ So |void |validate_suid |NN PerlIO *rsfp
51235123
#endif /* defined(PERL_IN_PERL_C) */
51245124
#if defined(PERL_IN_PERL_C) || defined(PERL_IN_REGCOMP_ANY) || \
51255125
defined(PERL_IN_UTF8_C)
5126-
EXp |bool |_invlistEQ |NN SV * const a \
5126+
EXp |bool |invlistEQ_ |NN SV * const a \
51275127
|NN SV * const b \
51285128
|const bool complement_b
5129-
ERXp |SV * |_new_invlist_C_array \
5129+
ERXp |SV * |new_invlist_C_array_ \
51305130
|NN const UV * const list
51315131
#endif
51325132
#if defined(PERL_IN_PP_C)
@@ -5659,7 +5659,7 @@ ES |void |regdump_intflags \
56595659
|const U32 flags
56605660
#endif
56615661
#if defined(PERL_IN_REGCOMP_INVLIST_C) && !defined(PERL_EXT_RE_BUILD)
5662-
ES |void |_append_range_to_invlist \
5662+
ES |void |append_range_to_invlist_ \
56635663
|NN SV * const invlist \
56645664
|const UV start \
56655665
|const UV end
@@ -5668,7 +5668,7 @@ ERTi |IV * |get_invlist_previous_index_addr \
56685668
S |void |initialize_invlist_guts \
56695669
|NN SV *invlist \
56705670
|const Size_t initial_size
5671-
ERTi |UV * |_invlist_array_init \
5671+
ERTi |UV * |invlist_array_init_ \
56725672
|NN SV * const invlist \
56735673
|const bool will_have_0
56745674
Ei |void |invlist_clear |NN SV *invlist

embed.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,11 +1850,11 @@
18501850
defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_ANY) || \
18511851
defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C) || \
18521852
defined(PERL_IN_UTF8_C)
1853-
# define _invlist_contains_cp S__invlist_contains_cp
1854-
# define _invlist_len S__invlist_len
1855-
# define _invlist_search Perl__invlist_search
18561853
# define get_invlist_offset_addr S_get_invlist_offset_addr
18571854
# define invlist_array S_invlist_array
1855+
# define invlist_contains_cp_ S_invlist_contains_cp_
1856+
# define invlist_len_ S_invlist_len_
1857+
# define invlist_search_ Perl_invlist_search_
18581858
# define is_invlist S_is_invlist
18591859
# endif
18601860
# if defined(PERL_IN_DOOP_C) || defined(PERL_IN_OP_C) || \
@@ -1866,12 +1866,12 @@
18661866
# endif
18671867
# if defined(PERL_IN_DOOP_C) || defined(PERL_IN_OP_C) || \
18681868
defined(PERL_IN_REGCOMP_ANY) || defined(PERL_IN_UTF8_C)
1869-
# define _add_range_to_invlist(a,b,c) Perl__add_range_to_invlist(aTHX_ a,b,c)
1870-
# define _invlist_intersection_maybe_complement_2nd(a,b,c,d) Perl__invlist_intersection_maybe_complement_2nd(aTHX_ a,b,c,d)
1871-
# define _invlist_invert(a) Perl__invlist_invert(aTHX_ a)
1872-
# define _invlist_union_maybe_complement_2nd(a,b,c,d) Perl__invlist_union_maybe_complement_2nd(aTHX_ a,b,c,d)
1873-
# define _new_invlist(a) Perl__new_invlist(aTHX_ a)
1874-
# define _setup_canned_invlist(a,b,c) Perl__setup_canned_invlist(aTHX_ a,b,c)
1869+
# define add_range_to_invlist_(a,b,c) Perl_add_range_to_invlist_(aTHX_ a,b,c)
1870+
# define invlist_intersection_maybe_complement_2nd_(a,b,c,d) Perl_invlist_intersection_maybe_complement_2nd_(aTHX_ a,b,c,d)
1871+
# define invlist_invert_(a) Perl_invlist_invert_(aTHX_ a)
1872+
# define invlist_union_maybe_complement_2nd_(a,b,c,d) Perl_invlist_union_maybe_complement_2nd_(aTHX_ a,b,c,d)
1873+
# define new_invlist_(a) Perl_new_invlist_(aTHX_ a)
1874+
# define setup_canned_invlist_(a,b,c) Perl_setup_canned_invlist_(aTHX_ a,b,c)
18751875
# endif
18761876
# if defined(PERL_IN_DQUOTE_C) || defined(PERL_IN_REGCOMP_C) || \
18771877
defined(PERL_IN_TOKE_C)
@@ -1886,7 +1886,7 @@
18861886
# endif
18871887
# if defined(PERL_IN_DUMP_C) || defined(PERL_IN_OP_C) || \
18881888
defined(PERL_IN_REGCOMP_ANY)
1889-
# define _invlist_dump(a,b,c,d) Perl__invlist_dump(aTHX_ a,b,c,d)
1889+
# define invlist_dump_(a,b,c,d) Perl_invlist_dump_(aTHX_ a,b,c,d)
18901890
# endif
18911891
# if defined(PERL_IN_GV_C) || defined(PERL_IN_UNIVERSAL_C)
18921892
# define gv_stashsvpvn_cached(a,b,c,d) Perl_gv_stashsvpvn_cached(aTHX_ a,b,c,d)
@@ -1899,8 +1899,8 @@
18991899
# endif
19001900
# if defined(PERL_IN_PERL_C) || defined(PERL_IN_REGCOMP_ANY) || \
19011901
defined(PERL_IN_UTF8_C)
1902-
# define _invlistEQ(a,b,c) Perl__invlistEQ(aTHX_ a,b,c)
1903-
# define _new_invlist_C_array(a) Perl__new_invlist_C_array(aTHX_ a)
1902+
# define invlistEQ_(a,b,c) Perl_invlistEQ_(aTHX_ a,b,c)
1903+
# define new_invlist_C_array_(a) Perl_new_invlist_C_array_(aTHX_ a)
19041904
# endif
19051905
# if defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_ANY) || \
19061906
defined(PERL_IN_TOKE_C) || defined(PERL_IN_UNIVERSAL_C)
@@ -2006,9 +2006,9 @@
20062006
# define regdump_intflags(a,b) S_regdump_intflags(aTHX_ a,b)
20072007
# endif
20082008
# if defined(PERL_IN_REGCOMP_INVLIST_C) && !defined(PERL_EXT_RE_BUILD)
2009-
# define _append_range_to_invlist(a,b,c) S__append_range_to_invlist(aTHX_ a,b,c)
2010-
# define _invlist_array_init S__invlist_array_init
2009+
# define append_range_to_invlist_(a,b,c) S_append_range_to_invlist_(aTHX_ a,b,c)
20112010
# define get_invlist_previous_index_addr S_get_invlist_previous_index_addr
2011+
# define invlist_array_init_ S_invlist_array_init_
20122012
# define invlist_clear(a) S_invlist_clear(aTHX_ a)
20132013
# define invlist_max S_invlist_max
20142014
# define invlist_previous_index S_invlist_previous_index

invlist_inline.h

Lines changed: 11 additions & 11 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.
@@ -128,7 +128,7 @@ S_invlist_set_len(pTHX_ SV* const invlist, const UV len, const bool offset)
128128

129129
PERL_STATIC_INLINE SV*
130130
S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp) {
131-
return _add_range_to_invlist(invlist, cp, cp);
131+
return add_range_to_invlist_(invlist, cp, cp);
132132
}
133133

134134
PERL_STATIC_INLINE UV
@@ -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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6110,7 +6110,7 @@ Perl_invmap_dump(pTHX_ SV* invlist, UV *map)
61106110

61116111
const unsigned int indent = 4;
61126112

6113-
UV len = _invlist_len(invlist);
6113+
UV len = invlist_len_(invlist);
61146114
UV * array = invlist_array(invlist);
61156115

61166116
if (len == 0) {
@@ -6567,7 +6567,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
65676567
* automatically keeps it sorted as we go along */
65686568
if (complement) {
65696569
UV start, end;
6570-
SV * inverted_tlist = _new_invlist(tlen);
6570+
SV * inverted_tlist = new_invlist_(tlen);
65716571
Size_t temp_len;
65726572

65736573
DEBUG_y(PerlIO_printf(Perl_debug_log,
@@ -6602,14 +6602,14 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
66026602
t_cp_end = valid_utf8_to_uv(t, &t_char_len);
66036603
t += t_char_len;
66046604

6605-
inverted_tlist = _add_range_to_invlist(inverted_tlist,
6605+
inverted_tlist = add_range_to_invlist_(inverted_tlist,
66066606
t_cp, t_cp_end);
66076607
}
66086608
}
66096609
} /* End of parse through tstr */
66106610

66116611
/* The inversion list is done; now invert it */
6612-
_invlist_invert(inverted_tlist);
6612+
invlist_invert_(inverted_tlist);
66136613

66146614
/* Now go through the inverted list and create a new tstr for the rest
66156615
* of the routine to use. Since the UTF-8 version can have ranges, and
@@ -6657,10 +6657,10 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
66576657
rstr_utf8 = tstr_utf8;
66586658
}
66596659

6660-
t_invlist = _new_invlist(1);
6660+
t_invlist = new_invlist_(1);
66616661

66626662
/* Initialize to a single range */
6663-
t_invlist = _add_range_to_invlist(t_invlist, 0, UV_MAX);
6663+
t_invlist = add_range_to_invlist_(t_invlist, 0, UV_MAX);
66646664

66656665
/* Below, we parse the (potentially adjusted) input, creating the inversion
66666666
* map. This is done in two passes. The first pass is just to determine
@@ -6695,7 +6695,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
66956695
invmap_dump(t_invlist, r_map));
66966696

66976697
/* In the second pass, we start with a single range */
6698-
t_invlist = _add_range_to_invlist(t_invlist, 0, UV_MAX);
6698+
t_invlist = add_range_to_invlist_(t_invlist, 0, UV_MAX);
66996699
len = 1;
67006700
t_array = invlist_array(t_invlist);
67016701
}
@@ -6881,7 +6881,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
68816881
* the return value is the index into the list's array of the range
68826882
* that contains <cp>, that is, 'i' such that
68836883
* array[i] <= cp < * array[i+1] */
6884-
j = _invlist_search(t_invlist, t_cp);
6884+
j = invlist_search_(t_invlist, t_cp);
68856885
assert(j >= 0);
68866886
i = j;
68876887

pp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4530,7 +4530,7 @@ PP_wrapped(pp_uc, 1, 0)
45304530
if (UNLIKELY(in_iota_subscript)) {
45314531
UV cp = utf8_to_uv_or_die(s, send, &this_len);
45324532

4533-
if (! _invlist_contains_cp(PL_utf8_mark, cp)) {
4533+
if (! invlist_contains_cp_(PL_utf8_mark, cp)) {
45344534

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

0 commit comments

Comments
 (0)