aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-02-03 11:56:04 +0100
committerJan Beulich <jbeulich@suse.com>2025-02-03 11:56:04 +0100
commit7c65d9d06fe15fec42362c14fca392c774b672a2 (patch)
treec9e138cc5c55e0908c6ff1912328cf8ce17c6266
parent72c260c6af01297f710cf13de4e062549c1e58d1 (diff)
downloadbinutils-7c65d9d06fe15fec42362c14fca392c774b672a2.zip
binutils-7c65d9d06fe15fec42362c14fca392c774b672a2.tar.gz
binutils-7c65d9d06fe15fec42362c14fca392c774b672a2.tar.bz2
d10v: use is_whitespace()
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included. At the same time use is_end_of_stmt() instead of open- coded checks in adjacent code.
-rw-r--r--gas/config/tc-d10v.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c
index d6c2a47..dd0292a 100644
--- a/gas/config/tc-d10v.c
+++ b/gas/config/tc-d10v.c
@@ -140,8 +140,7 @@ register_name (expressionS *expressionP)
int reg_number;
char c, *p = input_line_pointer;
- while (*p
- && *p != '\n' && *p != '\r' && *p != ',' && *p != ' ' && *p != ')')
+ while (!is_end_of_stmt (*p) && *p != ',' && !is_whitespace (*p) && *p != ')')
p++;
c = *p;
@@ -356,9 +355,9 @@ get_operands (expressionS exp[])
while (*p)
{
- while (*p == ' ' || *p == '\t' || *p == ',')
+ while (is_whitespace (*p) || *p == ',')
p++;
- if (*p == 0 || *p == '\n' || *p == '\r')
+ if (is_end_of_stmt (*p))
break;
if (*p == '@')
@@ -1410,12 +1409,12 @@ do_assemble (char *str, struct d10v_opcode **opcode)
expressionS myops[6];
/* Drop leading whitespace. */
- while (*str == ' ')
+ while (is_whitespace (*str))
str++;
/* Find the opcode end. */
for (op_start = op_end = (unsigned char *) str;
- *op_end && !is_end_of_line[*op_end] && *op_end != ' ';
+ !is_end_of_stmt (*op_end) && !is_whitespace (*op_end);
op_end++)
{
name[nlen] = TOLOWER (op_start[nlen]);