]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Score: use is_whitespace()
authorJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 11:21:46 +0000 (12:21 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 11:21:46 +0000 (12:21 +0100)
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).

gas/config/tc-score.c
gas/config/tc-score7.c

index 62bd9ab4a1fb6cf2fc81ed3df46001f924619648..431147f5b13530808ab17371b251465cf2be74a2 100644 (file)
@@ -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;
index 07177954e5b5aa48d759e739b55883bf505fb499..63a720e3dd44bffbd872e82a11cba4d5d2726553 100644 (file)
@@ -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 == '!')