]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas char/unsigned char casts
authorAlan Modra <amodra@gmail.com>
Tue, 8 Jul 2025 23:42:20 +0000 (09:12 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 9 Jul 2025 00:05:07 +0000 (09:35 +0930)
This patch removes many unneeded casts to char or unsigned char.  It's
worth noting that safe-ctype.h macros ISDIGIT and the like cope with
either signed or unsigned char.
In some cases a cast to unsigned char is replaced by anding with 0xff,
which accomplishes the same thing but doesn't rely on char being eight
bits.  The patch also removes pointer casts, and a few unsigned char
pointer variables.

22 files changed:
gas/app.c
gas/atof-generic.c
gas/config/tc-arm.c
gas/config/tc-cr16.c
gas/config/tc-d10v.c
gas/config/tc-dlx.c
gas/config/tc-ft32.c
gas/config/tc-loongarch.c
gas/config/tc-m68hc11.c
gas/config/tc-mmix.c
gas/config/tc-mn10300.c
gas/config/tc-moxie.c
gas/config/tc-score7.c
gas/config/tc-sh.c
gas/config/tc-spu.c
gas/config/tc-tic4x.c
gas/config/tc-tic6x.c
gas/config/tc-tilegx.c
gas/config/tc-v850.c
gas/config/tc-xtensa.c
gas/config/tc-z80.c
gas/ecoff.c

index 9e05ef11bebd205d081a3b9045f27072522cd4e5..b9df9daba569a16cde1c546d7b2d6ec21ccb06fa 100644 (file)
--- a/gas/app.c
+++ b/gas/app.c
@@ -577,7 +577,7 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen,
 
       if (check_multibyte)
        (void) scan_for_multibyte_characters ((const unsigned char *) from,
-                                             (const unsigned char) fromend,
+                                             (const unsigned char *) fromend,
                                              true /* Generate warnings.  */);
     }
 
@@ -1218,7 +1218,7 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen,
              else
                ch = process_escape (ch);
            }
-         sprintf (out_buf, "%d", (int) (unsigned char) ch);
+         sprintf (out_buf, "%d", ch & 0xff);
 
          /* None of these 'x constants for us.  We want 'x'.  */
          if ((ch = GET ()) != '\'')
index 5bf0867ccdf98a16c0daf988d83e7e7fc95d5dd4..944f209654ada30041633dd651333dd3d3863e31 100644 (file)
@@ -303,7 +303,7 @@ atof_generic (/* return pointer to just AFTER number we read.  */
            {
              if (decimal_exponent > LONG_MAX / 10
                  || (decimal_exponent == LONG_MAX / 10
-                     && c > '0' + (char) (LONG_MAX - LONG_MAX / 10 * 10)))
+                     && c > '0' + (LONG_MAX - LONG_MAX / 10 * 10)))
                return_value = ERROR_EXPONENT_OVERFLOW;
              decimal_exponent = decimal_exponent * 10 + c - '0';
            }
index 9a1ef1bd1c0332091b8a3e5a3a535bb0d42ac813..5fabf71c2f5d6f920885f13de47eee32b56681e7 100644 (file)
@@ -26038,14 +26038,13 @@ static valueT
 md_chars_to_number (char * buf, int n)
 {
   valueT result = 0;
-  unsigned char * where = (unsigned char *) buf;
 
   if (target_big_endian)
     {
       while (n--)
        {
          result <<= 8;
-         result |= (*where++ & 255);
+         result |= (*buf++ & 255);
        }
     }
   else
@@ -26053,7 +26052,7 @@ md_chars_to_number (char * buf, int n)
       while (n--)
        {
          result <<= 8;
-         result |= (where[n] & 255);
+         result |= (buf[n] & 255);
        }
     }
 
index 4bbab7f2deec8858a2c564cee1954bac11cd2010..5b5b651dae8352f6c64ac339bf22a6b05469ba1a 100644 (file)
@@ -2514,7 +2514,7 @@ md_assemble (char *op)
       strcpy (param1, get_b_cc (op));
       strcat (param1,",");
       strcat (param1, param);
-      param = (char *) &param1;
+      param = param1;
       cr16_assemble ("b", param);
       return;
     }
