[binutils-gdb] CR16: use is_whitespace()

Jan Beulich jbeulich@sourceware.org
Mon Feb 3 11:00:47 GMT 2025


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

commit 8ea323741197db6eb8f69e19dbd7127f217f918b
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Feb 3 11:58:49 2025 +0100

    CR16: 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.

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

diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c
index 4bc6a14187e..751a861f074 100644
--- a/gas/config/tc-cr16.c
+++ b/gas/config/tc-cr16.c
@@ -1219,7 +1219,7 @@ set_operand (char *operand, ins * cr16_ins)
       /* Set register pair base.  */
       if ((strchr (operandS,'(') != NULL))
 	{
-	  while ((*operandE != '(') && (! ISSPACE (*operandE)))
+	  while ((*operandE != '(') && (! is_whitespace (*operandE)))
 	    operandE++;
 	  if ((cur_arg->rp = get_index_register_pair (operandE)) == nullregister)
 	    as_bad (_("Illegal register pair `%s' in Instruction `%s'"),
@@ -1400,7 +1400,7 @@ parse_operands (ins * cr16_ins, char *operands)
 	  continue;
 	}
 
-      if (*operandT == ' ')
+      if (is_whitespace (*operandT))
 	as_bad (_("Illegal operands (whitespace): `%s'"), ins_parse);
 
       if (*operandT == '(')
@@ -1545,12 +1545,13 @@ check_cinv_options (char * operand)
       switch (*p)
 	{
 	case ',':
-	case ' ':
 	case 'i':
 	case 'u':
 	case 'd':
 	  break;
 	default:
+	  if (is_whitespace (*p))
+	    break;
 	  as_bad (_("Illegal `cinv' parameter: `%c'"), *p);
 	}
     }
@@ -2503,7 +2504,7 @@ md_assemble (char *op)
   reset_vars (op);
 
   /* Strip the mnemonic.  */
-  for (param = op; *param != 0 && !ISSPACE (*param); param++)
+  for (param = op; *param != 0 && !is_whitespace (*param); param++)
     ;
   *param++ = '\0';


More information about the Binutils-cvs mailing list