ref: 840c98a16e5c6ce962d3a7d4c01c27a51dad2e23
parent: 7f2fdc6dcd531ba10f96d9d70e7612ce9e8330bd
author: Quentin Rameau <[email protected]>
date: Sun Mar 19 06:49:52 EDT 2017
[libc] Fix limits.h
--- a/libc/include/bits/amd64-sysv/arch/limits.h
+++ b/libc/include/bits/amd64-sysv/arch/limits.h
@@ -1,17 +1,17 @@
-#define SCHAR_MIN (-128)
-#define SCHAR_MAX 127
-#define UCHAR_MAX 255
-#define CHAR_MIN (-128)
-#define CHAR_MAX 127
-#define SHRT_MIN (-16384)
-#define SHRT_MAX 16383
-#define USHRT_MAX 65535
-#define INT_MIN (-268435456)
-#define INT_MAX 268435455
-#define UINT_MAX 4294967295
-#define LONG_MIN (-72057594037927936)
-#define LONG_MAX 72057594037927935
-#define ULONG_MAX 18446744073709551615
-#define LLONG_MIN (-72057594037927936)
-#define LLONG_MAX 72057594037927935
-#define ULLONG_MAX 18446744073709551615
+#define SCHAR_MAX 0x7F
+#define SCHAR_MIN (-SCHAR_MIN-1)
+#define CHAR_MAX 0x7F
+#define CHAR_MIN (-CHAR_MAX-1)
+#define UCHAR_MAX 0xFF
+#define SHRT_MAX 0x7FFF
+#define SHRT_MIN (-SHRT_MAX-1)
+#define USHRT_MAX 0xFFFF
+#define INT_MAX 0x7FFFFFFF
+#define INT_MIN (-INT_MAX-1)
+#define UINT_MAX 0xFFFFFFFF
+#define LONG_MAX 0x7FFFFFFFFFFFFFFF
+#define LONG_MIN (-LONG_MAX-1)
+#define ULONG_MAX 0xFFFFFFFFFFFFFFFF
+#define LLONG_MAX 0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/libc/include/bits/i386-sysv/arch/limits.h
+++ b/libc/include/bits/i386-sysv/arch/limits.h
@@ -1,17 +1,17 @@
-#define SCHAR_MIN (-128)
-#define SCHAR_MAX 127
-#define UCHAR_MAX 255
-#define CHAR_MIN (-128)
-#define CHAR_MAX 127
-#define SHRT_MIN (-16384)
-#define SHRT_MAX 16383
-#define USHRT_MAX 65535
-#define INT_MIN (-268435456)
-#define INT_MAX 268435455
-#define UINT_MAX 4294967295
-#define LONG_MIN (-268435456)
-#define LONG_MAX 268435455
-#define ULONG_MAX 4294967295
-#define LLONG_MIN (-72057594037927936)
-#define LLONG_MAX 72057594037927935
-#define ULLONG_MAX 18446744073709551615
+#define SCHAR_MAX 0x7F
+#define SCHAR_MIN (-SCHAR_MIN-1)
+#define CHAR_MAX 0x7F
+#define CHAR_MIN (-CHAR_MAX-1)
+#define UCHAR_MAX 0xFF
+#define SHRT_MAX 0x7FFF
+#define SHRT_MIN (-SHRT_MAX-1)
+#define USHRT_MAX 0xFFFF
+#define INT_MAX 0x7FFFFFFF
+#define INT_MIN (-INT_MAX-1)
+#define UINT_MAX 0xFFFFFFFF
+#define LONG_MAX 0x7FFFFFFF
+#define LONG_MIN (-LONG_MAX-1)
+#define ULONG_MAX 0xFFFFFFFF
+#define LLONG_MAX 0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/libc/include/bits/qbe/arch/limits.h
+++ b/libc/include/bits/qbe/arch/limits.h
@@ -1,17 +1,17 @@
-#define SCHAR_MIN (-128)
-#define SCHAR_MAX 127
-#define UCHAR_MAX 255
-#define CHAR_MIN (-128)
-#define CHAR_MAX 127
-#define SHRT_MIN (-16384)
-#define SHRT_MAX 16383
-#define USHRT_MAX 65535
-#define INT_MIN (-268435456)
-#define INT_MAX 268435455
-#define UINT_MAX 4294967295
-#define LONG_MIN (-72057594037927936)
-#define LONG_MAX 72057594037927935
-#define ULONG_MAX 18446744073709551615
-#define LLONG_MIN (-72057594037927936)
-#define LLONG_MAX 72057594037927935
-#define ULLONG_MAX 18446744073709551615
+#define SCHAR_MAX 0x7F
+#define SCHAR_MIN (-SCHAR_MIN-1)
+#define CHAR_MAX 0x7F
+#define CHAR_MIN (-CHAR_MAX-1)
+#define UCHAR_MAX 0xFF
+#define SHRT_MAX 0x7FFF
+#define SHRT_MIN (-SHRT_MAX-1)
+#define USHRT_MAX 0xFFFF
+#define INT_MAX 0x7FFFFFFF
+#define INT_MIN (-INT_MAX-1)
+#define UINT_MAX 0xFFFFFFFF
+#define LONG_MAX 0x7FFFFFFFFFFFFFFF
+#define LONG_MIN (-LONG_MAX-1)
+#define ULONG_MAX 0xFFFFFFFFFFFFFFFF
+#define LLONG_MAX 0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/libc/include/bits/z80/arch/limits.h
+++ b/libc/include/bits/z80/arch/limits.h
@@ -1,17 +1,17 @@
-#define SCHAR_MIN (-128)
-#define SCHAR_MAX 127
-#define UCHAR_MAX 255
+#define SCHAR_MAX 0x7F
+#define SCHAR_MIN (-SCHAR_MIN-1)
+#define CHAR_MAX 0xFF
#define CHAR_MIN 0
-#define CHAR_MAX 255
-#define SHRT_MIN (-16384)
-#define SHRT_MAX 16383
-#define USHRT_MAX 65535
-#define INT_MIN (-16384)
-#define INT_MAX 16383
-#define UINT_MAX 65535
-#define LONG_MIN (-268435456)
-#define LONG_MAX 268435455
-#define ULONG_MAX 4294967295
-#define LLONG_MIN (-72057594037927936)
-#define LLONG_MAX 72057594037927935
-#define ULLONG_MAX 18446744073709551615
+#define UCHAR_MAX 0xFF
+#define SHRT_MAX 0x7FFF
+#define SHRT_MIN (-SHRT_MAX-1)
+#define USHRT_MAX 0xFFFF
+#define INT_MAX 0x7FFF
+#define INT_MIN (-INT_MAX-1)
+#define UINT_MAX 0xFFFF
+#define LONG_MAX 0x7FFFFFFF
+#define LONG_MIN (-LONG_MAX-1)
+#define ULONG_MAX 0xFFFFFFFF
+#define LLONG_MAX 0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF