Re: svn commit: r247014 - head/lib/libc/stdlib

2013-02-20 Thread Giorgos Keramidas
On 2013-02-20 10:49, Stefan Farfeleder wrote: >On Wed, Feb 20, 2013 at 09:32:43AM +, David Chisnall wrote: >>On 20 Feb 2013, at 08:25, m...@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

Re: svn commit: r247014 - head/lib/libc/stdlib

2013-02-20 Thread Stefan Farfeleder
On Wed, Feb 20, 2013 at 09:32:43AM +, David Chisnall wrote: > On 20 Feb 2013, at 08:25, m...@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

Re: svn commit: r247014 - head/lib/libc/stdlib

2013-02-20 Thread Giorgos Keramidas
On 2013-02-20 09:32, David Chisnall wrote: > On 20 Feb 2013, at 08:25, m...@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: >

Re: svn commit: r247014 - head/lib/libc/stdlib

2013-02-20 Thread David Chisnall
On 20 Feb 2013, at 08:25, m...@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 req

Re: svn commit: r247014 - head/lib/libc/stdlib

2013-02-20 Thread mdf
On Tue, Feb 19, 2013 at 3:57 PM, Giorgos Keramidas wrote: > Author: keramida (doc committer) > Date: Tue Feb 19 23:57:39 2013 > New Revision: 247014 > URL: http://svnweb.freebsd.org/changeset/base/247014 > > Log: > Add a sample program that shows how a custom comparison function and > qsort(3)