tc-i960.c: add some casts when assigning literals to args[i]

parse_ldconst () takes a char ** as a in / out argument, and sometimes points
args[0] to a constant string.  Then in some cases after parse_ldconst ()
     returns md_assemble () twiddles the contents of arg[0].  So it seems like
     it would take some work to avoid these casts, and its not really clear
     that work is worth it.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-i960.c (parse_ldconst): Cast to char * when assigning to
	args[0].
This commit is contained in:
Trevor Saunders 2016-03-24 07:52:39 -04:00
parent f854977c23
commit e2c7dcae81
2 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-i960.c (parse_ldconst): Cast to char * when assigning to
args[0].
2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to * config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to

View File

@ -1246,7 +1246,7 @@ parse_ldconst (char *arg[]) /* See above. */
{ {
default: default:
/* We're dependent on one or more symbols -- use "lda". */ /* We're dependent on one or more symbols -- use "lda". */
arg[0] = "lda"; arg[0] = (char *) "lda";
break; break;
case O_constant: case O_constant:
@ -1263,26 +1263,26 @@ parse_ldconst (char *arg[]) /* See above. */
lda xxx,<reg>. */ lda xxx,<reg>. */
n = offs (e); n = offs (e);
if ((0 <= n) && (n <= 31)) if ((0 <= n) && (n <= 31))
arg[0] = "mov"; arg[0] = (char *) "mov";
else if ((-31 <= n) && (n <= -1)) else if ((-31 <= n) && (n <= -1))
{ {
arg[0] = "subo"; arg[0] = (char *) "subo";
arg[3] = arg[2]; arg[3] = arg[2];
sprintf (buf, "%d", -n); sprintf (buf, "%d", -n);
arg[1] = buf; arg[1] = buf;
arg[2] = "0"; arg[2] = (char *) "0";
} }
else if ((32 <= n) && (n <= 62)) else if ((32 <= n) && (n <= 62))
{ {
arg[0] = "addo"; arg[0] = (char *) "addo";
arg[3] = arg[2]; arg[3] = arg[2];
arg[1] = "31"; arg[1] = (char *) "31";
sprintf (buf, "%d", n - 31); sprintf (buf, "%d", n - 31);
arg[2] = buf; arg[2] = buf;
} }
else if ((shift = shift_ok (n)) != 0) else if ((shift = shift_ok (n)) != 0)
{ {
arg[0] = "shlo"; arg[0] = (char *) "shlo";
arg[3] = arg[2]; arg[3] = arg[2];
sprintf (buf, "%d", shift); sprintf (buf, "%d", shift);
arg[1] = buf; arg[1] = buf;
@ -1290,7 +1290,7 @@ parse_ldconst (char *arg[]) /* See above. */
arg[2] = buf2; arg[2] = buf2;
} }
else else
arg[0] = "lda"; arg[0] = (char *) "lda";
break; break;
case O_illegal: case O_illegal: