[v2,44/65] rl78: use is_whitespace()

Message ID b0b51dad-a74e-484f-9f48-f60dc0adeaf2@suse.com
State New
Headers
Series gas: whitespace handling |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed

Commit Message

Jan Beulich Jan. 27, 2025, 4:35 p.m. UTC
  Replace open-coded checks and convert ISSPACE() uses. At the same time
use is_end_of_stmt() instead of an open-coded check in adjacent code.
---
v2: New.
  

Patch

--- a/gas/config/rl78-parse.y
+++ b/gas/config/rl78-parse.y
@@ -1379,7 +1379,7 @@  find_bit_index (char *tok)
 	{
 	  last_digit = tok;
 	}
-      else if (ISSPACE (*tok))
+      else if (is_whitespace (*tok))
 	{
 	  /* skip */
 	}
@@ -1403,7 +1403,7 @@  rl78_lex (void)
   char * save_input_pointer;
   char * bit = NULL;
 
-  while (ISSPACE (*rl78_lex_start)
+  while (is_whitespace (*rl78_lex_start)
 	 && rl78_lex_start != rl78_lex_end)
     rl78_lex_start ++;
 
--- a/gas/config/tc-rl78.c
+++ b/gas/config/tc-rl78.c
@@ -425,12 +425,11 @@  md_number_to_chars (char * buf, valueT v
 static void
 require_end_of_expr (const char *fname)
 {
-  while (* input_line_pointer == ' '
-	 || * input_line_pointer == '\t')
+  while (is_whitespace (* input_line_pointer))
     input_line_pointer ++;
 
-  if (! * input_line_pointer
-      || strchr ("\n\r,", * input_line_pointer)
+  if (is_end_of_stmt (* input_line_pointer)
+      || * input_line_pointer == ','
       || strchr (comment_chars, * input_line_pointer)
       || strchr (line_comment_chars, * input_line_pointer)
       || strchr (line_separator_chars, * input_line_pointer))