diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-11-30 11:38:11 -0500 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2023-11-30 21:37:56 -0500 |
commit | 997083188b8f7c2b058544a805a0dec83ea5483d (patch) | |
tree | ddf7979721902b5a5e03cf922a15cda1d6cd3fab | |
parent | abb1fe286804a35fc4cbcc431434f9e5b42c544f (diff) | |
download | ruby-997083188b8f7c2b058544a805a0dec83ea5483d.tar.gz |
[ruby/prism] Remove public ASCII functions that can now be static
https://github.com/ruby/prism/commit/9461384b0c
-rw-r--r-- | prism/encoding.c | 6 | ||||
-rw-r--r-- | prism/encoding.h | 33 |
2 files changed, 3 insertions, 36 deletions
diff --git a/prism/encoding.c b/prism/encoding.c index 1acebeda15..b93f93bdfd 100644 --- a/prism/encoding.c +++ b/prism/encoding.c @@ -3918,7 +3918,7 @@ pm_encoding_ascii_char_width(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t * Return the size of the next character in the ASCII encoding if it is an * alphabetical character. */ -size_t +static size_t pm_encoding_ascii_alpha_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { return (pm_encoding_ascii_table[*b] & PRISM_ENCODING_ALPHABETIC_BIT); } @@ -3937,7 +3937,7 @@ pm_encoding_ascii_alpha_char_7bit(const uint8_t *b, ptrdiff_t n) { * Return the size of the next character in the ASCII encoding if it is an * alphanumeric character. */ -size_t +static size_t pm_encoding_ascii_alnum_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { return (pm_encoding_ascii_table[*b] & PRISM_ENCODING_ALPHANUMERIC_BIT) ? 1 : 0; } @@ -3956,7 +3956,7 @@ pm_encoding_ascii_alnum_char_7bit(const uint8_t *b, ptrdiff_t n) { * Return true if the next character in the ASCII encoding if it is an uppercase * character. */ -bool +static bool pm_encoding_ascii_isupper_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { return (pm_encoding_ascii_table[*b] & PRISM_ENCODING_UPPERCASE_BIT); } diff --git a/prism/encoding.h b/prism/encoding.h index 866913206a..de01967d93 100644 --- a/prism/encoding.h +++ b/prism/encoding.h @@ -79,39 +79,6 @@ typedef struct { #define PRISM_ENCODING_UPPERCASE_BIT 1 << 2 /** - * Return the size of the next character in the ASCII encoding if it is an - * alphabetical character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_ascii_alpha_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n); - -/** - * Return the size of the next character in the ASCII encoding if it is an - * alphanumeric character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_ascii_alnum_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n); - -/** - * Return true if the next character in the ASCII encoding if it is an uppercase - * character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns True if the next character is valid in the encoding and is an - * uppercase character, or false if it is not. - */ -bool pm_encoding_ascii_isupper_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n); - -/** * Return the size of the next character in the UTF-8 encoding if it is an * alphabetical character. * |