Skip to content

Commit ddfa240

Browse files
committed
Convert utf8n_to_uvchr() to macro
It was a macro, but had a long-name function as well. This converts to using two macros.
1 parent 395e3b6 commit ddfa240

File tree

5 files changed

+6
-27
lines changed

5 files changed

+6
-27
lines changed

embed.fnc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,8 +3667,7 @@ ARTdmp |U8 * |utf8_hop_safe |NN const U8 *s \
36673667
|NN const U8 * const end
36683668
ARdp |STRLEN |utf8_length |NN const U8 *s0 \
36693669
|NN const U8 *e
3670-
3671-
AMTdp |UV |utf8n_to_uvchr |NN const U8 *s \
3670+
ATdmp |UV |utf8n_to_uvchr |NN const U8 *s \
36723671
|STRLEN curlen \
36733672
|NULLOK STRLEN *retlen \
36743673
|const U32 flags

embed.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@
863863
# define utf8_to_bytes_new_pv(a,b,c) Perl_utf8_to_bytes_new_pv(aTHX,a,b,c)
864864
# define utf8_to_bytes_overwrite(a,b) Perl_utf8_to_bytes_overwrite(aTHX,a,b)
865865
# define utf8_to_bytes_temp_pv(a,b) Perl_utf8_to_bytes_temp_pv(aTHX,a,b)
866+
# define utf8n_to_uvchr Perl_utf8n_to_uvchr
866867
# define utf8n_to_uvchr_error Perl_utf8n_to_uvchr_error
867868
# define utf8n_to_uvchr_msgs Perl_utf8n_to_uvchr_msgs
868869
# define uvchr_to_utf8(a,b) Perl_uvchr_to_utf8(aTHX,a,b)

proto.h

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utf8.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,24 +1115,6 @@ warn.
11151115
=for apidoc Amnh||UTF8_WARN_PERL_EXTENDED
11161116
=for apidoc Amnh||UTF8_DISALLOW_PERL_EXTENDED
11171117
1118-
=cut
1119-
1120-
Also implemented as a macro in utf8.h
1121-
*/
1122-
1123-
UV
1124-
Perl_utf8n_to_uvchr(const U8 *s,
1125-
STRLEN curlen,
1126-
STRLEN *retlen,
1127-
const U32 flags)
1128-
{
1129-
PERL_ARGS_ASSERT_UTF8N_TO_UVCHR;
1130-
1131-
return utf8n_to_uvchr_error(s, curlen, retlen, flags, NULL);
1132-
}
1133-
1134-
/*
1135-
11361118
=for apidoc utf8n_to_uvchr_error
11371119
11381120
THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES.

utf8.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,8 @@ typedef enum {
154154
#define utf8_to_uvchr_buf(s, e, lenp) \
155155
Perl_utf8_to_uvchr_buf(aTHX_ (const U8 *) (s), (const U8 *) e, lenp)
156156

157-
#define utf8n_to_uvchr(s, len, lenp, flags) \
158-
utf8n_to_uvchr_error(s, len, lenp, flags, 0)
159-
157+
#define Perl_utf8n_to_uvchr(s, len, lenp, flags) \
158+
Perl_utf8n_to_uvchr_error(s, len, lenp, flags, 0)
160159
#define Perl_utf8n_to_uvchr_error(s, len, lenp, flags, errors) \
161160
Perl_utf8n_to_uvchr_msgs(s, len, lenp, flags, errors, 0)
162161

0 commit comments

Comments
 (0)