X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/6d4371d46939ef6b10b9205af6af56e1146cdf91..92b27fe946004935f0f29277d2a762c63af55ce3:/pqsort.c diff --git a/pqsort.c b/pqsort.c index c49d077e..25775637 100644 --- a/pqsort.c +++ b/pqsort.c @@ -1,7 +1,7 @@ /* The following is the NetBSD libc qsort implementation modified in order to * support partial sorting of ranges for Redis. * - * Copyright(C) 2009 Salvatore Sanfilippo. All rights reserved. + * Copyright(C) 2009-2010 Salvatore Sanfilippo. All rights reserved. * * The original copyright notice follows. */ @@ -37,24 +37,15 @@ * SUCH DAMAGE. */ -#include -#if defined(LIBC_SCCS) && !defined(lint) -#if 0 -static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; -#else -__RCSID("$NetBSD: qsort.c,v 1.19 2009/01/30 23:38:44 lukem Exp $"); -#endif -#endif /* LIBC_SCCS and not lint */ - #include #include #include #include -static inline char *med3 __P((char *, char *, char *, - int (*)(const void *, const void *))); -static inline void swapfunc __P((char *, char *, size_t, int)); +static inline char *med3 (char *, char *, char *, + int (*)(const void *, const void *)); +static inline void swapfunc (char *, char *, size_t, int); #define min(a, b) (a) < (b) ? a : b @@ -97,7 +88,7 @@ swapfunc(char *a, char *b, size_t n, int swaptype) static inline char * med3(char *a, char *b, char *c, - int (*cmp) __P((const void *, const void *))) + int (*cmp) (const void *, const void *)) { return cmp(a, b) < 0 ? @@ -107,7 +98,7 @@ med3(char *a, char *b, char *c, static void _pqsort(void *a, size_t n, size_t es, - int (*cmp) __P((const void *, const void *)), void *lrange, void *rrange) + int (*cmp) (const void *, const void *), void *lrange, void *rrange) { char *pa, *pb, *pc, *pd, *pl, *pm, *pn; size_t d, r; @@ -199,7 +190,7 @@ loop: SWAPINIT(a, es); void pqsort(void *a, size_t n, size_t es, - int (*cmp) __P((const void *, const void *)), size_t lrange, size_t rrange) + int (*cmp) (const void *, const void *), size_t lrange, size_t rrange) { _pqsort(a,n,es,cmp,((unsigned char*)a)+(lrange*es), ((unsigned char*)a)+((rrange+1)*es)-1);