diff options
author | guenther <> | 2016-08-14 23:18:03 +0000 |
---|---|---|
committer | guenther <> | 2016-08-14 23:18:03 +0000 |
commit | bbd7863e9e2678e3ae2ce69690f0eb6f7dce138b (patch) | |
tree | 7e1cb514316cec6dc6c0898d75f4c612ad9ff229 | |
parent | d375178b9a24f400dad1da5f563fce93ee621827 (diff) | |
download | openbsd-bbd7863e9e2678e3ae2ce69690f0eb6f7dce138b.tar.gz openbsd-bbd7863e9e2678e3ae2ce69690f0eb6f7dce138b.tar.bz2 openbsd-bbd7863e9e2678e3ae2ce69690f0eb6f7dce138b.zip |
Reduce qabs() and qdiv() to aliases of llabs() and lldiv().
Merge the manual pages and call them deprecated there.
ok and manpage tweak jmc@, ok natano@
-rw-r--r-- | src/lib/libc/stdlib/Makefile.inc | 8 | ||||
-rw-r--r-- | src/lib/libc/stdlib/div.3 | 7 | ||||
-rw-r--r-- | src/lib/libc/stdlib/imaxdiv.3 | 7 | ||||
-rw-r--r-- | src/lib/libc/stdlib/labs.3 | 10 | ||||
-rw-r--r-- | src/lib/libc/stdlib/ldiv.3 | 7 | ||||
-rw-r--r-- | src/lib/libc/stdlib/llabs.c | 4 | ||||
-rw-r--r-- | src/lib/libc/stdlib/lldiv.3 | 13 | ||||
-rw-r--r-- | src/lib/libc/stdlib/lldiv.c | 4 | ||||
-rw-r--r-- | src/lib/libc/stdlib/qabs.3 | 56 | ||||
-rw-r--r-- | src/lib/libc/stdlib/qabs.c | 37 | ||||
-rw-r--r-- | src/lib/libc/stdlib/qdiv.3 | 61 | ||||
-rw-r--r-- | src/lib/libc/stdlib/qdiv.c | 50 |
12 files changed, 36 insertions, 228 deletions
diff --git a/src/lib/libc/stdlib/Makefile.inc b/src/lib/libc/stdlib/Makefile.inc index e04d13b839..3489e44021 100644 --- a/src/lib/libc/stdlib/Makefile.inc +++ b/src/lib/libc/stdlib/Makefile.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.60 2016/05/02 12:59:24 millert Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.61 2016/08/14 23:18:03 guenther Exp $ |
2 | 2 | ||
3 | # stdlib sources | 3 | # stdlib sources |
4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/stdlib ${LIBCSRCDIR}/stdlib | 4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/stdlib ${LIBCSRCDIR}/stdlib |
@@ -11,8 +11,8 @@ SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c atoll.c bsearch.c \ | |||
11 | realpath.c remque.c setenv.c strtoimax.c \ | 11 | realpath.c remque.c setenv.c strtoimax.c \ |
12 | strtol.c strtoll.c strtonum.c strtoul.c strtoull.c strtoumax.c \ | 12 | strtol.c strtoll.c strtonum.c strtoul.c strtoull.c strtoumax.c \ |
13 | system.c tfind.c tsearch.c _rand48.c drand48.c erand48.c jrand48.c \ | 13 | system.c tfind.c tsearch.c _rand48.c drand48.c erand48.c jrand48.c \ |
14 | lcong48.c lrand48.c mrand48.c nrand48.c seed48.c srand48.c qabs.c \ | 14 | lcong48.c lrand48.c mrand48.c nrand48.c seed48.c srand48.c \ |
15 | qdiv.c _Exit.c icdb.c | 15 | _Exit.c icdb.c |
16 | 16 | ||
17 | .if (${MACHINE_CPU} == "i386") | 17 | .if (${MACHINE_CPU} == "i386") |
18 | SRCS+= abs.S div.S labs.S ldiv.S | 18 | SRCS+= abs.S div.S labs.S ldiv.S |
@@ -27,5 +27,5 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 atoll.3 \ | |||
27 | bsearch.3 div.3 ecvt.3 exit.3 getenv.3 getopt.3 getopt_long.3 \ | 27 | bsearch.3 div.3 ecvt.3 exit.3 getenv.3 getopt.3 getopt_long.3 \ |
28 | getsubopt.3 hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 \ | 28 | getsubopt.3 hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 \ |
29 | lldiv.3 lsearch.3 malloc.3 posix_memalign.3 posix_openpt.3 ptsname.3 \ | 29 | lldiv.3 lsearch.3 malloc.3 posix_memalign.3 posix_openpt.3 ptsname.3 \ |
30 | qabs.3 qdiv.3 qsort.3 radixsort.3 rand48.3 rand.3 random.3 realpath.3 \ | 30 | qsort.3 radixsort.3 rand48.3 rand.3 random.3 realpath.3 \ |
31 | strtod.3 strtonum.3 strtol.3 strtoul.3 system.3 tsearch.3 | 31 | strtod.3 strtonum.3 strtol.3 strtoul.3 system.3 tsearch.3 |
diff --git a/src/lib/libc/stdlib/div.3 b/src/lib/libc/stdlib/div.3 index 1a2a326269..421400a294 100644 --- a/src/lib/libc/stdlib/div.3 +++ b/src/lib/libc/stdlib/div.3 | |||
@@ -27,9 +27,9 @@ | |||
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | .\" SUCH DAMAGE. | 28 | .\" SUCH DAMAGE. |
29 | .\" | 29 | .\" |
30 | .\" $OpenBSD: div.3,v 1.11 2013/06/05 03:39:23 tedu Exp $ | 30 | .\" $OpenBSD: div.3,v 1.12 2016/08/14 23:18:03 guenther Exp $ |
31 | .\" | 31 | .\" |
32 | .Dd $Mdocdate: June 5 2013 $ | 32 | .Dd $Mdocdate: August 14 2016 $ |
33 | .Dt DIV 3 | 33 | .Dt DIV 3 |
34 | .Os | 34 | .Os |
35 | .Sh NAME | 35 | .Sh NAME |
@@ -55,8 +55,7 @@ and | |||
55 | .Sh SEE ALSO | 55 | .Sh SEE ALSO |
56 | .Xr imaxdiv 3 , | 56 | .Xr imaxdiv 3 , |
57 | .Xr ldiv 3 , | 57 | .Xr ldiv 3 , |
58 | .Xr lldiv 3 , | 58 | .Xr lldiv 3 |
59 | .Xr qdiv 3 | ||
60 | .Sh STANDARDS | 59 | .Sh STANDARDS |
61 | The | 60 | The |
62 | .Fn div | 61 | .Fn div |
diff --git a/src/lib/libc/stdlib/imaxdiv.3 b/src/lib/libc/stdlib/imaxdiv.3 index 20f02e7571..0d4f765373 100644 --- a/src/lib/libc/stdlib/imaxdiv.3 +++ b/src/lib/libc/stdlib/imaxdiv.3 | |||
@@ -29,9 +29,9 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: imaxdiv.3,v 1.6 2014/11/30 21:21:59 schwarze Exp $ | 32 | .\" $OpenBSD: imaxdiv.3,v 1.7 2016/08/14 23:18:03 guenther Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: November 30 2014 $ | 34 | .Dd $Mdocdate: August 14 2016 $ |
35 | .Dt IMAXDIV 3 | 35 | .Dt IMAXDIV 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -57,8 +57,7 @@ and | |||
57 | .Sh SEE ALSO | 57 | .Sh SEE ALSO |
58 | .Xr div 3 , | 58 | .Xr div 3 , |
59 | .Xr ldiv 3 , | 59 | .Xr ldiv 3 , |
60 | .Xr lldiv 3 , | 60 | .Xr lldiv 3 |
61 | .Xr qdiv 3 | ||
62 | .Sh STANDARDS | 61 | .Sh STANDARDS |
63 | The | 62 | The |
64 | .Fn imaxdiv | 63 | .Fn imaxdiv |
diff --git a/src/lib/libc/stdlib/labs.3 b/src/lib/libc/stdlib/labs.3 index 55cf548ea5..272a14e3fe 100644 --- a/src/lib/libc/stdlib/labs.3 +++ b/src/lib/libc/stdlib/labs.3 | |||
@@ -29,9 +29,9 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: labs.3,v 1.13 2014/11/30 21:21:59 schwarze Exp $ | 32 | .\" $OpenBSD: labs.3,v 1.14 2016/08/14 23:18:03 guenther Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: November 30 2014 $ | 34 | .Dd $Mdocdate: August 14 2016 $ |
35 | .Dt LABS 3 | 35 | .Dt LABS 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -44,6 +44,8 @@ | |||
44 | .Fn labs "long i" | 44 | .Fn labs "long i" |
45 | .Ft long long | 45 | .Ft long long |
46 | .Fn llabs "long long j" | 46 | .Fn llabs "long long j" |
47 | .Ft quad_t | ||
48 | .Fn qabs "quad_t j" | ||
47 | .Sh DESCRIPTION | 49 | .Sh DESCRIPTION |
48 | The | 50 | The |
49 | .Fn labs | 51 | .Fn labs |
@@ -53,6 +55,10 @@ The | |||
53 | .Fn llabs | 55 | .Fn llabs |
54 | function returns the absolute value of the long long integer | 56 | function returns the absolute value of the long long integer |
55 | .Fa j . | 57 | .Fa j . |
58 | The | ||
59 | .Fn qabs | ||
60 | function is a deprecated equivalent of | ||
61 | .Fn llabs . | ||
56 | .Sh SEE ALSO | 62 | .Sh SEE ALSO |
57 | .Xr abs 3 , | 63 | .Xr abs 3 , |
58 | .Xr cabs 3 , | 64 | .Xr cabs 3 , |
diff --git a/src/lib/libc/stdlib/ldiv.3 b/src/lib/libc/stdlib/ldiv.3 index a8835ab6ac..1fa6f38c45 100644 --- a/src/lib/libc/stdlib/ldiv.3 +++ b/src/lib/libc/stdlib/ldiv.3 | |||
@@ -29,9 +29,9 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: ldiv.3,v 1.12 2013/07/17 05:42:11 schwarze Exp $ | 32 | .\" $OpenBSD: ldiv.3,v 1.13 2016/08/14 23:18:03 guenther Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: July 17 2013 $ | 34 | .Dd $Mdocdate: August 14 2016 $ |
35 | .Dt LDIV 3 | 35 | .Dt LDIV 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -57,8 +57,7 @@ and | |||
57 | .Sh SEE ALSO | 57 | .Sh SEE ALSO |
58 | .Xr div 3 , | 58 | .Xr div 3 , |
59 | .Xr imaxdiv 3 , | 59 | .Xr imaxdiv 3 , |
60 | .Xr lldiv 3 , | 60 | .Xr lldiv 3 |
61 | .Xr qdiv 3 | ||
62 | .Sh STANDARDS | 61 | .Sh STANDARDS |
63 | The | 62 | The |
64 | .Fn ldiv | 63 | .Fn ldiv |
diff --git a/src/lib/libc/stdlib/llabs.c b/src/lib/libc/stdlib/llabs.c index fc2cd8261c..f4a260f4a8 100644 --- a/src/lib/libc/stdlib/llabs.c +++ b/src/lib/libc/stdlib/llabs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: llabs.c,v 1.3 2007/01/08 19:39:25 deraadt Exp $ */ | 1 | /* $OpenBSD: llabs.c,v 1.4 2016/08/14 23:18:03 guenther Exp $ */ |
2 | 2 | ||
3 | /*- | 3 | /*- |
4 | * Copyright (c) 1990 The Regents of the University of California. | 4 | * Copyright (c) 1990 The Regents of the University of California. |
@@ -36,3 +36,5 @@ llabs(long long j) | |||
36 | { | 36 | { |
37 | return (j < 0 ? -j : j); | 37 | return (j < 0 ? -j : j); |
38 | } | 38 | } |
39 | |||
40 | __weak_alias(qabs, llabs); | ||
diff --git a/src/lib/libc/stdlib/lldiv.3 b/src/lib/libc/stdlib/lldiv.3 index cb2abf681e..ab0bec9fa5 100644 --- a/src/lib/libc/stdlib/lldiv.3 +++ b/src/lib/libc/stdlib/lldiv.3 | |||
@@ -29,9 +29,9 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: lldiv.3,v 1.5 2014/11/30 21:21:59 schwarze Exp $ | 32 | .\" $OpenBSD: lldiv.3,v 1.6 2016/08/14 23:18:03 guenther Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: November 30 2014 $ | 34 | .Dd $Mdocdate: August 14 2016 $ |
35 | .Dt LLDIV 3 | 35 | .Dt LLDIV 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -41,6 +41,8 @@ | |||
41 | .In stdlib.h | 41 | .In stdlib.h |
42 | .Ft lldiv_t | 42 | .Ft lldiv_t |
43 | .Fn lldiv "long long num" "long long denom" | 43 | .Fn lldiv "long long num" "long long denom" |
44 | .Ft qdiv_t | ||
45 | .Fn qdiv "quad_t num" "quad_t denom" | ||
44 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
45 | The | 47 | The |
46 | .Fn lldiv | 48 | .Fn lldiv |
@@ -54,11 +56,14 @@ members named | |||
54 | .Fa quot | 56 | .Fa quot |
55 | and | 57 | and |
56 | .Fa rem . | 58 | .Fa rem . |
59 | The | ||
60 | .Fn qdiv | ||
61 | function is a deprecated equivalent of | ||
62 | .Fn lldiv . | ||
57 | .Sh SEE ALSO | 63 | .Sh SEE ALSO |
58 | .Xr div 3 , | 64 | .Xr div 3 , |
59 | .Xr imaxdiv 3 , | 65 | .Xr imaxdiv 3 , |
60 | .Xr ldiv 3 , | 66 | .Xr ldiv 3 |
61 | .Xr qdiv 3 | ||
62 | .Sh STANDARDS | 67 | .Sh STANDARDS |
63 | The | 68 | The |
64 | .Fn lldiv | 69 | .Fn lldiv |
diff --git a/src/lib/libc/stdlib/lldiv.c b/src/lib/libc/stdlib/lldiv.c index e8d6c978b3..59c37b878c 100644 --- a/src/lib/libc/stdlib/lldiv.c +++ b/src/lib/libc/stdlib/lldiv.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: lldiv.c,v 1.1 2006/01/13 17:58:09 millert Exp $ */ | 1 | /* $OpenBSD: lldiv.c,v 1.2 2016/08/14 23:18:03 guenther Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1990 Regents of the University of California. | 3 | * Copyright (c) 1990 Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -48,3 +48,5 @@ lldiv(long long num, long long denom) | |||
48 | } | 48 | } |
49 | return (r); | 49 | return (r); |
50 | } | 50 | } |
51 | |||
52 | __weak_alias(qdiv, lldiv); | ||
diff --git a/src/lib/libc/stdlib/qabs.3 b/src/lib/libc/stdlib/qabs.3 deleted file mode 100644 index 6703072e72..0000000000 --- a/src/lib/libc/stdlib/qabs.3 +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | ||
2 | .\" All rights reserved. | ||
3 | .\" | ||
4 | .\" This code is derived from software contributed to Berkeley by | ||
5 | .\" the American National Standards Committee X3, on Information | ||
6 | .\" Processing Systems. | ||
7 | .\" | ||
8 | .\" Redistribution and use in source and binary forms, with or without | ||
9 | .\" modification, are permitted provided that the following conditions | ||
10 | .\" are met: | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
14 | .\" notice, this list of conditions and the following disclaimer in the | ||
15 | .\" documentation and/or other materials provided with the distribution. | ||
16 | .\" 3. Neither the name of the University nor the names of its contributors | ||
17 | .\" may be used to endorse or promote products derived from this software | ||
18 | .\" without specific prior written permission. | ||
19 | .\" | ||
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
30 | .\" SUCH DAMAGE. | ||
31 | .\" | ||
32 | .\" $OpenBSD: qabs.3,v 1.13 2013/06/05 03:39:23 tedu Exp $ | ||
33 | .\" | ||
34 | .Dd $Mdocdate: June 5 2013 $ | ||
35 | .Dt QABS 3 | ||
36 | .Os | ||
37 | .Sh NAME | ||
38 | .Nm qabs | ||
39 | .Nd return the absolute value of a quad integer | ||
40 | .Sh SYNOPSIS | ||
41 | .In stdlib.h | ||
42 | .Ft quad_t | ||
43 | .Fn qabs "quad_t j" | ||
44 | .Sh DESCRIPTION | ||
45 | The | ||
46 | .Fn qabs | ||
47 | function returns the absolute value of the quad integer | ||
48 | .Fa j . | ||
49 | .Sh SEE ALSO | ||
50 | .Xr abs 3 , | ||
51 | .Xr cabs 3 , | ||
52 | .Xr floor 3 , | ||
53 | .Xr imaxabs 3 , | ||
54 | .Xr labs 3 | ||
55 | .Sh BUGS | ||
56 | The absolute value of the most negative integer remains negative. | ||
diff --git a/src/lib/libc/stdlib/qabs.c b/src/lib/libc/stdlib/qabs.c deleted file mode 100644 index 656b93c822..0000000000 --- a/src/lib/libc/stdlib/qabs.c +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* $OpenBSD: qabs.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */ | ||
2 | /*- | ||
3 | * Copyright (c) 1990 The Regents of the University of California. | ||
4 | * All rights reserved. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions | ||
8 | * are met: | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the name of the University nor the names of its contributors | ||
15 | * may be used to endorse or promote products derived from this software | ||
16 | * without specific prior written permission. | ||
17 | * | ||
18 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
28 | * SUCH DAMAGE. | ||
29 | */ | ||
30 | |||
31 | #include <stdlib.h> | ||
32 | |||
33 | quad_t | ||
34 | qabs(quad_t j) | ||
35 | { | ||
36 | return(j < 0 ? -j : j); | ||
37 | } | ||
diff --git a/src/lib/libc/stdlib/qdiv.3 b/src/lib/libc/stdlib/qdiv.3 deleted file mode 100644 index 5f5275493e..0000000000 --- a/src/lib/libc/stdlib/qdiv.3 +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | ||
2 | .\" All rights reserved. | ||
3 | .\" | ||
4 | .\" This code is derived from software contributed to Berkeley by | ||
5 | .\" Chris Torek and the American National Standards Committee X3, | ||
6 | .\" on Information Processing Systems. | ||
7 | .\" | ||
8 | .\" Redistribution and use in source and binary forms, with or without | ||
9 | .\" modification, are permitted provided that the following conditions | ||
10 | .\" are met: | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
14 | .\" notice, this list of conditions and the following disclaimer in the | ||
15 | .\" documentation and/or other materials provided with the distribution. | ||
16 | .\" 3. Neither the name of the University nor the names of its contributors | ||
17 | .\" may be used to endorse or promote products derived from this software | ||
18 | .\" without specific prior written permission. | ||
19 | .\" | ||
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
30 | .\" SUCH DAMAGE. | ||
31 | .\" | ||
32 | .\" $OpenBSD: qdiv.3,v 1.10 2013/06/05 03:39:23 tedu Exp $ | ||
33 | .\" | ||
34 | .Dd $Mdocdate: June 5 2013 $ | ||
35 | .Dt QDIV 3 | ||
36 | .Os | ||
37 | .Sh NAME | ||
38 | .Nm qdiv | ||
39 | .Nd return quotient and remainder from division | ||
40 | .Sh SYNOPSIS | ||
41 | .In stdlib.h | ||
42 | .Ft qdiv_t | ||
43 | .Fn qdiv "quad_t num" "quad_t denom" | ||
44 | .Sh DESCRIPTION | ||
45 | The | ||
46 | .Fn qdiv | ||
47 | function computes the value | ||
48 | .Fa num Ns / Ns Fa denom | ||
49 | and returns the quotient and remainder in a structure named | ||
50 | .Li qdiv_t | ||
51 | that contains two | ||
52 | .Li quad integer | ||
53 | members named | ||
54 | .Fa quot | ||
55 | and | ||
56 | .Fa rem . | ||
57 | .Sh SEE ALSO | ||
58 | .Xr div 3 , | ||
59 | .Xr imaxdiv 3 , | ||
60 | .Xr ldiv 3 , | ||
61 | .Xr lldiv 3 | ||
diff --git a/src/lib/libc/stdlib/qdiv.c b/src/lib/libc/stdlib/qdiv.c deleted file mode 100644 index f3db0915ed..0000000000 --- a/src/lib/libc/stdlib/qdiv.c +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* $OpenBSD: qdiv.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 1990 Regents of the University of California. | ||
4 | * All rights reserved. | ||
5 | * | ||
6 | * This code is derived from software contributed to Berkeley by | ||
7 | * Chris Torek. | ||
8 | * | ||
9 | * Redistribution and use in source and binary forms, with or without | ||
10 | * modification, are permitted provided that the following conditions | ||
11 | * are met: | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * 2. Redistributions in binary form must reproduce the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer in the | ||
16 | * documentation and/or other materials provided with the distribution. | ||
17 | * 3. Neither the name of the University nor the names of its contributors | ||
18 | * may be used to endorse or promote products derived from this software | ||
19 | * without specific prior written permission. | ||
20 | * | ||
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
31 | * SUCH DAMAGE. | ||
32 | */ | ||
33 | |||
34 | #include <stdlib.h> /* qdiv_t */ | ||
35 | |||
36 | qdiv_t | ||
37 | qdiv(quad_t num, quad_t denom) | ||
38 | { | ||
39 | qdiv_t r; | ||
40 | |||
41 | /* see div.c for comments */ | ||
42 | |||
43 | r.quot = num / denom; | ||
44 | r.rem = num % denom; | ||
45 | if (num >= 0 && r.rem < 0) { | ||
46 | r.quot++; | ||
47 | r.rem -= denom; | ||
48 | } | ||
49 | return (r); | ||
50 | } | ||