[Patch] opcodes/z8k-opc.h regenerated

Tristan Gingold gingold@adacore.com
Mon Sep 7 12:29:00 GMT 2009


On Sep 7, 2009, at 2:17 PM, Andreas Schwab wrote:

> 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?

(You reply to Alan but it is not explicitly listed as a recipient !)

Or:

  return (p1 > p2) * 2 - 1;

Tristan.




More information about the Binutils mailing list