From 061d137bd7c64e3f80ec524685c4bccf98248f58 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 28 Oct 1999 21:38:59 +0000 Subject: Update. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1999-10-26 Andreas Jaeger * stdlib/msort.c: Include for prototype. Remove K&R compatibility and _quicksort prototype. * stdlib/qsort.c: Make code and comments 64 bit clean; clarify some comments. Reported by Bernd Löchner . Remove K&R compatibility. Move prototype declaration to include/stdlib.h. Include for prototype; include for CHAR_BIT. * include/stdlib.h: Prototype declaration for _quicksort. --- stdlib/msort.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'stdlib/msort.c') diff --git a/stdlib/msort.c b/stdlib/msort.c index 1c36a4cb9c..c03f6f2982 100644 --- a/stdlib/msort.c +++ b/stdlib/msort.c @@ -1,6 +1,6 @@ /* An alternative to qsort, with an identical interface. This file is part of the GNU C Library. - Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. Written by Mike Haertel, September 1988. The GNU C Library is free software; you can redistribute it and/or @@ -18,21 +18,18 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include #include -static void msort_with_tmp __P ((void *b, size_t n, size_t s, - __compar_fn_t cmp, char *t)); +static void msort_with_tmp (void *b, size_t n, size_t s, + __compar_fn_t cmp, char *t); static void -msort_with_tmp (b, n, s, cmp, t) - void *b; - size_t n; - size_t s; - __compar_fn_t cmp; - char *t; +msort_with_tmp (void *b, size_t n, size_t s, __compar_fn_t cmp, + char *t) { char *tmp; char *b1, *b2; @@ -88,11 +85,7 @@ msort_with_tmp (b, n, s, cmp, t) } void -qsort (b, n, s, cmp) - void *b; - size_t n; - size_t s; - __compar_fn_t cmp; +qsort (void *b, size_t n, size_t s, __compar_fn_t cmp) { const size_t size = n * s; @@ -108,9 +101,6 @@ qsort (b, n, s, cmp) { /* Couldn't get space, so use the slower algorithm that doesn't need a temporary array. */ - extern void _quicksort __P ((void *const __base, - size_t __nmemb, size_t __size, - __compar_fn_t __compar)); _quicksort (b, n, s, cmp); } else -- cgit v1.2.3