Skip to content

Commit 395e3b6

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

File tree

5 files changed

+7
-26
lines changed

5 files changed

+7
-26
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3672,7 +3672,7 @@ AMTdp |UV |utf8n_to_uvchr |NN const U8 *s \
36723672
|STRLEN curlen \
36733673
|NULLOK STRLEN *retlen \
36743674
|const U32 flags
3675-
AMTdp |UV |utf8n_to_uvchr_error \
3675+
ATdmp |UV |utf8n_to_uvchr_error \
36763676
|NN const U8 *s \
36773677
|STRLEN curlen \
36783678
|NULLOK STRLEN *retlen \

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_error Perl_utf8n_to_uvchr_error
866867
# define utf8n_to_uvchr_msgs Perl_utf8n_to_uvchr_msgs
867868
# define uvchr_to_utf8(a,b) Perl_uvchr_to_utf8(aTHX,a,b)
868869
# define uvchr_to_utf8_flags(a,b,c) Perl_uvchr_to_utf8_flags(aTHX,a,b,c)

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 & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,25 +1285,6 @@ flag to suppress any warnings, and then examine the C<*errors> return.
12851285
=for apidoc Amnh||UTF8_GOT_SUPER
12861286
=for apidoc Amnh||UTF8_GOT_SURROGATE
12871287
1288-
=cut
1289-
1290-
Also implemented as a macro in utf8.h
1291-
*/
1292-
1293-
UV
1294-
Perl_utf8n_to_uvchr_error(const U8 *s,
1295-
STRLEN curlen,
1296-
STRLEN *retlen,
1297-
const U32 flags,
1298-
U32 * errors)
1299-
{
1300-
PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_ERROR;
1301-
1302-
return utf8n_to_uvchr_msgs(s, curlen, retlen, flags, errors, NULL);
1303-
}
1304-
1305-
/*
1306-
13071288
=for apidoc utf8n_to_uvchr_msgs
13081289
13091290
THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES.

utf8.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ typedef enum {
156156

157157
#define utf8n_to_uvchr(s, len, lenp, flags) \
158158
utf8n_to_uvchr_error(s, len, lenp, flags, 0)
159-
#define utf8n_to_uvchr_error(s, len, lenp, flags, errors) \
160-
utf8n_to_uvchr_msgs(s, len, lenp, flags, errors, 0)
159+
160+
#define Perl_utf8n_to_uvchr_error(s, len, lenp, flags, errors) \
161+
Perl_utf8n_to_uvchr_msgs(s, len, lenp, flags, errors, 0)
161162

162163
#define utf16_to_utf8(p, d, bytelen, newlen) \
163164
utf16_to_utf8_base(p, d, bytelen, newlen, 0, 1)

0 commit comments

Comments
 (0)