From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 09:32:49 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0588A365; Wed, 20 Feb 2013 09:32:49 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id CC3F1EEF; Wed, 20 Feb 2013 09:32:48 +0000 (UTC) Received: from [192.168.0.2] (cpc10-cmbg15-2-0-cust123.5-4.cable.virginmedia.com [86.30.246.124]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r1K9WgUr051359 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 20 Feb 2013 09:32:46 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r247014 - head/lib/libc/stdlib From: David Chisnall In-Reply-To: Date: Wed, 20 Feb 2013 09:32:43 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> References: <201302192357.r1JNveLq039940@svn.freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Giorgos Keramidas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 09:32:49 -0000 On 20 Feb 2013, at 08:25, mdf@FreeBSD.org wrote: > These should be declared const int *. And the cast shouldn't be > needed in C, since void * can be assigned to any other pointer type. In fact, the entire function body can be replaced with: return (*(int*)p1 - *(int*)p2); qsort doesn't require that you return -1, 0, or 1, it requires you = return <0, 0, or >0. David