This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix cpu-i960.c
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: PATCH: Fix cpu-i960.c
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Mon, 25 Jun 2001 10:50:28 +0930
- Cc: binutils at sourceware dot cygnus dot com
- References: <20010624090844.A21881@lucon.org>
On Sun, Jun 24, 2001 at 09:08:44AM -0700, H . J . Lu wrote:
> --- cpu-i960.c 2001/03/09 19:15:44 1.1.1.4
> +++ cpu-i960.c 2001/06/24 16:00:19
> @@ -33,14 +33,10 @@ scan_960_mach (ap, string)
> const char *string;
> {
> unsigned long machine;
> - int i;
> int fail_because_not_80960 = false;
>
> - for (i = 0; i < strlen (string); i ++)
> - string[i] = tolower (string[i]);
> -
Shouldn't you just remove the above, and not bother with strcasecmp below?
See read.c, IGNORE_OPCODE_CASE
> /* Look for the string i960 at the front of the string. */
> - if (strncmp ("i960", string, 4) == 0)
> + if (strncasecmp ("i960", string, 4) == 0)
> {
> string += 4;
>
> @@ -74,9 +70,9 @@ scan_960_mach (ap, string)
> if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' &&
> string[3] == 'e' && string[4] == '\0')
> machine = bfd_mach_i960_core;
> - else if (strcmp (string, "ka_sa") == 0)
> + else if (strcasecmp (string, "ka_sa") == 0)
> machine = bfd_mach_i960_ka_sa;
> - else if (strcmp (string, "kb_sb") == 0)
> + else if (strcasecmp (string, "kb_sb") == 0)
> machine = bfd_mach_i960_kb_sb;
> else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char. */
> return false;