summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2011-01-08 11:13:34 +0000
committertijl <tijl@FreeBSD.org>2011-01-08 11:13:34 +0000
commitaf03e997bad671908fbc09a2cabaf5b32eda911f (patch)
tree932f41023ad8badf93d44c65a1df3adb5980bc73 /sys/mips
parent114b45e573622f5a3f5ca0450e812cca504d525f (diff)
downloadFreeBSD-src-af03e997bad671908fbc09a2cabaf5b32eda911f.zip
FreeBSD-src-af03e997bad671908fbc09a2cabaf5b32eda911f.tar.gz
Fix types of some values in machine/_limits.h.
On some architectures UCHAR_MAX and USHRT_MAX had type unsigned int. However, lacking integer suffixes for types smaller than int, their type should correspond to that of an object of type unsigned char (or short) when used in an expression with objects of type int. In that case unsigned char (short) are promoted to int (i.e. signed) so the type of UCHAR_MAX and USHRT_MAX should also be int. Where MIN/MAX constants implicitly have the correct type the suffix has been removed. While here, correct some comments. Reviewed by: bde Approved by: kib (mentor)
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/include/_limits.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/mips/include/_limits.h b/sys/mips/include/_limits.h
index 435a61b..758c0e3 100644
--- a/sys/mips/include/_limits.h
+++ b/sys/mips/include/_limits.h
@@ -41,8 +41,6 @@
* type converted according to the integral promotions. The subtraction for
* 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 are for the default configuration of gcc. They work for
- * some other compilers as well, but this should not be depended on.
*/
#define __CHAR_BIT 8 /* number of bits in a char */
@@ -56,14 +54,14 @@
#define __SHRT_MAX 0x7fff /* max 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 __UINT_MAX 0xffffffff /* 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 */
#ifdef __LP64__
-#define __ULONG_MAX 0xffffffffffffffffUL
-#define __LONG_MAX 0x7fffffffffffffffL
-#define __LONG_MIN (-0x7fffffffffffffffL - 1)
+#define __ULONG_MAX 0xffffffffffffffff
+#define __LONG_MAX 0x7fffffffffffffff
+#define __LONG_MIN (-0x7fffffffffffffff - 1)
#define __LONG_BIT 64
#else
#define __ULONG_MAX 0xffffffffUL /* max value for an unsigned long */
OpenPOWER on IntegriCloud