[binutils-gdb] PPC: use is_whitespace()

Jan Beulich jbeulich@sourceware.org
Mon Feb 3 11:20:41 GMT 2025


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

commit 2f7cfc9eb228b8979910ebec605432f1aaae6807
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Feb 3 12:18:34 2025 +0100

    PPC: 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 switch ISSPACE() uses over. At the same time
    use is_end_of_stmt() instead of an open-coded nul char check.

Diff:
---
 gas/config/tc-ppc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 4e0bf24f365..5f2bc046a08 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -3325,7 +3325,7 @@ md_assemble (char *str)
   unsigned int insn_length;
 
   /* Get the opcode.  */
-  for (s = str; *s != '\0' && ! ISSPACE (*s); s++)
+  for (s = str; ! is_end_of_stmt (*s) && ! is_whitespace (*s); s++)
     ;
   if (*s != '\0')
     *s++ = '\0';
@@ -3351,7 +3351,7 @@ md_assemble (char *str)
     }
 
   str = s;
-  while (ISSPACE (*str))
+  while (is_whitespace (*str))
     ++str;
 
 #ifdef OBJ_XCOFF
@@ -3967,7 +3967,7 @@ md_assemble (char *str)
 	    {
 	      do
 		++str;
-	      while (ISSPACE (*str));
+	      while (is_whitespace (*str));
 	      endc = ',';
 	    }
 	}
@@ -3996,7 +3996,7 @@ md_assemble (char *str)
 	}
     }
 
-  while (ISSPACE (*str))
+  while (is_whitespace (*str))
     ++str;
 
   if (*str != '\0')
@@ -5831,7 +5831,7 @@ ppc_tc (int ignore ATTRIBUTE_UNUSED)
 
   /* Skip the TOC symbol name.  */
   while (is_part_of_name (*input_line_pointer)
-	 || *input_line_pointer == ' '
+	 || is_whitespace (*input_line_pointer)
 	 || *input_line_pointer == '['
 	 || *input_line_pointer == ']'
 	 || *input_line_pointer == '{'


More information about the Binutils-cvs mailing list