KNF, integrate with standard include files (quad -> quad_t etc.)
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 26 Jun 1992 00:34:33 +0000 (16:34 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 26 Jun 1992 00:34:33 +0000 (16:34 -0800)
SCCS-vsn: lib/libc/quad/adddi3.c 5.5
SCCS-vsn: lib/libc/quad/anddi3.c 5.4
SCCS-vsn: lib/libc/quad/ashldi3.c 5.7
SCCS-vsn: lib/libc/quad/ashrdi3.c 5.7
SCCS-vsn: lib/libc/quad/cmpdi2.c 5.5
SCCS-vsn: lib/libc/quad/divdi3.c 5.4
SCCS-vsn: lib/libc/quad/fixdfdi.c 5.4
SCCS-vsn: lib/libc/quad/fixunsdfdi.c 5.4
SCCS-vsn: lib/libc/quad/floatdidf.c 5.4
SCCS-vsn: lib/libc/quad/floatunsdidf.c 5.2
SCCS-vsn: lib/libc/quad/iordi3.c 5.4
SCCS-vsn: lib/libc/quad/lshldi3.c 5.7
SCCS-vsn: lib/libc/quad/lshrdi3.c 5.7
SCCS-vsn: lib/libc/quad/moddi3.c 5.5
SCCS-vsn: lib/libc/quad/muldi3.c 5.8
SCCS-vsn: lib/libc/quad/negdi2.c 5.5
SCCS-vsn: lib/libc/quad/notdi2.c 5.4
SCCS-vsn: lib/libc/quad/qdivrem.c 5.7
SCCS-vsn: lib/libc/quad/quad.h 5.8
SCCS-vsn: lib/libc/quad/subdi3.c 5.5
SCCS-vsn: lib/libc/quad/ucmpdi2.c 5.5
SCCS-vsn: lib/libc/quad/udivdi3.c 5.4
SCCS-vsn: lib/libc/quad/umoddi3.c 5.5
SCCS-vsn: lib/libc/quad/xordi3.c 5.4

24 files changed:
usr/src/lib/libc/quad/adddi3.c
usr/src/lib/libc/quad/anddi3.c
usr/src/lib/libc/quad/ashldi3.c
usr/src/lib/libc/quad/ashrdi3.c
usr/src/lib/libc/quad/cmpdi2.c
usr/src/lib/libc/quad/divdi3.c
usr/src/lib/libc/quad/fixdfdi.c
usr/src/lib/libc/quad/fixunsdfdi.c
usr/src/lib/libc/quad/floatdidf.c
usr/src/lib/libc/quad/floatunsdidf.c
usr/src/lib/libc/quad/iordi3.c
usr/src/lib/libc/quad/lshldi3.c
usr/src/lib/libc/quad/lshrdi3.c
usr/src/lib/libc/quad/moddi3.c
usr/src/lib/libc/quad/muldi3.c
usr/src/lib/libc/quad/negdi2.c
usr/src/lib/libc/quad/notdi2.c
usr/src/lib/libc/quad/qdivrem.c
usr/src/lib/libc/quad/quad.h
usr/src/lib/libc/quad/subdi3.c
usr/src/lib/libc/quad/ucmpdi2.c
usr/src/lib/libc/quad/udivdi3.c
usr/src/lib/libc/quad/umoddi3.c
usr/src/lib/libc/quad/xordi3.c

index 5d0412d..a4bf078 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)adddi3.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)adddi3.c   5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -20,8 +20,9 @@ static char sccsid[] = "@(#)adddi3.c  5.4 (Berkeley) %G%";
  * u_long addition x+y occurs if and only if the sum x+y is less than
  * either x or y (the choice to compare with x or y is arbitrary).
  */
  * u_long addition x+y occurs if and only if the sum x+y is less than
  * either x or y (the choice to compare with x or y is arbitrary).
  */