index 3bdca91ba8d40b6023965a668c0b974d0e360999..98d5e8bc0cfaed3347676175d1b24767bd480384 100644 (file)
@@ -283,11 +283,11 @@ md_begin (void)
      on the operands.  This hash table then provides a quick index to
      the first opcode with a particular name in the opcode table.  */
 
-  for (opcode = (struct d10v_opcode *) d10v_opcodes; opcode->name; opcode++)
+  for (opcode = d10v_opcodes; opcode->name; opcode++)
     {
       if (strcmp (prev_name, opcode->name))
        {
-         prev_name = (char *) opcode->name;
+         prev_name = opcode->name;
          str_hash_insert (d10v_hash, opcode->name, opcode, 0);
        }
     }
index abb283dda3209d22daa387fabb6e17cdfb2325d9..08948d2f7da5a894e1ada01be85062e64cc7344b 100644 (file)
@@ -187,7 +187,7 @@ is_ldst_registers (char *name)
 
   /* The first character of the register name got to be either %, $, r of R.  */
   if ((ptr[0] == '%' || ptr[0] == '$' || ptr[0] == 'r' || ptr[0] == 'R')
-      && ISDIGIT ((unsigned char) ptr[1]))
+      && ISDIGIT (ptr[1]))
     return 1;
 
   /* Now check the software register representation.  */
