about summary refs log tree commit diff
path: root/stdlib/msort.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-28 21:38:59 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-28 21:38:59 +0000
commit061d137bd7c64e3f80ec524685c4bccf98248f58 (patch)
tree73c5167b36aa903eb50c5ffcf7a8049420b077e7 /stdlib/msort.c
parent253d0b23775e5627d0d2d9419ba51fc33addf7dd (diff)
downloadglibc-061d137bd7c64e3f80ec524685c4bccf98248f58.tar.gz
glibc-061d137bd7c64e3f80ec524685c4bccf98248f58.tar.xz
glibc-061d137bd7c64e3f80ec524685c4bccf98248f58.zip
Update.
1999-10-26  Andreas Jaeger  <aj@suse.de>

	* stdlib/msort.c: Include <alloca.h> 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 <loechner@informatik.uni-kl.de>.
	Remove K&R compatibility.
	Move prototype declaration to include/stdlib.h.
	Include <alloca.h> for prototype; include <limits.h> for CHAR_BIT.

	* include/stdlib.h: Prototype declaration for _quicksort.
Diffstat (limited to 'stdlib/msort.c')
-rw-r--r--stdlib/msort.c24
1 files changed, 7 insertions, 17 deletions
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 <alloca.h>
 #include <stdlib.h>
 #include <string.h>
 #include <memcopy.h>
 #include <errno.h>
 
-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