This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] opcodes/z8k-opc.h regenerated


Alan Modra <amodra@bigpond.net.au> writes:

>  static int
> -func (struct op *a, struct op *b)
> +func (const void *p1, const void *p2)
>  {
> -  return strcmp ((a)->name, (b)->name);
> +  const struct op *a = p1;
> +  const struct op *b = p2;
> +  int ret = strcmp (a->name, b->name);
> +  if (ret != 0)
> +    return ret;
> +  return p1 > p2;

Shouldn't that handle p1 < p2 as well?

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]