diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 |
commit | 76b5366091f76c9bc73570149ef5055648fc2c39 (patch) | |
tree | 590d020e0f2a5bea6e09d66d951a674443b21d67 /lib/libc/stdlib | |
parent | 4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff) |
Notes
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/merge.c | 7 | ||||
-rw-r--r-- | lib/libc/stdlib/qsort.3 | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/libc/stdlib/merge.c b/lib/libc/stdlib/merge.c index 083a9642502e..a47e3007290e 100644 --- a/lib/libc/stdlib/merge.c +++ b/lib/libc/stdlib/merge.c @@ -111,9 +111,6 @@ mergesort(base, nmemb, size, cmp) return (-1); } - if (nmemb == 0) - return (0); - /* * XXX * Stupid subtraction for the Cray. @@ -150,7 +147,7 @@ mergesort(base, nmemb, size, cmp) sense = 0; } if (!big) { /* here i = 0 */ - while ((b += size) < t && cmp(q, b) >sense) +LINEAR: while ((b += size) < t && cmp(q, b) >sense) if (++i == 6) { big = 1; goto EXPONENTIAL; @@ -171,7 +168,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1) goto FASTCASE; } else b = p; - while (t > b+size) { +SLOWCASE: while (t > b+size) { i = (((t - b) / size) >> 1) * size; if ((*cmp)(q, p = b + i) <= sense) t = p; diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3 index aa2609c7efb0..4f449c752917 100644 --- a/lib/libc/stdlib/qsort.3 +++ b/lib/libc/stdlib/qsort.3 @@ -162,9 +162,7 @@ is set to indicate the error. .Sh ERRORS The .Fn heapsort -and -.Fn mergesort -functions succeed unless: +function succeeds unless: .Bl -tag -width Er .It Bq Er EINVAL The |