aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-02-03 12:21:46 +0100
committerJan Beulich <jbeulich@suse.com>2025-02-03 12:21:46 +0100
commit48ca138aa5bbf2152055837eedfc1298e5d84717 (patch)
treead5dacb58cc7baec1e3be1921ccb973915f598c8
parentea091addb352f955393c228af5ffe5d4faad97d7 (diff)
downloadbinutils-48ca138aa5bbf2152055837eedfc1298e5d84717.zip
binutils-48ca138aa5bbf2152055837eedfc1298e5d84717.tar.gz
binutils-48ca138aa5bbf2152055837eedfc1298e5d84717.tar.bz2
Score: 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).
-rw-r--r--gas/config/tc-score.c10
-rw-r--r--gas/config/tc-score7.c8
2 files changed, 9 insertions, 9 deletions
diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
index 62bd9ab..431147f 100644
--- a/gas/config/tc-score.c
+++ b/gas/config/tc-score.c
@@ -259,7 +259,7 @@ const size_t md_longopts_size = sizeof (md_longopts);
#define s3_BAD_SKIP_COMMA s3_BAD_ARGS
#define s3_BAD_GARBAGE _("garbage following instruction");
-#define s3_skip_whitespace(str) while (*(str) == ' ') ++(str)
+#define s3_skip_whitespace(str) while (is_whitespace (*(str))) ++(str)
/* The name of the readonly data section. */
#define s3_RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_aout_flavour \
@@ -1099,7 +1099,7 @@ s3_skip_past_comma (char **str)
char c;
int comma = 0;
- while ((c = *p) == ' ' || c == ',')
+ while (is_whitespace (c = *p) || c == ',')
{
p++;
if (c == ',' && comma++)
@@ -1376,7 +1376,7 @@ s3_data_op2 (char **str, int shift, enum score_data_type data_type)
for (; *dataptr != '\0'; dataptr++)
{
*dataptr = TOLOWER (*dataptr);
- if (*dataptr == '!' || *dataptr == ' ')
+ if (*dataptr == '!' || is_whitespace (*dataptr))
break;
}
dataptr = (char *)data_exp;
@@ -2650,7 +2650,7 @@ s3_parse_16_32_inst (char *insnstr, bool gen_frag_p)
s3_skip_whitespace (operator);
for (p = operator; *p != '\0'; p++)
- if ((*p == ' ') || (*p == '!'))
+ if (is_whitespace (*p) || (*p == '!'))
break;
if (*p == '!')
@@ -2700,7 +2700,7 @@ s3_parse_48_inst (char *insnstr, bool gen_frag_p)
s3_skip_whitespace (operator);
for (p = operator; *p != '\0'; p++)
- if (*p == ' ')
+ if (is_whitespace (*p))
break;
c = *p;
diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c
index 0717795..63a720e 100644
--- a/gas/config/tc-score7.c
+++ b/gas/config/tc-score7.c
@@ -104,7 +104,7 @@ static void s7_do_lw_pic (char *);
#define s7_BAD_SKIP_COMMA s7_BAD_ARGS
#define s7_BAD_GARBAGE _("garbage following instruction");
-#define s7_skip_whitespace(str) while (*(str) == ' ') ++(str)
+#define s7_skip_whitespace(str) while (is_whitespace (*(str))) ++(str)
/* The name of the readonly data section. */
#define s7_RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_aout_flavour \
@@ -1187,7 +1187,7 @@ s7_skip_past_comma (char **str)
char c;
int comma = 0;
- while ((c = *p) == ' ' || c == ',')
+ while (is_whitespace (c = *p) || c == ',')
{
p++;
if (c == ',' && comma++)
@@ -1501,7 +1501,7 @@ s7_data_op2 (char **str, int shift, enum score_data_type data_type)
for (; *dataptr != '\0'; dataptr++)
{
*dataptr = TOLOWER (*dataptr);
- if (*dataptr == '!' || *dataptr == ' ')
+ if (*dataptr == '!' || is_whitespace (*dataptr))
break;
}
dataptr = (char *) data_exp;
@@ -2781,7 +2781,7 @@ s7_parse_16_32_inst (char *insnstr, bool gen_frag_p)
s7_skip_whitespace (operator);
for (p = operator; *p != '\0'; p++)
- if ((*p == ' ') || (*p == '!'))
+ if (is_whitespace (*p) || (*p == '!'))
break;
if (*p == '!')