summaryrefslogtreecommitdiff
path: root/nuttx/arch/hc
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-07 16:00:56 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-07 16:00:56 +0000
commit3c5cba9b94c3f5365034f044e18a58d425508c87 (patch)
treec29f3db20b8275cd22e7c4d36c3d722f2fdf6277 /nuttx/arch/hc
parent73bf549bd5a335d66ef80e50b551d356386facad (diff)
downloadpx4-nuttx-3c5cba9b94c3f5365034f044e18a58d425508c87.tar.gz
px4-nuttx-3c5cba9b94c3f5365034f044e18a58d425508c87.tar.bz2
px4-nuttx-3c5cba9b94c3f5365034f044e18a58d425508c87.zip
Patches from Petteri Aimonen + stdbool and rand() changes for Freddie Chopin
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5415 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/hc')
-rw-r--r--nuttx/arch/hc/include/hc12/limits.h19
-rw-r--r--nuttx/arch/hc/include/hcs12/limits.h19
2 files changed, 18 insertions, 20 deletions
diff --git a/nuttx/arch/hc/include/hc12/limits.h b/nuttx/arch/hc/include/hc12/limits.h
index edb92c7e6..c35148a56 100644
--- a/nuttx/arch/hc/include/hc12/limits.h
+++ b/nuttx/arch/hc/include/hc12/limits.h
@@ -45,7 +45,7 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN (-128)
+#define SCHAR_MIN (-SCHAR_MAX - 1)
#define SCHAR_MAX 127
#define UCHAR_MAX 255
@@ -59,39 +59,38 @@
#define CHAR_MAX SCHAR_MAX
#endif
-#define SHRT_MIN (-32768)
+#define SHRT_MIN (-SHRT_MAX - 1)
#define SHRT_MAX 32767
-#define USHRT_MAX 65535
+#define USHRT_MAX 65535U
/* The size of an integer is controlled with the -mshort or -mnoshort GCC
* options. GCC will set the pre-defined symbol __INT__ to indicate the size
* of an integer
*/
+#define INT_MIN (-INT_MAX - 1)
#if __INT__ == 32
-# define INT_MIN (-2147483648)
# define INT_MAX 2147483647
# define UINT_MAX 4294967295
#else
-# define INT_MIN (-32768)
# define INT_MAX 32767
-# define UINT_MAX 65535
+# define UINT_MAX 65535U
#endif
/* Long is 4-bytes and long long is 8 bytes in any case */
-#define LONG_MIN (-2147483648L)
+#define LONG_MIN (-LONG_MAX - 1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295UL
-#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MIN (-LLONG_MAX - 1)
#define LLONG_MAX 9223372036854775807LL
#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 2 bytes */
-#define PTR_MIN (-32768)
+#define PTR_MIN (-PTR_MAX - 1)
#define PTR_MAX 32767
-#define UPTR_MAX 65535
+#define UPTR_MAX 65535U
#endif /* __ARCH_HC_INCLUDE_HC12_LIMITS_H */
diff --git a/nuttx/arch/hc/include/hcs12/limits.h b/nuttx/arch/hc/include/hcs12/limits.h
index 597626484..5b10d910f 100644
--- a/nuttx/arch/hc/include/hcs12/limits.h
+++ b/nuttx/arch/hc/include/hcs12/limits.h
@@ -45,7 +45,7 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN (-128)
+#define SCHAR_MIN (-SCHAR_MAX - 1)
#define SCHAR_MAX 127
#define UCHAR_MAX 255
@@ -59,39 +59,38 @@
#define CHAR_MAX SCHAR_MAX
#endif
-#define SHRT_MIN (-32768)
+#define SHRT_MIN (-SHRT_MAX - 1)
#define SHRT_MAX 32767
-#define USHRT_MAX 65535
+#define USHRT_MAX 65535U
/* The size of an integer is controlled with the -mshort or -mnoshort GCC
* options. GCC will set the pre-defined symbol __INT__ to indicate the size
* of an integer
*/
+#define INT_MIN (-INT_MAX - 1)
#if __INT__ == 32
-# define INT_MIN (-2147483648)
# define INT_MAX 2147483647
# define UINT_MAX 4294967295
#else
-# define INT_MIN (-32768)
# define INT_MAX 32767
-# define UINT_MAX 65535
+# define UINT_MAX 65535U
#endif
/* Long is 4-bytes and long long is 8 bytes in any case */
-#define LONG_MIN (-2147483648L)
+#define LONG_MIN (-LONG_MAX - 1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295UL
-#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MIN (-LLONG_MAX - 1)
#define LLONG_MAX 9223372036854775807LL
#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 2 bytes */
-#define PTR_MIN (-32768)
+#define PTR_MIN (-PTR_MAX - 1)
#define PTR_MAX 32767
-#define UPTR_MAX 65535
+#define UPTR_MAX 65535U
#endif /* __ARCH_HC_INCLUDE_HCS12_LIMITS_H */