[binutils-gdb] v850: use is_whitespace()

Jan Beulich jbeulich@sourceware.org
Mon Feb 3 11:27:26 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=05b64c8657560c86c3ddb1b44bcea9ced4ff26a8

commit 05b64c8657560c86c3ddb1b44bcea9ced4ff26a8
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Feb 3 12:25:41 2025 +0100

    v850: 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 as well as ISSPACE()
    uses. At the same time use is_end_of_stmt() instead of a kind-of-open-
    coded check in adjacent code.

Diff:
---
 gas/config/tc-v850.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index d907211ce18..0a483439f9c 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1338,8 +1338,7 @@ vector_register_name (expressionS *expressionP)
 static void
 skip_white_space (void)
 {
-  while (*input_line_pointer == ' '
-	 || *input_line_pointer == '\t')
+  while (is_whitespace (*input_line_pointer))
     ++input_line_pointer;
 }
 
@@ -2306,7 +2305,7 @@ md_assemble (char *str)
   most_match_errmsg[0] = 0;
 
   /* Get the opcode.  */
-  for (s = str; *s != '\0' && ! ISSPACE (*s); s++)
+  for (s = str; ! is_end_of_stmt (*s) && ! is_whitespace (*s); s++)
     continue;
 
   if (*s != '\0')
@@ -2323,7 +2322,7 @@ md_assemble (char *str)
     }
 
   str = s;
-  while (ISSPACE (*str))
+  while (is_whitespace (*str))
     ++str;
 
   start_of_operands = str;
@@ -2384,7 +2383,7 @@ md_assemble (char *str)
 
 	  errmsg = NULL;
 
-	  while (*str == ' ')
+	  while (is_whitespace (*str))
 	    ++str;
 
 	  if (operand->flags & V850_OPERAND_BANG
@@ -2397,7 +2396,7 @@ md_assemble (char *str)
 	  if (*str == ',' || *str == '[' || *str == ']')
 	    ++str;
 
-	  while (*str == ' ')
+	  while (is_whitespace (*str))
 	    ++str;
 
 	  if (   (strcmp (opcode->name, "pushsp") == 0
@@ -2792,7 +2791,7 @@ md_assemble (char *str)
 		  str = input_line_pointer;
 		  input_line_pointer = hold;
 
-		  while (*str == ' ' || *str == ','
+		  while (is_whitespace (*str) || *str == ','
 			 || *str == '[' || *str == ']')
 		    ++str;
 		  continue;
@@ -2996,12 +2995,12 @@ md_assemble (char *str)
 	  str = input_line_pointer;
 	  input_line_pointer = hold;
 
-	  while (*str == ' ' || *str == ',' || *str == '[' || *str == ']'
+	  while (is_whitespace (*str) || *str == ',' || *str == '[' || *str == ']'
 		 || *str == ')')
 	    ++str;
 	}
 
-      while (ISSPACE (*str))
+      while (is_whitespace (*str))
 	++str;
 
       if (*str == '\0')


More information about the Binutils-cvs mailing list