aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-02-03 12:29:40 +0100
committerJan Beulich <jbeulich@suse.com>2025-02-03 12:29:40 +0100
commit0cb1f0def38bfd941ceebd1979f5d3d35da60b24 (patch)
treeb234ec0a2c699eff2db22fb9751f2408dbcb2709
parent716680bc55e22dbf01a78cce903e7bb262a1aa7e (diff)
downloadbinutils-0cb1f0def38bfd941ceebd1979f5d3d35da60b24.zip
binutils-0cb1f0def38bfd941ceebd1979f5d3d35da60b24.tar.gz
binutils-0cb1f0def38bfd941ceebd1979f5d3d35da60b24.tar.bz2
Z8k: 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). At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
-rw-r--r--gas/config/tc-z8k.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index 75fbabb..d73df4f 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -429,7 +429,7 @@ get_ctrl_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_UN
char *src = *ptr;
int i, l;
- while (*src == ' ')
+ while (is_whitespace (*src))
src++;
mode->mode = CLASS_CTRL;
@@ -472,7 +472,7 @@ get_flags_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_U
int i;
int j;
- while (*src == ' ')
+ while (is_whitespace (*src))
src++;
mode->mode = CLASS_FLAGS;
@@ -517,7 +517,7 @@ get_interrupt_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBU
char *src = *ptr;
int i, l;
- while (*src == ' ')
+ while (is_whitespace (*src))
src++;
mode->mode = CLASS_IMM;
@@ -607,7 +607,7 @@ get_cc_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_UNUS
char *src = *ptr;
int i, l;
- while (*src == ' ')
+ while (is_whitespace (*src))
src++;
mode->mode = CLASS_CC;
@@ -634,7 +634,7 @@ get_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_UNUSED)
mode->mode = 0;
- while (*src == ' ')
+ while (is_whitespace (*src))
src++;
if (*src == '#')
{
@@ -737,7 +737,7 @@ get_operands (const opcode_entry_type *opcode, char *op_end, op_type *operand)
case 0:
operand[0].mode = 0;
operand[1].mode = 0;
- while (*ptr == ' ')
+ while (is_whitespace (*ptr))
ptr++;
break;
@@ -745,7 +745,7 @@ get_operands (const opcode_entry_type *opcode, char *op_end, op_type *operand)
if (opcode->arg_info[0] == CLASS_CC)
{
get_cc_operand (&ptr, operand + 0, 0);
- while (*ptr == ' ')
+ while (is_whitespace (*ptr))
ptr++;
if (*ptr && ! is_end_of_line[(unsigned char) *ptr])
{
@@ -757,7 +757,7 @@ get_operands (const opcode_entry_type *opcode, char *op_end, op_type *operand)
else if (opcode->arg_info[0] == CLASS_FLAGS)
{
get_flags_operand (&ptr, operand + 0, 0);
- while (*ptr == ' ')
+ while (is_whitespace (*ptr))
ptr++;
if (*ptr && ! is_end_of_line[(unsigned char) *ptr])
{
@@ -779,7 +779,7 @@ get_operands (const opcode_entry_type *opcode, char *op_end, op_type *operand)
if (opcode->arg_info[0] == CLASS_CC)
{
get_cc_operand (&ptr, operand + 0, 0);
- while (*ptr == ' ')
+ while (is_whitespace (*ptr))
ptr++;
if (*ptr != ',' && strchr (ptr + 1, ','))
{
@@ -1219,12 +1219,12 @@ md_assemble (char *str)
opcode_entry_type *opcode;
/* Drop leading whitespace. */
- while (*str == ' ')
+ while (is_whitespace (*str))
str++;
/* Find the op code end. */
for (op_start = op_end = str;
- *op_end != 0 && *op_end != ' ' && ! is_end_of_line[(unsigned char) *op_end];
+ ! is_whitespace (*op_end) && ! is_end_of_stmt (*op_end);
op_end++)
;
@@ -1258,7 +1258,7 @@ md_assemble (char *str)
oc = *old;
*old = '\n';
- while (*input_line_pointer == ' ')
+ while (is_whitespace (*input_line_pointer))
input_line_pointer++;
p = (pseudo_typeS *) (opcode->func);