Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-02 Thread Herbert Xu
Zan Lynx <[EMAIL PROTECTED]> wrote: > > And you get in the habit of using 0 instead of NULL and before you know > it you've used it in a variable argument list for a GTK library call on > an AMD64 system and corrupted the stack. :-) Using NULL without a cast is equally broken in a variadic

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-02 Thread Herbert Xu
Zan Lynx [EMAIL PROTECTED] wrote: And you get in the habit of using 0 instead of NULL and before you know it you've used it in a variable argument list for a GTK library call on an AMD64 system and corrupted the stack. :-) Using NULL without a cast is equally broken in a variadic context.

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Zan Lynx
On Tue, 2005-02-01 at 14:22 -0800, Randy.Dunlap wrote: > Chris Wedgwood wrote: > > On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: > > > > > >>+#define qsort xfs_sort > >>+static inline void xfs_sort(void *a, size_t n, size_t s, > >>+ int (*cmp)(const void *,const

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Matt Mackall
On Tue, Feb 01, 2005 at 02:29:15PM -0800, Chris Wedgwood wrote: > On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: > > > +#define qsort xfs_sort > > +static inline void xfs_sort(void *a, size_t n, size_t s, > > + int (*cmp)(const void *,const void *)) > > +{ > > +

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Randy.Dunlap
Chris Wedgwood wrote: On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: +#define qsort xfs_sort +static inline void xfs_sort(void *a, size_t n, size_t s, + int (*cmp)(const void *,const void *)) +{ + sort(a, n, s, cmp, 0); +} + why not just: #define

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Chris Wedgwood
On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: > +#define qsort xfs_sort > +static inline void xfs_sort(void *a, size_t n, size_t s, > + int (*cmp)(const void *,const void *)) > +{ > + sort(a, n, s, cmp, 0); > +} > + why not just: #define qsort(a, n, s,

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Chris Wedgwood
On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: +#define qsort xfs_sort +static inline void xfs_sort(void *a, size_t n, size_t s, + int (*cmp)(const void *,const void *)) +{ + sort(a, n, s, cmp, 0); +} + why not just: #define qsort(a, n, s, cmp)

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Randy.Dunlap
Chris Wedgwood wrote: On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: +#define qsort xfs_sort +static inline void xfs_sort(void *a, size_t n, size_t s, + int (*cmp)(const void *,const void *)) +{ + sort(a, n, s, cmp, 0); +} + why not just: #define

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Matt Mackall
On Tue, Feb 01, 2005 at 02:29:15PM -0800, Chris Wedgwood wrote: On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: +#define qsort xfs_sort +static inline void xfs_sort(void *a, size_t n, size_t s, + int (*cmp)(const void *,const void *)) +{ + sort(a, n,

Re: [PATCH 2/8] lib/sort: Replace qsort in XFS

2005-02-01 Thread Zan Lynx
On Tue, 2005-02-01 at 14:22 -0800, Randy.Dunlap wrote: Chris Wedgwood wrote: On Mon, Jan 31, 2005 at 01:34:59AM -0600, Matt Mackall wrote: +#define qsort xfs_sort +static inline void xfs_sort(void *a, size_t n, size_t s, + int (*cmp)(const void *,const void *)) +{ +

[PATCH 2/8] lib/sort: Replace qsort in XFS

2005-01-31 Thread Matt Mackall
Point XFS qsort at lib/sort in a way that makes it happy. Signed-off-by: Matt Mackall <[EMAIL PROTECTED]> Index: mm2/fs/xfs/linux-2.6/xfs_linux.h === --- mm2.orig/fs/xfs/linux-2.6/xfs_linux.h 2005-01-30 14:22:38.0