Skip to content

Commit

Permalink
Change uiv_2buf() from a static to public API function
Browse files Browse the repository at this point in the history
  • Loading branch information
richardleach committed Feb 10, 2025
1 parent ca9b8c7 commit afdc264
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
10 changes: 5 additions & 5 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -3654,6 +3654,11 @@ EXop |bool |try_amagic_bin |int method \
|int flags
EXop |bool |try_amagic_un |int method \
|int flags
ARTp |char * |uiv_2buf |NN char * const buf \
|const IV iv \
|UV uv \
|const int is_uv \
|NN char ** const peob
Adp |SSize_t|unpackstring |NN const char *pat \
|NN const char *patend \
|NN const char *s \
Expand Down Expand Up @@ -5896,11 +5901,6 @@ ST |STRLEN |sv_pos_u2b_midway \
|const STRLEN uend
i |void |sv_unglob |NN SV * const sv \
|U32 flags
RTi |char * |uiv_2buf |NN char * const buf \
|const IV iv \
|UV uv \
|const int is_uv \
|NN char ** const peob
S |void |utf8_mg_len_cache_update \
|NN SV * const sv \
|NN MAGIC ** const mgp \
Expand Down
2 changes: 1 addition & 1 deletion embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@
# define to_uni_lower(a,b,c) Perl_to_uni_lower(aTHX_ a,b,c)
# define to_uni_title(a,b,c) Perl_to_uni_title(aTHX_ a,b,c)
# define to_uni_upper(a,b,c) Perl_to_uni_upper(aTHX_ a,b,c)
# define uiv_2buf Perl_uiv_2buf
# define unpackstring(a,b,c,d,e) Perl_unpackstring(aTHX_ a,b,c,d,e)
# define unshare_hek(a) Perl_unshare_hek(aTHX_ a)
# define unsharepvn(a,b,c) Perl_unsharepvn(aTHX_ a,b,c)
Expand Down Expand Up @@ -2185,7 +2186,6 @@
# define sv_pos_u2b_forwards S_sv_pos_u2b_forwards
# define sv_pos_u2b_midway S_sv_pos_u2b_midway
# define sv_unglob(a,b) S_sv_unglob(aTHX_ a,b)
# define uiv_2buf S_uiv_2buf
# define utf8_mg_len_cache_update(a,b,c) S_utf8_mg_len_cache_update(aTHX_ a,b,c)
# define utf8_mg_pos_cache_update(a,b,c,d,e) S_utf8_mg_pos_cache_update(aTHX_ a,b,c,d,e)
# define visit(a,b,c) S_visit(aTHX_ a,b,c)
Expand Down
14 changes: 7 additions & 7 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2794,15 +2794,26 @@ static const union {
'9', '8', '9', '9'
}};

/* uiv_2buf(): private routine for use by sv_2pv_flags(): print an IV or
* UV as a string towards the end of buf, and return pointers to start and
* end of it.
/* uiv_2buf(): originally a private routine for use by sv_2pv_flags(),
* now in use by do_print() and part of the public API. It prints an
* IV or UV as a string towards the end of buf, and return pointers
* to the start and end of it.
*
* We assume that buf is at least TYPE_CHARS(UV) long.
*/

PERL_STATIC_INLINE char *
S_uiv_2buf(char *const buf, const IV iv, UV uv, const int is_uv, char **const peob)
/*
=for apidoc uiv_2buf

This function converts an IV or UV to its string representation.

It is used internally by sv_2pv_flags() and do_print().

=cut
*/

char *
Perl_uiv_2buf(char *const buf, const IV iv, UV uv, const int is_uv, char **const peob)
{
char *ptr = buf + TYPE_CHARS(UV);
char * const ebuf = ptr;
Expand Down

0 comments on commit afdc264

Please sign in to comment.