diff options
author | Jan Beulich <jbeulich@suse.com> | 2025-02-03 12:19:17 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2025-02-03 12:19:17 +0100 |
commit | 2dd0370c433da9a6dffd969d6e36d3a086a6380e (patch) | |
tree | 0249e33f644d9a0623286cdcce4dcd2915781b7d | |
parent | 49343ef90494e119c0c1ac4740606ab360990a56 (diff) | |
download | binutils-2dd0370c433da9a6dffd969d6e36d3a086a6380e.zip binutils-2dd0370c433da9a6dffd969d6e36d3a086a6380e.tar.gz binutils-2dd0370c433da9a6dffd969d6e36d3a086a6380e.tar.bz2 |
rl78: use is_whitespace()
Replace open-coded checks and convert ISSPACE() uses. At the same time
use is_end_of_stmt() instead of an open-coded check in adjacent code.
-rw-r--r-- | gas/config/rl78-parse.y | 4 | ||||
-rw-r--r-- | gas/config/tc-rl78.c | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/gas/config/rl78-parse.y b/gas/config/rl78-parse.y index 006eb7d..a2dcacf 100644 --- a/gas/config/rl78-parse.y +++ b/gas/config/rl78-parse.y @@ -1379,7 +1379,7 @@ find_bit_index (char *tok) { last_digit = tok; } - else if (ISSPACE (*tok)) + else if (is_whitespace (*tok)) { /* skip */ } @@ -1403,7 +1403,7 @@ rl78_lex (void) char * save_input_pointer; char * bit = NULL; - while (ISSPACE (*rl78_lex_start) + while (is_whitespace (*rl78_lex_start) && rl78_lex_start != rl78_lex_end) rl78_lex_start ++; diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c index bcdc873..7492d3c 100644 --- a/gas/config/tc-rl78.c +++ b/gas/config/tc-rl78.c @@ -425,12 +425,11 @@ md_number_to_chars (char * buf, valueT val, int n) static void require_end_of_expr (const char *fname) { - while (* input_line_pointer == ' ' - || * input_line_pointer == '\t') + while (is_whitespace (* input_line_pointer)) input_line_pointer ++; - if (! * input_line_pointer - || strchr ("\n\r,", * input_line_pointer) + if (is_end_of_stmt (* input_line_pointer) + || * input_line_pointer == ',' || strchr (comment_chars, * input_line_pointer) || strchr (line_comment_chars, * input_line_pointer) || strchr (line_separator_chars, * input_line_pointer)) |