From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9625 invoked by alias); 7 Sep 2009 12:29:19 -0000 Received: (qmail 9612 invoked by uid 22791); 7 Sep 2009 12:29:18 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Sep 2009 12:29:10 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 21DE4290040; Mon, 7 Sep 2009 14:29:08 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KSycEEwwcWlA; Mon, 7 Sep 2009 14:29:07 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 873E5290014; Mon, 7 Sep 2009 14:29:07 +0200 (CEST) Cc: Nick Clifton , Binutils Message-Id: <6DE67313-3D2D-4F48-B09B-65D07ABD8F89@adacore.com> From: Tristan Gingold To: Andreas Schwab , Alan Modra In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Patch] opcodes/z8k-opc.h regenerated Date: Mon, 07 Sep 2009 12:29:00 -0000 References: <20090904130027.GA89668@ulanbator.act-europe.fr> <4AA1332D.9090509@redhat.com> <3323A026-B9BE-4198-90A8-B97CAF8A0683@adacore.com> <20090907111845.GC518@bubble.grove.modra.org> <20090907113743.GD518@bubble.grove.modra.org> <20090907121226.GE518@bubble.grove.modra.org> X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00197.txt.bz2 On Sep 7, 2009, at 2:17 PM, Andreas Schwab wrote: > Alan Modra 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.