if (check_multibyte)
(void) scan_for_multibyte_characters ((const unsigned char *) from,
- (const unsigned char* ) fromend,
+ (const unsigned char *) fromend,
true /* Generate warnings. */);
}
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 ()) != '\'')
{
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';
}
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
while (n--)
{
result <<= 8;
- result |= (where[n] & 255);
+ result |= (buf[n] & 255);
}
}
strcpy (param1, get_b_cc (op));
strcat (param1,",");
strcat (param1, param);
- param = (char *) ¶m1;
+ param = param1;
cr16_assemble ("b", param);
return;
}
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);
}
}
/* 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. */
/* 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;
{
/* 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 # */
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;
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;
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;
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
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;
/* 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;
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;
}
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)
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;
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;
}
printf ("\n");
printf ("%-5.5s ", opcodes->name);
- prev_name = (char *) opcodes->name;
+ prev_name = opcodes->name;
}
if (fmt[0])
printf (" [%s]", fmt);
/* 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
/* Normal instruction handling downcases, so we must too. */
while (ISALNUM (*s2))
{
- if (ISUPPER ((unsigned char) *s2))
+ if (ISUPPER (*s2))
*s2 = TOLOWER (*s2);
s2++;
}
{
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++;
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
while (n--)
{
result <<= 8;
- result |= (where[n] & 255);
+ result |= (buf[n] & 255);
}
}
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
while (n--)
{
result <<= 8;
- result |= (where[n] & 255);
+ result |= (buf[n] & 255);
}
}
while (!is_end_of_stmt (*input_line_pointer))
{
- name[i] = (char) * input_line_pointer;
+ name[i] = *input_line_pointer;
i++;
++input_line_pointer;
}
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';
}
}
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;
{
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;
}
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;
}
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';
}
}
- if (l0 == 'i' && l1 && ! IDENT_CHAR ((unsigned char) src[2]))
+ if (l0 == 'i' && l1 && ! IDENT_CHAR (src[2]))
{
if (l1 == 's')
{
}
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';
}
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';
}
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;
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. */
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')
{
}
}
if (l0 == 'm' && l1 == 'o' && TOLOWER (src[2]) == 'd'
- && ! IDENT_CHAR ((unsigned char) src[3]))
+ && ! IDENT_CHAR (src[3]))
{
*mode = A_MOD;
return 3;
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';
}
}
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');
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';
}
}
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');
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';
}
}
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;
}
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');
}
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;
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;
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;
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;
fragS *frag,
symbolS *to_symbol)
{
- ptr[0] = (char) 0xc0;
+ ptr[0] = 0xc0;
ptr[1] = 0x00;
ptr[2] = 0x00;
ptr[3] = 0x00;
fragS *frag,
symbolS *to_symbol)
{
- ptr[0] = (char) 0xc0;
+ ptr[0] = 0xc0;
ptr[1] = 0x00;
ptr[2] = 0x00;
ptr[3] = 0x00;
char *s = name + 1;
int lab = 0;
- while (ISDIGIT ((unsigned char) *s))
+ while (ISDIGIT (*s))
{
lab = lab * 10 + *s - '0';
s++;
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
while (n--)
{
result <<= 8;
- result |= (p[n] & 0xff);
+ result |= (buf[n] & 0xff);
}
}
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
{
{
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++;
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;
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)))
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);
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;
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;
}
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;
}
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;