From d05c9ddbd283a22db2b3d16c46d6cd9cf0903217 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 7 Jan 2020 20:37:17 -0700 Subject: numeric.c: Move function in the file This makes adjacent all similar functions and their docs --- numeric.c | 74 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 0851a1cfb2..125ad91ad5 100644 --- a/numeric.c +++ b/numeric.c @@ -287,6 +287,43 @@ Perl_grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) return grok_hex(start, len_p, flags, result); } +/* +=for apidoc grok_oct + +converts a string representing an octal number to numeric form. + +On entry C and C<*len> give the string to scan, C<*flags> gives +conversion flags, and C should be C or a pointer to an NV. +The scan stops at the end of the string, or the first invalid character. +Unless C is set in C<*flags>, encountering an +8 or 9 will also trigger a warning. +On return C<*len> is set to the length of the scanned string, +and C<*flags> gives output flags. + +If the value is <= C it is returned as a UV, the output flags are clear, +and nothing is written to C<*result>. If the value is > C, C +returns C, sets C in the output flags, +and writes the value to C<*result> (or the value is discarded if C +is C). + +If C is set in C<*flags> then the octal +number may use C<"_"> characters to separate digits. + +=cut + +Not documented yet because experimental is C +which suppresses any message for non-portable numbers, but which are valid +on this platform. + */ + +UV +Perl_grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) +{ + PERL_ARGS_ASSERT_GROK_OCT; + + return grok_oct(start, len_p, flags, result); +} + UV Perl_grok_bin_oct_hex(pTHX_ const char *start, STRLEN *len_p, @@ -430,43 +467,6 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start, return UV_MAX; } -/* -=for apidoc grok_oct - -converts a string representing an octal number to numeric form. - -On entry C and C<*len> give the string to scan, C<*flags> gives -conversion flags, and C should be C or a pointer to an NV. -The scan stops at the end of the string, or the first invalid character. -Unless C is set in C<*flags>, encountering an -8 or 9 will also trigger a warning. -On return C<*len> is set to the length of the scanned string, -and C<*flags> gives output flags. - -If the value is <= C it is returned as a UV, the output flags are clear, -and nothing is written to C<*result>. If the value is > C, C -returns C, sets C in the output flags, -and writes the value to C<*result> (or the value is discarded if C -is C). - -If C is set in C<*flags> then the octal -number may use C<"_"> characters to separate digits. - -=cut - -Not documented yet because experimental is C -which suppresses any message for non-portable numbers, but which are valid -on this platform. - */ - -UV -Perl_grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) -{ - PERL_ARGS_ASSERT_GROK_OCT; - - return grok_oct(start, len_p, flags, result); -} - /* =for apidoc scan_bin -- cgit v1.2.1