From 5cc4f2002f039faff9df2cf6ead351f67e674013 Mon Sep 17 00:00:00 2001 From: obrien Date: Tue, 24 Oct 2000 10:49:56 +0000 Subject: [PATCH] Adjust comments Submitted by: bde Add ISO C99's long long type limits. Reviewed by: bde --- sys/alpha/include/_limits.h | 14 ++++++++++---- sys/alpha/include/limits.h | 14 ++++++++++---- sys/ia64/include/_limits.h | 14 ++++++++++---- sys/ia64/include/limits.h | 14 ++++++++++---- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/sys/alpha/include/_limits.h b/sys/alpha/include/_limits.h index 99ca2d89843f..474d28dd4a0d 100644 --- a/sys/alpha/include/_limits.h +++ b/sys/alpha/include/_limits.h @@ -44,10 +44,10 @@ * #if preprocessing directives. Additionally, the expression must have the * same type as would an expression that is an object of the corresponding * type converted according to the integral promotions. The subtraction for - * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values - * are written as hex so that GCC will be quiet about large integer constants. + * These numbers are for the default configuration of gcc. They work for + * 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 */ @@ -68,13 +68,19 @@ #define LONG_MAX 0x7fffffffffffffffL /* max for a long */ #define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a 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 for a long long */ +#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ + #if !defined(_ANSI_SOURCE) #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 */ -/* Quads and longs are the same on the alpha */ +/* 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 */ diff --git a/sys/alpha/include/limits.h b/sys/alpha/include/limits.h index 99ca2d89843f..474d28dd4a0d 100644 --- a/sys/alpha/include/limits.h +++ b/sys/alpha/include/limits.h @@ -44,10 +44,10 @@ * #if preprocessing directives. Additionally, the expression must have the * same type as would an expression that is an object of the corresponding * type converted according to the integral promotions. The subtraction for - * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values - * are written as hex so that GCC will be quiet about large integer constants. + * These numbers are for the default configuration of gcc. They work for + * 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 */ @@ -68,13 +68,19 @@ #define LONG_MAX 0x7fffffffffffffffL /* max for a long */ #define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a 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 for a long long */ +#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ + #if !defined(_ANSI_SOURCE) #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 */ -/* Quads and longs are the same on the alpha */ +/* 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 */ diff --git a/sys/ia64/include/_limits.h b/sys/ia64/include/_limits.h index 99ca2d89843f..97aa61b96e2f 100644 --- a/sys/ia64/include/_limits.h +++ b/sys/ia64/include/_limits.h @@ -44,10 +44,10 @@ * #if preprocessing directives. Additionally, the expression must have the * same type as would an expression that is an object of the corresponding * type converted according to the integral promotions. The subtraction for - * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values - * are written as hex so that GCC will be quiet about large integer constants. + * These numbers are for the default configuration of gcc. They work for + * 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 */ @@ -68,13 +68,19 @@ #define LONG_MAX 0x7fffffffffffffffL /* max for a long */ #define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ +/* Long longs and longs are the same size on the IA-64. */ + /* max for an unsigned long long */ +#define ULLONG_MAX 0xffffffffffffffffULL +#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 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 */ -/* Quads and longs are the same on the alpha */ +/* Quads and longs are the same. 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 */ diff --git a/sys/ia64/include/limits.h b/sys/ia64/include/limits.h index 99ca2d89843f..97aa61b96e2f 100644 --- a/sys/ia64/include/limits.h +++ b/sys/ia64/include/limits.h @@ -44,10 +44,10 @@ * #if preprocessing directives. Additionally, the expression must have the * same type as would an expression that is an object of the corresponding * type converted according to the integral promotions. The subtraction for - * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values - * are written as hex so that GCC will be quiet about large integer constants. + * These numbers are for the default configuration of gcc. They work for + * 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 */ @@ -68,13 +68,19 @@ #define LONG_MAX 0x7fffffffffffffffL /* max for a long */ #define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ +/* Long longs and longs are the same size on the IA-64. */ + /* max for an unsigned long long */ +#define ULLONG_MAX 0xffffffffffffffffULL +#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 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 */ -/* Quads and longs are the same on the alpha */ +/* Quads and longs are the same. 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 */