diff options
author | Jan Beulich <jbeulich@suse.com> | 2025-02-03 12:21:08 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2025-02-03 12:21:08 +0100 |
commit | e5792f3e779ef24f595931ef756a4075773d5311 (patch) | |
tree | c5e078aff405f1b17558698142a8827dd4f5c6cf | |
parent | f983b224f8fc35adc87d67539e8d669daf7a0c34 (diff) | |
download | binutils-e5792f3e779ef24f595931ef756a4075773d5311.zip binutils-e5792f3e779ef24f595931ef756a4075773d5311.tar.gz binutils-e5792f3e779ef24f595931ef756a4075773d5311.tar.bz2 |
s12z: use is_whitespace()
Convert open-coded checks. At the same time use is_end_of_stmt() instead
of open-coded checks in adjacent code. This then also fixes the prior
use of a wrong cast for an array index: Plain char may, after all, be
signed.
-rw-r--r-- | gas/config/tc-s12z.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c index 3e07ea7..9c8fcfe 100644 --- a/gas/config/tc-s12z.c +++ b/gas/config/tc-s12z.c @@ -207,7 +207,7 @@ s12z_init_after_args (void) static char * skip_whites (char *p) { - while (*p == ' ' || *p == '\t') + while (is_whitespace (*p)) p++; return p; @@ -347,7 +347,7 @@ static bool lex_match_string (const char *s) { char *p = input_line_pointer; - while (p != 0 && *p != '\t' && *p != ' ' && *p != '\0') + while (p != 0 && !is_whitespace (*p) && !is_end_of_stmt (*p)) { p++; } @@ -3790,7 +3790,7 @@ md_assemble (char *str) /* Find the opcode end and get the opcode in 'name'. The opcode is forced lower case (the opcode table only has lower case op-codes). */ for (op_start = op_end = str; - *op_end && !is_end_of_line[(int)*op_end] && *op_end != ' '; + !is_end_of_stmt (*op_end) && !is_whitespace (*op_end); op_end++) { name[nlen] = TOLOWER (op_start[nlen]); |