PERFORCE change 30823 for review
Juli Mallett
jmallett at FreeBSD.org
Thu May 8 15:24:46 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=30823
Change 30823 by jmallett at jmallett_dalek on 2003/05/08 15:24:38
Move to split <machine/_?limits.h> format, and steal from
SPARC64 instead of PowerPC except for the unsigned char
hackery.
Affected files ...
.. //depot/projects/mips/sys/mips/include/_limits.h#1 add
.. //depot/projects/mips/sys/mips/include/limits.h#3 edit
Differences ...
==== //depot/projects/mips/sys/mips/include/limits.h#3 (text+ko) ====
@@ -10,13 +10,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -31,10 +24,10 @@
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/powerpc/include/limits.h,v 1.23 2003/01/18 11:23:42 grehan Exp $
+ * $FreeBSD$
*/
-#ifndef _MACHINE_LIMITS_H_
+#ifndef _MACHINE_LIMITS_H_
#define _MACHINE_LIMITS_H_
#define CHAR_BIT 8 /* number of bits in a char */
@@ -50,9 +43,9 @@
* some other compilers as well, but this should not be depended on.
*/
#define SCHAR_MAX 0x7f /* max value for a signed char */
-#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
+#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */
-#define UCHAR_MAX 0xff /* max value for an unsigned char */
+#define UCHAR_MAX 0xffU /* max value for an unsigned char */
#ifdef __CHAR_UNSIGNED__
#define CHAR_MAX UCHAR_MAX /* max value for a char */
@@ -62,47 +55,51 @@
#define CHAR_MIN SCHAR_MIN /* min value for a char */
#endif
-#define USHRT_MAX 0xffff /* max value for an unsigned short */
+#define USHRT_MAX 0xffffU /* max value for an unsigned short */
#define SHRT_MAX 0x7fff /* max value for a short */
-#define SHRT_MIN (-0x7fff - 1) /* min value for a short */
+#define SHRT_MIN (-0x7fff-1) /* min value for a short */
#define UINT_MAX 0xffffffffU /* max value for an unsigned int */
#define INT_MAX 0x7fffffff /* max value for an int */
-#define INT_MIN (-0x7fffffff - 1) /* min value for an int */
+#define INT_MIN (-0x7fffffff-1) /* min value for an int */
-/* Bad hack for gcc configured to give 64-bit longs. */
-#ifdef _LARGE_LONG
-#define ULONG_MAX 0xffffffffffffffffUL
-#define LONG_MAX 0x7fffffffffffffffL
-#define LONG_MIN (-0x7fffffffffffffffL - 1)
-#else
-#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */
-#define LONG_MAX 0x7fffffffL /* max value for a long */
-#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */
-#endif
+#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */
+#define LONG_MAX 0x7fffffffffffffffL /* max for a long */
+#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */
- /* max value for an unsigned long long */
+/* Long longs and longs are the same size on the alpha. */
+ /* max for an unsigned long long */
#define ULLONG_MAX 0xffffffffffffffffULL
-#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */
-#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
+#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */
+#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */
#if !defined(_ANSI_SOURCE)
-#define SSIZE_MAX INT_MAX /* max value for a ssize_t */
+#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
+
+#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
+#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */
-#if !defined(_POSIX_SOURCE)
-#define SIZE_T_MAX UINT_MAX /* max value for a size_t */
+#define OFF_MAX LONG_MAX /* max value for an off_t */
+#define OFF_MIN LONG_MIN /* min value for an off_t */
-#define OFF_MAX LLONG_MAX /* max value for an off_t */
-#define OFF_MIN LLONG_MIN /* min value for an off_t */
+/* Quads and longs are the same on the alpha. Ensure they stay in sync. */
+#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */
+#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */
+#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */
+#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
+#endif /* !_ANSI_SOURCE */
-/* Quads and long longs are the same size. Ensure they stay in sync. */
-#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */
-#define QUAD_MAX LLONG_MAX /* max value for a quad_t */
-#define QUAD_MIN LLONG_MIN /* min value for a quad_t */
+#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
+#define LONG_BIT 64
+#define WORD_BIT 32
-#define LONG_BIT 32
+#define DBL_DIG 15
+#define DBL_MAX 1.7976931348623157E+308
+#define DBL_MIN 2.2250738585072014E-308
-#endif /* !_POSIX_SOURCE */
-#endif /* !_ANSI_SOURCE */
+#define FLT_DIG 6
+#define FLT_MAX 3.40282347E+38F
+#define FLT_MIN 1.17549435E-38F
+#endif
#endif /* !_MACHINE_LIMITS_H_ */
More information about the p4-projects
mailing list