-quad
-__adddi3(quad a, quad b)
+quad_t
+__adddi3(a, b)
+       quad_t a, b;
 {
        union uu aa, bb, sum;
 
 {
        union uu aa, bb, sum;
 
index fe17f35..4657cf8 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)anddi3.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)anddi3.c   5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,8 +18,9 @@ static char sccsid[] = "@(#)anddi3.c  5.3 (Berkeley) %G%";
 /*
  * Return a & b, in quad.
  */
 /*
  * Return a & b, in quad.
  */
-quad
-__anddi3(quad a, quad b)
+quad_t
+__anddi3(a, b)
+       quad_t a, b;
 {
        union uu aa, bb;
 
 {
        union uu aa, bb;
 
index 2ca81f3..31cc07c 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ashldi3.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)ashldi3.c  5.7 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -19,8 +19,10 @@ static char sccsid[] = "@(#)ashldi3.c        5.6 (Berkeley) %G%";
  * Shift a (signed) quad value left (arithmetic shift left).
  * This is the same as logical shift left!
  */
  * Shift a (signed) quad value left (arithmetic shift left).
  * This is the same as logical shift left!
  */
-quad
-__ashldi3(quad a, qshift_t shift)
+quad_t
+__ashldi3(a, shift)
+       quad_t a;
+       qshift_t shift;
 {
        union uu aa;
 
 {
        union uu aa;
 
index 404c0dc..a40b199 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ashrdi3.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)ashrdi3.c  5.7 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,8 +18,10 @@ static char sccsid[] = "@(#)ashrdi3.c        5.6 (Berkeley) %G%";
 /*
  * Shift a (signed) quad value right (arithmetic shift right).
  */
 /*
  * Shift a (signed) quad value right (arithmetic shift right).
  */
-quad
-__ashrdi3(quad a, qshift_t shift)
+quad_t
+__ashrdi3(a, shift)
+       quad_t a;
+       qshift_t shift;
 {
        union uu aa;
 
 {
        union uu aa;
 
index 8952893..2e4311e 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)cmpdi2.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmpdi2.c   5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -21,7 +21,8 @@ static char sccsid[] = "@(#)cmpdi2.c  5.4 (Berkeley) %G%";
  * signed.
  */
 int
  * signed.
  */
 int
-__cmpdi2(quad a, quad b)
+__cmpdi2(a, b)
+       quad_t a, b;
 {
        union uu aa, bb;
 
 {
        union uu aa, bb;
 
index 5267c21..3dbdcce 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)divdi3.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)divdi3.c   5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -19,20 +19,21 @@ static char sccsid[] = "@(#)divdi3.c        5.3 (Berkeley) %G%";
  * Divide two signed quads.
  * ??? if -1/2 should produce -1 on this machine, this code is wrong
  */
  * Divide two signed quads.
  * ??? if -1/2 should produce -1 on this machine, this code is wrong
  */
-quad
-__divdi3(quad a, quad b)
+quad_t
+__divdi3(a, b)
+       quad_t a, b;
 {
 {
-       u_quad ua, ub, uq;
+       u_quad_t ua, ub, uq;
        int neg;
 
        if (a < 0)
        int neg;
 
        if (a < 0)
-               ua = -(u_quad)a, neg = 1;
+               ua = -(u_quad_t)a, neg = 1;
        else
                ua = a, neg = 0;
        if (b < 0)
        else
                ua = a, neg = 0;
        if (b < 0)
-               ub = -(u_quad)b, neg ^= 1;
+               ub = -(u_quad_t)b, neg ^= 1;
        else
                ub = b;
        else
                ub = b;
-       uq = __qdivrem(ua, ub, (u_quad *)0);
+       uq = __qdivrem(ua, ub, (u_quad_t *)0);
        return (neg ? -uq : uq);
 }
        return (neg ? -uq : uq);
 }
index 866f72b..7dbc2f1 100644 (file)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fixdfdi.c  5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)fixdfdi.c  5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 
-#ifndef QUAD_MAX       /* should be in <limits.h> maybe? */
-#define        QUAD_MAX ((quad)(((u_quad)1 << (QUAD_BITS - 1)) - 1))
-#define        QUAD_MIN (-QUAD_MAX - 1)
-#endif
-
 /*
  * Convert double to (signed) quad.
  * We clamp anything that is out of range.
  */
 /*
  * Convert double to (signed) quad.
  * We clamp anything that is out of range.
  */
-quad
-__fixdfdi(double x)
+quad_t
+__fixdfdi(x)
+       double x;
 {
        if (x < 0)
                if (x <= QUAD_MIN)
                        return (QUAD_MIN);
                else
 {
        if (x < 0)
                if (x <= QUAD_MIN)
                        return (QUAD_MIN);
                else
-                       return ((quad)-(u_quad)-x);
+                       return ((quad_t)-(u_quad_t)-x);
        else
                if (x >= QUAD_MAX)
                        return (QUAD_MAX);
                else
        else
                if (x >= QUAD_MAX)
                        return (QUAD_MAX);
                else
-                       return ((quad)(u_quad)x);
+                       return ((quad_t)(u_quad_t)x);
 }
 }
index 15b3fec..ba1cc13 100644 (file)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fixunsdfdi.c       5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)fixunsdfdi.c       5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 
-#ifndef UQUAD_MAX      /* should be in <limits.h> maybe? */
-#define        UQUAD_MAX ((u_quad)0 - 1)
-#endif
-
 #define        ONE_FOURTH      (1 << (LONG_BITS - 2))
 #define        ONE_HALF        (ONE_FOURTH * 2.0)
 #define        ONE             (ONE_FOURTH * 4.0)
 #define        ONE_FOURTH      (1 << (LONG_BITS - 2))
 #define        ONE_HALF        (ONE_FOURTH * 2.0)
 #define        ONE             (ONE_FOURTH * 4.0)
@@ -28,8 +24,9 @@ static char sccsid[] = "@(#)fixunsdfdi.c      5.3 (Berkeley) %G%";
  * Not sure what to do with negative numbers---for now, anything out
  * of range becomes UQUAD_MAX.
  */
  * Not sure what to do with negative numbers---for now, anything out
  * of range becomes UQUAD_MAX.
  */
-u_quad
-__fixunsdfdi(double x)
+u_quad_t
+__fixunsdfdi(x)
+       double x;
 {
        double toppart;
        union uu t;
 {
        double toppart;
        union uu t;
@@ -45,7 +42,7 @@ __fixunsdfdi(double x)
         */
        toppart = (x - ONE_HALF) / ONE;
        /*
         */
        toppart = (x - ONE_HALF) / ONE;
        /*
-        * Now build a u_quad out of the top part.  The difference
+        * Now build a u_quad_t out of the top part.  The difference
         * between x and this is the bottom part (this may introduce
         * a few fuzzy bits, but what the heck).  With any luck this
         * difference will be nonnegative: x should wind up in the
         * between x and this is the bottom part (this may introduce
         * a few fuzzy bits, but what the heck).  With any luck this
         * difference will be nonnegative: x should wind up in the
index 06aeab4..30e2b71 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)floatdidf.c        5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)floatdidf.c        5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -19,7 +19,8 @@ static char sccsid[] = "@(#)floatdidf.c       5.3 (Berkeley) %G%";
  * Convert (signed) quad to double.
  */
 double
  * Convert (signed) quad to double.
  */
 double
-__floatdidf(quad x)
+__floatdidf(x)
+       quad_t x;
 {
        double d;
        union uu u;
 {
        double d;
        union uu u;
index d679794..406ae61 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)floatunsdidf.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)floatunsdidf.c     5.2 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -20,7 +20,8 @@ static char sccsid[] = "@(#)floatunsdidf.c    5.1 (Berkeley) %G%";
  * This is exactly like floatdidf.c except that negatives never occur.
  */
 double
  * This is exactly like floatdidf.c except that negatives never occur.
  */
 double
-__floatunsdidf(u_quad x)
+__floatunsdidf(x)
+       u_quad_t x;
 {
        double d;
        union uu u;
 {
        double d;
        union uu u;
index b248787..2e1d913 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)iordi3.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)iordi3.c   5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,8 +18,9 @@ static char sccsid[] = "@(#)iordi3.c  5.3 (Berkeley) %G%";
 /*
  * Return a | b, in quad.
  */
 /*
  * Return a | b, in quad.
  */
-quad
-__iordi3(quad a, quad b)
+quad_t
+__iordi3(a, b)
+       quad_t a, b;
 {
        union uu aa, bb;
 
 {
        union uu aa, bb;
 
index 70ed7b8..b3ba99a 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)lshldi3.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)lshldi3.c  5.7 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -19,8 +19,10 @@ static char sccsid[] = "@(#)lshldi3.c        5.6 (Berkeley) %G%";
  * Shift an (unsigned) quad value left (logical shift left).
  * This is the same as arithmetic shift left!
  */
  * Shift an (unsigned) quad value left (logical shift left).
  * This is the same as arithmetic shift left!
  */
-quad
-__lshldi3(quad a, qshift_t shift)
+quad_t
+__lshldi3(a, shift)
+       quad_t a;
+       qshift_t shift;
 {
        union uu aa;
 
 {
        union uu aa;
 
index 5582805..112a28e 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)lshrdi3.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)lshrdi3.c  5.7 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,8 +18,10 @@ static char sccsid[] = "@(#)lshrdi3.c        5.6 (Berkeley) %G%";
 /*
  * Shift an (unsigned) quad value right (logical shift right).
  */
 /*
  * Shift an (unsigned) quad value right (logical shift right).
  */
-quad
-__lshrdi3(quad a, qshift_t shift)
+quad_t
+__lshrdi3(a, shift)
+       quad_t a;
+       qshift_t shift;
 {
        union uu aa;
 
 {
        union uu aa;
 
index 1401f01..f468863 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)moddi3.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)moddi3.c   5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -21,18 +21,19 @@ static char sccsid[] = "@(#)moddi3.c        5.4 (Berkeley) %G%";
  * XXX
  * If -1/2 should produce -1 on this machine, this code is wrong.
  */
  * XXX
  * If -1/2 should produce -1 on this machine, this code is wrong.
  */
-quad
-__moddi3(quad a, quad b)
+quad_t
+__moddi3(a, b)
+       quad_t a, b;
 {
 {
-       u_quad ua, ub, ur;
+       u_quad_t ua, ub, ur;
        int neg;
 
        if (a < 0)
        int neg;
 
        if (a < 0)
-               ua = -(u_quad)a, neg = 1;
+               ua = -(u_quad_t)a, neg = 1;
        else
                ua = a, neg = 0;
        if (b < 0)
        else
                ua = a, neg = 0;
        if (b < 0)
-               ub = -(u_quad)b, neg ^= 1;
+               ub = -(u_quad_t)b, neg ^= 1;
        else
                ub = b;
        (void)__qdivrem(ua, ub, &ur);
        else
                ub = b;
        (void)__qdivrem(ua, ub, &ur);
index 59b8832..9d83b79 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)muldi3.c   5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)muldi3.c   5.8 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -72,10 +72,11 @@ static char sccsid[] = "@(#)muldi3.c        5.7 (Berkeley) %G%";
  * of 2^n in either one will also vanish.  Only `low' need be computed
  * mod 2^2n, and only because of the final term above.
  */
  * of 2^n in either one will also vanish.  Only `low' need be computed
  * mod 2^2n, and only because of the final term above.
  */
-static quad __lmulq(u_long, u_long);
+static quad_t __lmulq(u_long, u_long);
 
 
-quad
-__muldi3(quad a, quad b)
+quad_t
+__muldi3(a, b)
+       quad_t a, b;
 {
        union uu u, v, low, prod;
        register u_long high, mid, udiff, vdiff;
 {
        union uu u, v, low, prod;
        register u_long high, mid, udiff, vdiff;
@@ -158,7 +159,7 @@ __muldi3(quad a, quad b)
  *
  * splits into high and low longs as HHALF(l) and LHUP(l) respectively.
  */
  *
  * splits into high and low longs as HHALF(l) and LHUP(l) respectively.
  */
-static quad
+static quad_t
 __lmulq(u_long u, u_long v)
 {
        u_long u1, u0, v1, v0, udiff, vdiff, high, mid, low;
 __lmulq(u_long u, u_long v)
 {
        u_long u1, u0, v1, v0, udiff, vdiff, high, mid, low;
index e8d7c45..aaa84a0 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)negdi2.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)negdi2.c   5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,8 +18,9 @@ static char sccsid[] = "@(#)negdi2.c  5.4 (Berkeley) %G%";
 /*
  * Return -a (or, equivalently, 0 - a), in quad.  See subdi3.c.
  */
 /*
  * Return -a (or, equivalently, 0 - a), in quad.  See subdi3.c.
  */
-quad
-__negdi2(quad a)
+quad_t
+__negdi2(a)
+       quad_t a;
 {
        union uu aa, res;
 
 {
        union uu aa, res;
 
index 391076d..c0ad956 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)notdi2.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)notdi2.c   5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -19,8 +19,9 @@ static char sccsid[] = "@(#)notdi2.c  5.3 (Berkeley) %G%";
  * Return ~a.  For some reason gcc calls this `one's complement' rather
  * than `not'.
  */
  * Return ~a.  For some reason gcc calls this `one's complement' rather
  * than `not'.
  */
-quad
-__one_cmpldi2(quad a)
+quad_t
+__one_cmpldi2(a)
+       quad_t a;
 {
        union uu aa;
 
 {
        union uu aa;
 
index b5d5ad8..8517ddf 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)qdivrem.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)qdivrem.c  5.7 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 /*
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -55,8 +55,9 @@ shl(register digit *p, register int len, register int sh)
  * divisor are 4 `digits' in this base (they are shorter if they have
  * leading zeros).
  */
  * divisor are 4 `digits' in this base (they are shorter if they have
  * leading zeros).
  */
-u_quad
-__qdivrem(u_quad uq, u_quad vq, u_quad *arq)
+u_quad_t
+__qdivrem(uq, vq, arq)
+       u_quad_t uq, vq, *arq;
 {
        union uu tmp;
        digit *u, *v, *q;
 {
        union uu tmp;
        digit *u, *v, *q;
index e299b1f..9e403db 100644 (file)
@@ -8,7 +8,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)quad.h      5.7 (Berkeley) %G%
+ *     @(#)quad.h      5.8 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
  *
  * This library makes the following assumptions:
  *
  *
  * This library makes the following assumptions:
  *
- *  - The type long long (aka quad) exists.
+ *  - The type long long (aka quad_t) exists.
  *
  *  - A quad variable is exactly twice as long as `long'.
  *
  *  - The machine's arithmetic is two's complement.
  *
  *
  *  - A quad variable is exactly twice as long as `long'.
  *
  *  - The machine's arithmetic is two's complement.
  *
- * All other machine parameters are encapsulated here.  This library can
- * provide 128-bit arithmetic on a machine with 128-bit quads and 64-bit
- * longs, for instance, or 96-bit arithmetic on machines with 48-bit longs.
+ * This library can provide 128-bit arithmetic on a machine with 128-bit
+ * quads and 64-bit longs, for instance, or 96-bit arithmetic on machines
+ * with 48-bit longs.
  */
 
  */
 
-#ifndef SPARC_XXX
-#include <machine/endian.h>            /* see #else case */
-#else
-/*
- * These are for testing and for illustration: we expect <machine/endian.h>
- * to define these.  Actually, these match most big-endian machines; for
- * most little-endian machines, all you need do is exchange _QUAD_HIGHWORD
- * and _QUAD_LOWWORD.
- */
-#define _QUAD_HIGHWORD 0
-#define _QUAD_LOWWORD  1
-#endif
-
-typedef long long quad;
-typedef unsigned long long u_quad;
-typedef unsigned long u_long;
-
+#include <sys/types.h>
 #include <limits.h>
 #include <limits.h>
-/*
- * We expect something like these from <limits.h>, which should be provided on
- * any ANSI C system.
-#define        USHRT_MAX       0xffff
-#define        CHAR_BIT        8
- */
 
 /*
 
 /*
- * Depending on the desired operation, we view a `long long' (aka quad) in
+ * Depending on the desired operation, we view a `long long' (aka quad_t) in
  * one or more of the following formats.
  */
 union uu {
  * one or more of the following formats.
  */
 union uu {
-       quad    q;              /* as a (signed) quad */
-       quad    uq;             /* as an unsigned quad */
+       quad_t  q;              /* as a (signed) quad */
+       quad_t  uq;             /* as an unsigned quad */
        long    sl[2];          /* as two signed longs */
        u_long  ul[2];          /* as two unsigned longs */
 };
        long    sl[2];          /* as two signed longs */
        u_long  ul[2];          /* as two unsigned longs */
 };
@@ -70,37 +48,37 @@ union uu {
 #define        L               _QUAD_LOWWORD
 
 /*
 #define        L               _QUAD_LOWWORD
 
 /*
- * Total number of bits in a quad and in the pieces that make it up.
+ * Total number of bits in a quad_t and in the pieces that make it up.
  * These are used for shifting, and also below for halfword extraction
  * and assembly.
  */
  * These are used for shifting, and also below for halfword extraction
  * and assembly.
  */
-#define        QUAD_BITS       (sizeof(quad) * CHAR_BIT)
+#define        QUAD_BITS       (sizeof(quad_t) * CHAR_BIT)
 #define        LONG_BITS       (sizeof(long) * CHAR_BIT)
 #define        HALF_BITS       (sizeof(long) * CHAR_BIT / 2)
 
 /*
  * Extract high and low shortwords from longword, and move low shortword of
  * longword to upper half of long, i.e., produce the upper longword of
 #define        LONG_BITS       (sizeof(long) * CHAR_BIT)
 #define        HALF_BITS       (sizeof(long) * CHAR_BIT / 2)
 
 /*
  * Extract high and low shortwords from longword, and move low shortword of
  * longword to upper half of long, i.e., produce the upper longword of
- * ((quad)(x) << (number_of_bits_in_long/2)).  (`x' must actually be u_long.)
+ * ((quad_t)(x) << (number_of_bits_in_long/2)).  (`x' must actually be u_long.)
  *
  * These are used in the multiply code, to split a longword into upper
  *
  * These are used in the multiply code, to split a longword into upper
- * and lower halves, and to reassemble a product as a quad, shifted left
+ * and lower halves, and to reassemble a product as a quad_t, shifted left
  * (sizeof(long)*CHAR_BIT/2).
  */
 #define        HHALF(x)        ((x) >> HALF_BITS)
 #define        LHALF(x)        ((x) & ((1 << HALF_BITS) - 1))
 #define        LHUP(x)         ((x) << HALF_BITS)
 
  * (sizeof(long)*CHAR_BIT/2).
  */
 #define        HHALF(x)        ((x) >> HALF_BITS)
 #define        LHALF(x)        ((x) & ((1 << HALF_BITS) - 1))
 #define        LHUP(x)         ((x) << HALF_BITS)
 
-extern u_quad __qdivrem(u_quad u, u_quad v, u_quad *rem);
+extern u_quad_t __qdivrem __P((u_quad_t u, u_quad_t v, u_quad_t *rem));
 
 /*
  * XXX
  * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
 
 /*
  * XXX
  * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
- * as u_quad, while gcc 2 correctly uses int.  Unfortunately, we still use
+ * as u_quad_t, while gcc 2 correctly uses int.  Unfortunately, we still use
  * both compilers.
  */
 #ifdef sparc
 typedef unsigned int   qshift_t;
 #else
  * both compilers.
  */
 #ifdef sparc
 typedef unsigned int   qshift_t;
 #else
-typedef u_quad         qshift_t;
+typedef u_quad_t       qshift_t;
 #endif
 #endif
index 533c8f9..5eaf3d6 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)subdi3.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)subdi3.c   5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -19,8 +19,9 @@ static char sccsid[] = "@(#)subdi3.c  5.4 (Berkeley) %G%";
  * Subtract two quad values.  This is trivial since a one-bit carry
  * from a single u_long difference x-y occurs if and only if (x-y) > x.
  */
  * Subtract two quad values.  This is trivial since a one-bit carry
  * from a single u_long difference x-y occurs if and only if (x-y) > x.
  */
-quad
-__subdi3(quad a, quad b)
+quad_t
+__subdi3(a, b)
+       quad_t a, b;
 {
        union uu aa, bb, diff;
 
 {
        union uu aa, bb, diff;
 
index 19d1afb..27611c9 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ucmpdi2.c  5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)ucmpdi2.c  5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -20,7 +20,8 @@ static char sccsid[] = "@(#)ucmpdi2.c 5.4 (Berkeley) %G%";
  * Neither a nor b are considered signed.
  */
 int
  * Neither a nor b are considered signed.
  */
 int
-__ucmpdi2(u_quad a, u_quad b)
+__ucmpdi2(a, b)
+       u_quad_t a, b;
 {
        union uu aa, bb;
 
 {
        union uu aa, bb;
 
index f01223d..3afc01a 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)udivdi3.c  5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)udivdi3.c  5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,9 +18,10 @@ static char sccsid[] = "@(#)udivdi3.c        5.3 (Berkeley) %G%";
 /*
  * Divide two unsigned quads.
  */
 /*
  * Divide two unsigned quads.
  */
-u_quad
-__udivdi3(u_quad a, u_quad b)
+u_quad_t
+__udivdi3(a, b)
+       u_quad_t a, b;
 {
 
 {
 
-       return (__qdivrem(a, b, (u_quad *)0));
+       return (__qdivrem(a, b, (u_quad_t *)0));
 }
 }
index e4b0a12..7209fd4 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)umoddi3.c  5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)umoddi3.c  5.5 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,10 +18,11 @@ static char sccsid[] = "@(#)umoddi3.c       5.4 (Berkeley) %G%";
 /*
  * Return remainder after dividing two unsigned quads.
  */
 /*
  * Return remainder after dividing two unsigned quads.
  */
-u_quad
-__umoddi3(u_quad a, u_quad b)
+u_quad_t
+__umoddi3(a, b)
+       u_quad_t a, b;
 {
 {
-       u_quad r;
+       u_quad_t r;
 
        (void)__qdivrem(a, b, &r);
        return (r);
 
        (void)__qdivrem(a, b, &r);
        return (r);
index 4c392c4..47c7821 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)xordi3.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)xordi3.c   5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
 #endif /* LIBC_SCCS and not lint */
 
 #include "quad.h"
@@ -18,8 +18,9 @@ static char sccsid[] = "@(#)xordi3.c  5.3 (Berkeley) %G%";
 /*
  * Return a ^ b, in quad.
  */
 /*
  * Return a ^ b, in quad.
  */
-quad
-__xordi3(quad a, quad b)
+quad_t
+__xordi3(a, b)
+       quad_t a, b;
 {
        union uu aa, bb;
 
 {
        union uu aa, bb;