@@ -616,7 +616,7 @@ parse_operand (char *s, expressionS *operandp)
 
   /* Check for the % and $ register representation    */
   if ((s[0] == '%' || s[0] == '$' || s[0] == 'r' || s[0] == 'R')
-      && ISDIGIT ((unsigned char) s[1]))
+      && ISDIGIT (s[1]))
     {
       /* We have a numeric register expression.  No biggy.  */
       s += 1;
@@ -1124,7 +1124,7 @@ md_operand (expressionS* expressionP)
 {
   /* Check for the #number representation    */
   if (input_line_pointer[0] == '#' &&
-      ISDIGIT ((unsigned char) input_line_pointer[1]))
+      ISDIGIT (input_line_pointer[1]))
     {
       /* We have a numeric number expression.  No biggy.  */
       input_line_pointer += 1; /* Skip # */
index e5d9a8a9bc6c220906d544f6d1efd03975db4a58..7e68e83f90dc9a9a99e67296229cb7b939498685 100644 (file)
@@ -530,12 +530,11 @@ static valueT
 md_chars_to_number (char * buf, int n)
 {
   valueT result = 0;
-  unsigned char * where = (unsigned char *) buf;
 
   while (n--)
     {
       result <<= 8;
-      result |= (where[n] & 255);
+      result |= (buf[n] & 255);
     }
 
   return result;
index a91b12eaa9cce08bf9df8eb2b127f627ba49f113..047dc6fd3bb552c089cb88c177888d7ae7178b20 100644 (file)
@@ -180,7 +180,6 @@ md_parse_option (int c, const char *arg)
   int ret = 1;
   char lp64[256] = "";
   char ilp32[256] = "";
-  unsigned char *suf = (unsigned char *)arg;
 
   lp64['s'] = lp64['S'] = EF_LOONGARCH_ABI_SOFT_FLOAT;
   lp64['f'] = lp64['F'] = EF_LOONGARCH_ABI_SINGLE_FLOAT;
@@ -193,7 +192,7 @@ md_parse_option (int c, const char *arg)
   switch (c)
     {
     case OPTION_ABI:
-      if (strncasecmp (arg, "lp64", 4) == 0 && lp64[suf[4]] != 0)
+      if (strncasecmp (arg, "lp64", 4) == 0 && lp64[arg[4] & 0xff] != 0)
        {
          LARCH_opts.ase_ilp32 = 1;
          LARCH_opts.ase_lp64 = 1;
@@ -201,11 +200,11 @@ md_parse_option (int c, const char *arg)
          LARCH_opts.ase_lasx = 1;
          LARCH_opts.ase_lvz = 1;
          LARCH_opts.ase_lbt = 1;
-         LARCH_opts.ase_abi = lp64[suf[4]];
+         LARCH_opts.ase_abi = lp64[arg[4] & 0xff];
        }
-      else if (strncasecmp (arg, "ilp32", 5) == 0 && ilp32[suf[5]] != 0)
+      else if (strncasecmp (arg, "ilp32", 5) == 0 && ilp32[arg[5] & 0xff] != 0)
        {
-         LARCH_opts.ase_abi = ilp32[suf[5]];
+         LARCH_opts.ase_abi = ilp32[arg[5] & 0xff];
          LARCH_opts.ase_ilp32 = 1;
        }
       else
@@ -2284,12 +2283,12 @@ loongarch_relax_frag (asection *sec, fragS *fragp,
 static void
 loongarch_convert_frag_branch (fragS *fragp)
 {
-  bfd_byte *buf;
+  char *buf;
   expressionS exp;
   fixS *fixp;
   insn_t insn;
 
-  buf = (bfd_byte *)fragp->fr_literal + fragp->fr_fix;
+  buf = fragp->fr_literal + fragp->fr_fix;
 
   exp.X_op = O_symbol;
   exp.X_add_symbol = fragp->fr_symbol;
@@ -2319,17 +2318,17 @@ loongarch_convert_frag_branch (fragS *fragp)
 
       /* Add the B instruction and jump to the original target.  */
       bfd_putl32 (LARCH_B, buf);
-      fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
+      fixp = fix_new_exp (fragp, buf - fragp->fr_literal,
                          4, &exp, false, BFD_RELOC_LARCH_B26);
       buf += 4;
       break;
     case RELAX_BRANCH_21:
-      fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
+      fixp = fix_new_exp (fragp, buf - fragp->fr_literal,
                          4, &exp, false, BFD_RELOC_LARCH_B21);
       buf += 4;
       break;
     case RELAX_BRANCH_16:
-      fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
+      fixp = fix_new_exp (fragp, buf - fragp->fr_literal,
                          4, &exp, false, BFD_RELOC_LARCH_B16);
       buf += 4;
       break;
@@ -2341,8 +2340,7 @@ loongarch_convert_frag_branch (fragS *fragp)
   fixp->fx_file = fragp->fr_file;
   fixp->fx_line = fragp->fr_line;
 
-  gas_assert (buf == (bfd_byte *)fragp->fr_literal
-             + fragp->fr_fix + fragp->fr_var);
+  gas_assert (buf == fragp->fr_literal + fragp->fr_fix + fragp->fr_var);
 
   fragp->fr_fix += fragp->fr_var;
 }
@@ -2352,7 +2350,7 @@ loongarch_convert_frag_branch (fragS *fragp)
 static void
 loongarch_convert_frag_align (fragS *fragp, asection *sec)
 {
-  bfd_byte *buf = (bfd_byte *)fragp->fr_literal + fragp->fr_fix;
+  char *buf = fragp->fr_literal + fragp->fr_fix;
 
   offsetT nop_bytes;
   if (NULL == fragp->fr_symbol)
@@ -2371,7 +2369,7 @@ loongarch_convert_frag_align (fragS *fragp, asection *sec)
       exp.X_add_symbol = fragp->fr_symbol;
       exp.X_add_number = fragp->fr_offset;
 
-      fixS *fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
+      fixS *fixp = fix_new_exp (fragp, buf - fragp->fr_literal,
                                nop_bytes, &exp, false, BFD_RELOC_LARCH_ALIGN);
       fixp->fx_file = fragp->fr_file;
       fixp->fx_line = fragp->fr_line;
@@ -2379,8 +2377,7 @@ loongarch_convert_frag_align (fragS *fragp, asection *sec)
       buf += nop_bytes;
     }
 
-  gas_assert (buf == (bfd_byte *)fragp->fr_literal
-             + fragp->fr_fix + fragp->fr_var);
+  gas_assert (buf == fragp->fr_literal + fragp->fr_fix + fragp->fr_var);
 
   fragp->fr_fix += fragp->fr_var;
 }
index 17856390c239aa485cb98d3e6bdb99305e258dfe..6dd8120cc350de5fa37d9671dc150314ff0c21e0 100644 (file)
@@ -989,7 +989,7 @@ print_opcode_list (void)
                printf ("\n");
 
              printf ("%-5.5s ", opcodes->name);
-             prev_name = (char *) opcodes->name;
+             prev_name = opcodes->name;
            }
          if (fmt[0])
            printf ("  [%s]", fmt);
index d86ae7a25ded2bbd21b079fe5e14c99c938477f1..8b052dce9676f56959c2698efb48c2ef832ff46b 100644 (file)
@@ -504,7 +504,7 @@ get_operands (int max_operands, char *s, expressionS *exp)
   /* Mark the end of the valid operands with an illegal expression.  */
   exp[numexp].X_op = O_illegal;
 
-  return (numexp);
+  return numexp;
 }
 
 /* Get the value of a special register, or -1 if the name does not match
@@ -1912,7 +1912,7 @@ mmix_assemble_return_nonzero (char *str)
   /* Normal instruction handling downcases, so we must too.  */
   while (ISALNUM (*s2))
     {
-      if (ISUPPER ((unsigned char) *s2))
+      if (ISUPPER (*s2))
        *s2 = TOLOWER (*s2);
       s2++;
     }
index 4e24254e4e1fb82b4a1669a8f690256a67e0fbc6..4e0072d0826fd62f929d496fdcce52810a6f7c1d 100644 (file)
@@ -923,7 +923,7 @@ md_begin (void)
     {
       if (strcmp (prev_name, op->name))
        {
-         prev_name = (char *) op->name;
+         prev_name = op->name;
          str_hash_insert (mn10300_hash, op->name, op, 0);
        }
       op++;
index 2d5e112a4f2f758dc574c41d7a995c91499a81ac..cb8adfb2ce4dd37d1e5b3232de46f820bb6875e2 100644 (file)
@@ -731,14 +731,13 @@ static valueT
 md_chars_to_number (char * buf, int n)
 {
   valueT result = 0;
-  unsigned char * where = (unsigned char *) buf;
 
   if (target_big_endian)
     {
       while (n--)
        {
          result <<= 8;
-         result |= (*where++ & 255);
+         result |= (*buf++ & 255);
        }
     }
   else
@@ -746,7 +745,7 @@ md_chars_to_number (char * buf, int n)
       while (n--)
        {
          result <<= 8;
-         result |= (where[n] & 255);
+         result |= (buf[n] & 255);
        }
     }
 
index d0b5c1bccc7fb10558eaf850a99b2f57352a5c95..bf15007941f8b8b692006c958c6cdf715f0e6efe 100644 (file)
@@ -5130,14 +5130,13 @@ static valueT
 s7_md_chars_to_number (char *buf, int n)
 {
   valueT result = 0;
-  unsigned char *where = (unsigned char *) buf;
 
   if (target_big_endian)
     {
       while (n--)
         {
           result <<= 8;
-          result |= (*where++ & 255);
+          result |= (*buf++ & 255);
         }
     }
   else
@@ -5145,7 +5144,7 @@ s7_md_chars_to_number (char *buf, int n)
       while (n--)
         {
           result <<= 8;
-          result |= (where[n] & 255);
+          result |= (buf[n] & 255);
         }
     }
 
@@ -5679,7 +5678,7 @@ s7_s_score_set (int x ATTRIBUTE_UNUSED)
 
   while (!is_end_of_stmt (*input_line_pointer))
     {
-      name[i] = (char) * input_line_pointer;
+      name[i] = *input_line_pointer;
       i++;
       ++input_line_pointer;
     }
index 6d077b27a74af4b1552e41344ab38ebad52aaa30..c87a2e1239606b647e5d900fe4ca8e406f058860 100644 (file)
@@ -605,7 +605,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
       if (l1 == '1')
        {
          if (src[2] >= '0' && src[2] <= '5'
-             && ! IDENT_CHAR ((unsigned char) src[3]))
+             && ! IDENT_CHAR (src[3]))
            {
              *mode = A_REG_N;
              *reg = 10 + src[2] - '0';
@@ -613,26 +613,26 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
            }
        }
       if (l1 >= '0' && l1 <= '9'
-         && ! IDENT_CHAR ((unsigned char) src[2]))
+         && ! IDENT_CHAR (src[2]))
        {
          *mode = A_REG_N;
          *reg = (l1 - '0');
          return 2;
        }
       if (l1 >= '0' && l1 <= '7' && strncasecmp (&src[2], "_bank", 5) == 0
-         && ! IDENT_CHAR ((unsigned char) src[7]))
+         && ! IDENT_CHAR (src[7]))
        {
          *mode = A_REG_B;
          *reg  = (l1 - '0');
          return 7;
        }
 
