[v2,34/65] mn10300: use is_whitespace()

Message ID bc9e5604-bc21-466d-81dd-1c0d40b88039@suse.com
State New
Headers
Series gas: whitespace handling |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Jan Beulich Jan. 27, 2025, 4:29 p.m. UTC
  Convert open-coded checks as well as ISSPACE() uses. At the same time
use is_end_of_stmt() instead of kind-of-open-coded checks in adjacent
code.
---
v2: New.
  

Comments

Alexandre Oliva Feb. 7, 2025, 6:55 a.m. UTC | #1
On Jan 27, 2025, Jan Beulich <jbeulich@suse.com> wrote:

> Convert open-coded checks as well as ISSPACE() uses. At the same time
> use is_end_of_stmt() instead of kind-of-open-coded checks in adjacent
> code.

LGTM, thanks
  

Patch

--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -1241,7 +1241,7 @@  md_assemble (char *str)
   int match;
 
   /* 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';
@@ -1255,7 +1255,7 @@  md_assemble (char *str)
     }
 
   str = s;
-  while (ISSPACE (*str))
+  while (is_whitespace (*str))
     ++str;
 
   input_line_pointer = str;
@@ -1304,7 +1304,7 @@  md_assemble (char *str)
 	      next_opindex = 0;
 	    }
 
-	  while (*str == ' ' || *str == ',')
+	  while (is_whitespace (*str) || *str == ',')
 	    ++str;
 
 	  if (operand->flags & MN10300_OPERAND_RELAX)
@@ -1764,7 +1764,7 @@  md_assemble (char *str)
 	  str = input_line_pointer;
 	  input_line_pointer = hold;
 
-	  while (*str == ' ' || *str == ',')
+	  while (is_whitespace (*str) || *str == ',')
 	    ++str;
 	}
 
@@ -1815,10 +1815,10 @@  md_assemble (char *str)
       break;
     }
 
-  while (ISSPACE (*str))
+  while (is_whitespace (*str))
     ++str;
 
-  if (*str != '\0')
+  if (!is_end_of_stmt (*str))
     as_bad (_("junk at end of line: `%s'"), str);
 
   input_line_pointer = str;