This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch] opcodes/z8k-opc.h regenerated
I don't think you can actually use the address as the fallback, since it
can cause two elements to be compared differently depending on the their
relative position in the array, resulting in an inconsistent sort order.
Andreas.
2009-09-07 Andreas Schwab <schwab@redhat.com>
* z8kgen.c (func): Use bits field as fallback.
* z8k-opc.h: Regenerate.
--- z8kgen.c.~1.18.~ 2009-09-07 16:06:24.000000000 +0200
+++ z8kgen.c 2009-09-07 16:35:44.000000000 +0200
@@ -574,7 +574,9 @@ func (const void *p1, const void *p2)
int ret = strcmp (a->name, b->name);
if (ret != 0)
return ret;
- return p1 > p2 ? 1 : -1;
+ /* Use bits as the secondary key which is guaranteed to be
+ unique. */
+ return strcmp (a->bits, b->bits);
}
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."