-      if (l1 == 'e' && ! IDENT_CHAR ((unsigned char) src[2]))
+      if (l1 == 'e' && ! IDENT_CHAR (src[2]))
        {
          *mode = A_RE;
          return 2;
        }
-      if (l1 == 's' && ! IDENT_CHAR ((unsigned char) src[2]))
+      if (l1 == 's' && ! IDENT_CHAR (src[2]))
        {
          *mode = A_RS;
          return 2;
@@ -643,13 +643,13 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
     {
       if (l1 == '0')
        {
-         if (! IDENT_CHAR ((unsigned char) src[2]))
+         if (! IDENT_CHAR (src[2]))
            {
              *mode = DSP_REG_N;
              *reg = A_A0_NUM;
              return 2;
            }
-         if (TOLOWER (src[2]) == 'g' && ! IDENT_CHAR ((unsigned char) src[3]))
+         if (TOLOWER (src[2]) == 'g' && ! IDENT_CHAR (src[3]))
            {
              *mode = DSP_REG_N;
              *reg = A_A0G_NUM;
@@ -658,13 +658,13 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
        }
       if (l1 == '1')
        {
-         if (! IDENT_CHAR ((unsigned char) src[2]))
+         if (! IDENT_CHAR (src[2]))
            {
              *mode = DSP_REG_N;
              *reg = A_A1_NUM;
              return 2;
            }
-         if (TOLOWER (src[2]) == 'g' && ! IDENT_CHAR ((unsigned char) src[3]))
+         if (TOLOWER (src[2]) == 'g' && ! IDENT_CHAR (src[3]))
            {
              *mode = DSP_REG_N;
              *reg = A_A1G_NUM;
@@ -673,21 +673,21 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
        }
 
       if (l1 == 'x' && src[2] >= '0' && src[2] <= '1'
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          *mode = A_REG_N;
          *reg = 4 + (l1 - '0');
          return 3;
        }
       if (l1 == 'y' && src[2] >= '0' && src[2] <= '1'
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          *mode = A_REG_N;
          *reg = 6 + (l1 - '0');
          return 3;
        }
       if (l1 == 's' && src[2] >= '0' && src[2] <= '3'
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          int n = l1 - '0';
 
@@ -697,7 +697,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
        }
     }
 
-  if (l0 == 'i' && l1 && ! IDENT_CHAR ((unsigned char) src[2]))
+  if (l0 == 'i' && l1 && ! IDENT_CHAR (src[2]))
     {
       if (l1 == 's')
        {
@@ -720,7 +720,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
     }
 
   if (l0 == 'x' && l1 >= '0' && l1 <= '1'
-      && ! IDENT_CHAR ((unsigned char) src[2]))
+      && ! IDENT_CHAR (src[2]))
     {
       *mode = DSP_REG_N;
       *reg = A_X0_NUM + l1 - '0';
@@ -728,7 +728,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
     }
 
   if (l0 == 'y' && l1 >= '0' && l1 <= '1'
-      && ! IDENT_CHAR ((unsigned char) src[2]))
+      && ! IDENT_CHAR (src[2]))
     {
       *mode = DSP_REG_N;
       *reg = A_Y0_NUM + l1 - '0';
@@ -736,7 +736,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
     }
 
   if (l0 == 'm' && l1 >= '0' && l1 <= '1'
-      && ! IDENT_CHAR ((unsigned char) src[2]))
+      && ! IDENT_CHAR (src[2]))
     {
       *mode = DSP_REG_N;
       *reg = l1 == '0' ? A_M0_NUM : A_M1_NUM;
@@ -745,59 +745,59 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
 
   if (l0 == 's'
       && l1 == 's'
-      && TOLOWER (src[2]) == 'r' && ! IDENT_CHAR ((unsigned char) src[3]))
+      && TOLOWER (src[2]) == 'r' && ! IDENT_CHAR (src[3]))
     {
       *mode = A_SSR;
       return 3;
     }
 
   if (l0 == 's' && l1 == 'p' && TOLOWER (src[2]) == 'c'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_SPC;
       return 3;
     }
 
   if (l0 == 's' && l1 == 'g' && TOLOWER (src[2]) == 'r'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_SGR;
       return 3;
     }
 
   if (l0 == 'd' && l1 == 's' && TOLOWER (src[2]) == 'r'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_DSR;
       return 3;
     }
 
   if (l0 == 'd' && l1 == 'b' && TOLOWER (src[2]) == 'r'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_DBR;
       return 3;
     }
 
-  if (l0 == 's' && l1 == 'r' && ! IDENT_CHAR ((unsigned char) src[2]))
+  if (l0 == 's' && l1 == 'r' && ! IDENT_CHAR (src[2]))
     {
       *mode = A_SR;
       return 2;
     }
 
-  if (l0 == 's' && l1 == 'p' && ! IDENT_CHAR ((unsigned char) src[2]))
+  if (l0 == 's' && l1 == 'p' && ! IDENT_CHAR (src[2]))
     {
       *mode = A_REG_N;
       *reg = 15;
       return 2;
     }
 
-  if (l0 == 'p' && l1 == 'r' && ! IDENT_CHAR ((unsigned char) src[2]))
+  if (l0 == 'p' && l1 == 'r' && ! IDENT_CHAR (src[2]))
     {
       *mode = A_PR;
       return 2;
     }
-  if (l0 == 'p' && l1 == 'c' && ! IDENT_CHAR ((unsigned char) src[2]))
+  if (l0 == 'p' && l1 == 'c' && ! IDENT_CHAR (src[2]))
     {
       /* Don't use A_DISP_PC here - that would accept stuff like 'mova pc,r0'
          and use an uninitialized immediate.  */
@@ -805,26 +805,26 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
       return 2;
     }
   if (l0 == 'g' && l1 == 'b' && TOLOWER (src[2]) == 'r'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_GBR;
       return 3;
     }
   if (l0 == 'v' && l1 == 'b' && TOLOWER (src[2]) == 'r'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_VBR;
       return 3;
     }
 
   if (l0 == 't' && l1 == 'b' && TOLOWER (src[2]) == 'r'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_TBR;
       return 3;
     }
   if (l0 == 'm' && l1 == 'a' && TOLOWER (src[2]) == 'c'
-      && ! IDENT_CHAR ((unsigned char) src[4]))
+      && ! IDENT_CHAR (src[4]))
     {
       if (TOLOWER (src[3]) == 'l')
        {
@@ -838,7 +838,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
        }
     }
   if (l0 == 'm' && l1 == 'o' && TOLOWER (src[2]) == 'd'
-      && ! IDENT_CHAR ((unsigned char) src[3]))
+      && ! IDENT_CHAR (src[3]))
     {
       *mode = A_MOD;
       return 3;
@@ -848,7 +848,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
       if (src[2] == '1')
        {
          if (src[3] >= '0' && src[3] <= '5'
-             && ! IDENT_CHAR ((unsigned char) src[4]))
+             && ! IDENT_CHAR (src[4]))
            {
              *mode = F_REG_N;
              *reg = 10 + src[3] - '0';
@@ -856,7 +856,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
            }
        }
       if (src[2] >= '0' && src[2] <= '9'
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          *mode = F_REG_N;
          *reg = (src[2] - '0');
@@ -868,7 +868,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
       if (src[2] == '1')
        {
          if (src[3] >= '0' && src[3] <= '4' && ! ((src[3] - '0') & 1)
-             && ! IDENT_CHAR ((unsigned char) src[4]))
+             && ! IDENT_CHAR (src[4]))
            {
              *mode = D_REG_N;
              *reg = 10 + src[3] - '0';
@@ -876,7 +876,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
            }
        }
       if (src[2] >= '0' && src[2] <= '8' && ! ((src[2] - '0') & 1)
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          *mode = D_REG_N;
          *reg = (src[2] - '0');
@@ -888,7 +888,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
       if (src[2] == '1')
        {
          if (src[3] >= '0' && src[3] <= '4' && ! ((src[3] - '0') & 1)
-             && ! IDENT_CHAR ((unsigned char) src[4]))
+             && ! IDENT_CHAR (src[4]))
            {
              *mode = X_REG_N;
              *reg = 11 + src[3] - '0';
@@ -896,7 +896,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
            }
        }
       if (src[2] >= '0' && src[2] <= '8' && ! ((src[2] - '0') & 1)
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          *mode = X_REG_N;
          *reg = (src[2] - '0') + 1;
@@ -905,14 +905,14 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
     }
   if (l0 == 'f' && l1 == 'v')
     {
-      if (src[2] == '1'&& src[3] == '2' && ! IDENT_CHAR ((unsigned char) src[4]))
+      if (src[2] == '1'&& src[3] == '2' && ! IDENT_CHAR (src[4]))
        {
          *mode = V_REG_N;
          *reg = 12;
          return 4;
        }
       if ((src[2] == '0' || src[2] == '4' || src[2] == '8')
-         && ! IDENT_CHAR ((unsigned char) src[3]))
+         && ! IDENT_CHAR (src[3]))
        {
          *mode = V_REG_N;
          *reg = (src[2] - '0');
@@ -921,7 +921,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
     }
   if (l0 == 'f' && l1 == 'p' && TOLOWER (src[2]) == 'u'
       && TOLOWER (src[3]) == 'l'
-      && ! IDENT_CHAR ((unsigned char) src[4]))
+      && ! IDENT_CHAR (src[4]))
     {
       *mode = FPUL_N;
       return 4;
@@ -929,7 +929,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
 
   if (l0 == 'f' && l1 == 'p' && TOLOWER (src[2]) == 's'
       && TOLOWER (src[3]) == 'c'
-      && TOLOWER (src[4]) == 'r' && ! IDENT_CHAR ((unsigned char) src[5]))
+      && TOLOWER (src[4]) == 'r' && ! IDENT_CHAR (src[5]))
     {
       *mode = FPSCR_N;
       return 5;
@@ -937,7 +937,7 @@ parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
 
   if (l0 == 'x' && l1 == 'm' && TOLOWER (src[2]) == 't'
       && TOLOWER (src[3]) == 'r'
-      && TOLOWER (src[4]) == 'x' && ! IDENT_CHAR ((unsigned char) src[5]))
+      && TOLOWER (src[4]) == 'x' && ! IDENT_CHAR (src[5]))
     {
       *mode = XMTRX_M4;
       return 5;
index e189d1b88fa2c0a07b8f737de58baac89b33163e..f19ca7ee48f61591baa6bf6923ab92fec6162078 100644 (file)
@@ -569,7 +569,7 @@ get_reg (const char *param, struct spu_insn *insn, int arg, int accept_expr)
       char *save_ptr;
       expressionS ex;
       save_ptr = input_line_pointer;
-      input_line_pointer = (char *)param;
+      input_line_pointer = (char *) param;
       expression (&ex);
       param = input_line_pointer;
       input_line_pointer = save_ptr;
@@ -721,7 +721,7 @@ md_create_short_jump (char *ptr,
                      fragS *frag,
                      symbolS *to_symbol)
 {
-  ptr[0] = (char) 0xc0;
+  ptr[0] = 0xc0;
   ptr[1] = 0x00;
   ptr[2] = 0x00;
   ptr[3] = 0x00;
@@ -743,7 +743,7 @@ md_create_long_jump (char *ptr,
                     fragS *frag,
                     symbolS *to_symbol)
 {
-  ptr[0] = (char) 0xc0;
+  ptr[0] = 0xc0;
   ptr[1] = 0x00;
   ptr[2] = 0x00;
   ptr[3] = 0x00;
index 22a4eb8007cae160fc92c483f4cb5ba47ae7c3b8..3a3123cbf6a1f758174a777277c9b39e09bc7ca5 100644 (file)
@@ -2814,7 +2814,7 @@ md_undefined_symbol (char *name)
       char *s = name + 1;
       int lab = 0;
 
-      while (ISDIGIT ((unsigned char) *s))
+      while (ISDIGIT (*s))
        {
          lab = lab * 10 + *s - '0';
          s++;
index b58074fbd0024823a264698843721c7dc1e75132..0c88e60f8ae5207e781eac94c53f7959369ec89b 100644 (file)
@@ -3083,14 +3083,13 @@ static valueT
 md_chars_to_number (char *buf, int n)
 {
   valueT result = 0;
-  unsigned char *p = (unsigned char *) buf;
 
   if (target_big_endian)
     {
       while (n--)
        {
          result <<= 8;
-         result |= (*p++ & 0xff);
+         result |= (*buf++ & 0xff);
        }
     }
   else
@@ -3098,7 +3097,7 @@ md_chars_to_number (char *buf, int n)
       while (n--)
        {
          result <<= 8;
-         result |= (p[n] & 0xff);
+         result |= (buf[n] & 0xff);
        }
     }
 
index 1392618c5995cc972d93a5b4fdd7c2aa5862378d..853e940b733599319f1dc10b1520c81b8818c97c 100644 (file)
@@ -1678,7 +1678,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
         ORing in values is OK since we know the existing bits for
         this operand are zero.  */
       for (; bits != 0; bits >>= 8)
-       *p++ |= (char)bits;
+       *p++ |= bits;
     }
   else
     {
index d7f609f9fcdb51e24af3c90ecf870b94e5ce8037..8a86b1d2b8973272245af66bec64f2317f67aa63 100644 (file)
@@ -1956,7 +1956,7 @@ md_begin (void)
     {
       if (strcmp (prev_name, op->name))
        {
-         prev_name = (char *) op->name;
+         prev_name = op->name;
          str_hash_insert (v850_hash, op->name, op, 0);
        }
       op++;
index 4b67f76289df7254f9e29b7bed69671373f03577..144016962cb0f9484a72b6927e029b6f987e53f5 100644 (file)
@@ -1903,7 +1903,7 @@ tc_get_register (const char *prefix)
       return ERROR_REG_NUM;
     }
 
-  if (!ISDIGIT ((unsigned char) *input_line_pointer))
+  if (!ISDIGIT (*input_line_pointer))
     {
       as_bad (_("bad register number: %s"), input_line_pointer);
       return ERROR_REG_NUM;
@@ -1911,7 +1911,7 @@ tc_get_register (const char *prefix)
 
   reg = 0;
 
-  while (ISDIGIT ((int) *input_line_pointer))
+  while (ISDIGIT (*input_line_pointer))
     reg = reg * 10 + *input_line_pointer++ - '0';
 
   if (!(next_expr = expression_end (input_line_pointer)))
index 3abc0268699593ac01ac060e82fbf18a4d4986a9..7ffd82e04539c1658dbc98efc5b736f5905afa24 100644 (file)
@@ -2966,10 +2966,10 @@ emit_lea (char prefix, char opcode, const char * args)
   switch (rnum)
     {
     case REG_IX:
-      opcode = (opcode == (char)0x33) ? 0x55 : (opcode|0x00);
+      opcode = opcode == 0x33 ? 0x55 : opcode | 0x00;
       break;
     case REG_IY:
-      opcode = (opcode == (char)0x32) ? 0x54 : (opcode|0x01);
+      opcode = opcode == 0x32 ? 0x54 : opcode | 0x01;
     }
 
   q = frag_more (2);
@@ -3420,7 +3420,7 @@ assemble_suffix (const char **suffix)
         i = 0x40;
         break;
     }
-  *frag_more (1) = (char)i;
+  *frag_more (1) = i;
   switch (i)
     {
     case 0x40: inst_mode = INST_MODE_FORCED | INST_MODE_S | INST_MODE_IS; break;
@@ -4064,8 +4064,8 @@ str_to_zeda32(char *litP, int *sizeP)
   else if (!sign)
     mantissa &= (1ull << 23) - 1;
   for (i = 0; i < 24; i += 8)
-    *litP++ = (char)(mantissa >> i);
-  *litP = (char)(0x80 + exponent);
+    *litP++ = mantissa >> i;
+  *litP = 0x80 + exponent;
   return NULL;
 }
 
@@ -4111,9 +4111,9 @@ str_to_float48(char *litP, int *sizeP)
     return _("overflow");
   if (!sign)
     mantissa &= (1ull << 39) - 1;
-  *litP++ = (char)(0x80 + exponent);
+  *litP++ = 0x80 + exponent;
   for (i = 0; i < 40; i += 8)
-    *litP++ = (char)(mantissa >> i);
+    *litP++ = mantissa >> i;
   return NULL;
 }
 
index 235bb80aed64479abf5710133d1d5c4bc2964867..db3d862deeb0c4574a98a4d163fb4aee1f512425 100644 (file)
@@ -3470,7 +3470,7 @@ ecoff_stab (int what,
          value = get_absolute_expression ();
          addend = 0;
        }
-      else if (! is_name_beginner ((unsigned char) *input_line_pointer))
+      else if (! is_name_beginner (*input_line_pointer))
        {
          as_warn (_("illegal .stab%c directive, bad character"), what);
          return;