From: Jan Beulich Date: Mon, 3 Feb 2025 11:21:46 +0000 (+0100) Subject: Score: use is_whitespace() X-Git-Tag: binutils-2_45~1720 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48ca138aa5bbf2152055837eedfc1298e5d84717;p=thirdparty%2Fbinutils-gdb.git 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). --- diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c index 62bd9ab4a1f..431147f5b13 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 07177954e5b..63a720e3dd4 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 == '!')