summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/arch/8051/include/limits.h39
-rw-r--r--nuttx/arch/arm/include/limits.h45
-rw-r--r--nuttx/arch/avr/include/avr/limits.h45
-rw-r--r--nuttx/arch/avr/include/avr32/limits.h45
-rwxr-xr-xnuttx/arch/hc/include/hc12/limits.h51
-rwxr-xr-xnuttx/arch/hc/include/hcs12/limits.h51
-rw-r--r--nuttx/arch/mips/include/limits.h45
-rw-r--r--nuttx/arch/rgmp/include/limits.h45
-rw-r--r--nuttx/arch/sh/include/m16c/limits.h39
-rw-r--r--nuttx/arch/sh/include/sh1/limits.h45
-rw-r--r--nuttx/arch/sim/include/limits.h45
-rwxr-xr-xnuttx/arch/x86/include/i486/limits.h41
-rw-r--r--nuttx/arch/z16/include/limits.h45
-rwxr-xr-xnuttx/arch/z80/include/ez80/limits.h45
-rwxr-xr-xnuttx/arch/z80/include/z8/limits.h39
-rwxr-xr-xnuttx/arch/z80/include/z80/limits.h39
16 files changed, 392 insertions, 312 deletions
diff --git a/nuttx/arch/8051/include/limits.h b/nuttx/arch/8051/include/limits.h
index 3344a8d2d..f3021f6cc 100644
--- a/nuttx/arch/8051/include/limits.h
+++ b/nuttx/arch/8051/include/limits.h
@@ -1,8 +1,8 @@
/************************************************************
* arch/8051/include/limits.h
*
- * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,35 +45,40 @@
************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x8000
-#define INT_MAX 0x7fff
-#define UINT_MAX 0xffff
+#define INT_MIN (-32768)
+#define INT_MAX 32767
+#define UINT_MAX 65535
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
/* For SDCC, a Generic pointer is 3 bytes in length with the
* first byte holding data space information.
*/
-#define PTR_MIN 0x800000
-#define PTR_MAX 0x7fffff
-#define UPTR_MAX 0xffffff
+#define PTR_MIN (-8388608)
+#define PTR_MAX 8388607
+#define UPTR_MAX 16777215
#endif /* __ARCH_8051_INCLUDE_LIMITS_H */
diff --git a/nuttx/arch/arm/include/limits.h b/nuttx/arch/arm/include/limits.h
index c2033dd94..12c92f6cf 100644
--- a/nuttx/arch/arm/include/limits.h
+++ b/nuttx/arch/arm/include/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/arm/include/limits.h
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,37 +45,42 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_ARM_INCLUDE_LIMITS_H */
diff --git a/nuttx/arch/avr/include/avr/limits.h b/nuttx/arch/avr/include/avr/limits.h
index d594408ce..67d66ce7a 100644
--- a/nuttx/arch/avr/include/avr/limits.h
+++ b/nuttx/arch/avr/include/avr/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/avr/include/avr/limits.h
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,40 +45,45 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
/* Integer is two bytes */
-#define INT_MIN 0x8000
-#define INT_MAX 0x7fff
-#define UINT_MAX 0xffff
+#define INT_MIN (-32768)
+#define INT_MAX 32767
+#define UINT_MAX 65535
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is two bytes */
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#endif /* __ARCH_AVR_INCLUDE_AVR_LIMITS_H */
diff --git a/nuttx/arch/avr/include/avr32/limits.h b/nuttx/arch/avr/include/avr32/limits.h
index 28cc1708c..f4fad08ff 100644
--- a/nuttx/arch/avr/include/avr32/limits.h
+++ b/nuttx/arch/avr/include/avr32/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/avr/include/avr32/limits.h
*
- * Copyright (C) 2010, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2010, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,40 +45,45 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
/* Integer is four bytes */
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is four bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_AVR_INCLUDE_AVR32_LIMITS_H */
diff --git a/nuttx/arch/hc/include/hc12/limits.h b/nuttx/arch/hc/include/hc12/limits.h
index ee6a48ca8..edb92c7e6 100755
--- a/nuttx/arch/hc/include/hc12/limits.h
+++ b/nuttx/arch/hc/include/hc12/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/hc/include/hc12/limits.h
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,18 +45,23 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
/* 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
@@ -64,29 +69,29 @@
*/
#if __INT__ == 32
-# define INT_MIN 0x80000000
-# define INT_MAX 0x7fffffff
-# define UINT_MAX 0xffffffff
+# define INT_MIN (-2147483648)
+# define INT_MAX 2147483647
+# define UINT_MAX 4294967295
#else
-# define INT_MIN 0x8000
-# define INT_MAX 0x7fff
-# define UINT_MAX 0xffff
+# define INT_MIN (-32768)
+# define INT_MAX 32767
+# define UINT_MAX 65535
#endif
/* Long is 4-bytes and long long is 8 bytes in any case */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 2 bytes */
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#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 eb950cfc5..597626484 100755
--- a/nuttx/arch/hc/include/hcs12/limits.h
+++ b/nuttx/arch/hc/include/hcs12/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/hc/include/hcs12/limits.h
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,18 +45,23 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
/* 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
@@ -64,29 +69,29 @@
*/
#if __INT__ == 32
-# define INT_MIN 0x80000000
-# define INT_MAX 0x7fffffff
-# define UINT_MAX 0xffffffff
+# define INT_MIN (-2147483648)
+# define INT_MAX 2147483647
+# define UINT_MAX 4294967295
#else
-# define INT_MIN 0x8000
-# define INT_MAX 0x7fff
-# define UINT_MAX 0xffff
+# define INT_MIN (-32768)
+# define INT_MAX 32767
+# define UINT_MAX 65535
#endif
/* Long is 4-bytes and long long is 8 bytes in any case */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 2 bytes */
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#endif /* __ARCH_HC_INCLUDE_HCS12_LIMITS_H */
diff --git a/nuttx/arch/mips/include/limits.h b/nuttx/arch/mips/include/limits.h
index 1bd2edabc..4feff7fe1 100644
--- a/nuttx/arch/mips/include/limits.h
+++ b/nuttx/arch/mips/include/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/mips/include/limits.h
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,38 +45,43 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_MIPS_INCLUDE_LIMITS_H */
diff --git a/nuttx/arch/rgmp/include/limits.h b/nuttx/arch/rgmp/include/limits.h
index 855836660..fdd8bfd10 100644
--- a/nuttx/arch/rgmp/include/limits.h
+++ b/nuttx/arch/rgmp/include/limits.h
@@ -1,8 +1,8 @@
/************************************************************
* arch/rgmp/include/limits.h
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,37 +45,42 @@
************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_RGMP_INCLUDE_LIMITS_H */
diff --git a/nuttx/arch/sh/include/m16c/limits.h b/nuttx/arch/sh/include/m16c/limits.h
index 589cb5be1..d836522e7 100644
--- a/nuttx/arch/sh/include/m16c/limits.h
+++ b/nuttx/arch/sh/include/m16c/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/sh/include/m16c/limits.h
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,18 +45,23 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
/* For M16C, type int is 16-bits, the same size as type 'short int' */
@@ -66,18 +71,18 @@
/* For M16C, typle 'long int' is 32-bits */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 2 bytes */
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#endif /* __ARCH_SH_INCLUDE_M16C_LIMITS_H */
diff --git a/nuttx/arch/sh/include/sh1/limits.h b/nuttx/arch/sh/include/sh1/limits.h
index 4bb3a8a4e..ce9085bfb 100644
--- a/nuttx/arch/sh/include/sh1/limits.h
+++ b/nuttx/arch/sh/include/sh1/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/sh/include/sh1/limits.h
*
- * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008, 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,39 +45,44 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
/* On SH-1, type 'int' is 32-bits */
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* On SH-1, type 'long' is the same size as type 'int', 32-bits */
-#define LONG_MAX INT_MIN
-#define LONG_MIN INT_MAX
-#define ULONG_MAX UINT_MAX
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_SH_INCLUDE_SH1_LIMITS_H */
diff --git a/nuttx/arch/sim/include/limits.h b/nuttx/arch/sim/include/limits.h
index 775d0298d..9aa36b1d0 100644
--- a/nuttx/arch/sim/include/limits.h
+++ b/nuttx/arch/sim/include/limits.h
@@ -1,8 +1,8 @@
/************************************************************
* arch/sim/include/limits.h
*
- * Copyright (C) 2007,2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,37 +45,42 @@
************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_SIM_INCLUDE_LIMITS_H */
diff --git a/nuttx/arch/x86/include/i486/limits.h b/nuttx/arch/x86/include/i486/limits.h
index ac0755ef9..ae8a779d4 100755
--- a/nuttx/arch/x86/include/i486/limits.h
+++ b/nuttx/arch/x86/include/i486/limits.h
@@ -45,37 +45,42 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x8000000000000000
-#define LLONG_MIN 0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
+#define LLONG_MIN (-9223372036854775808LL)
+#define LLONG_MAX 9223372036854775807LL
+#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_X86_INCLUDE_I486_LIMITS_H */
diff --git a/nuttx/arch/z16/include/limits.h b/nuttx/arch/z16/include/limits.h
index 05c34fae4..55ee7a2c5 100644
--- a/nuttx/arch/z16/include/limits.h
+++ b/nuttx/arch/z16/include/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/z16/include/limits.h
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,35 +45,40 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x80000000
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
+#define INT_MIN (-2147483648)
+#define INT_MAX 2147483647
+#define UINT_MAX 4294967295
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
-#define LLONG_MAX 0x80000000
-#define LLONG_MIN 0x7fffffff
-#define ULLONG_MAX 0xffffffff
+#define LLONG_MIN (-2147483648L)
+#define LLONG_MAX 2147483647L
+#define ULLONG_MAX 4294967295UL
/* A pointer is 4 bytes */
-#define PTR_MIN 0x80000000
-#define PTR_MAX 0x7fffffff
-#define UPTR_MAX 0xffffffff
+#define PTR_MIN (-2147483648)
+#define PTR_MAX 2147483647
+#define UPTR_MAX 4294967295
#endif /* __ARCH_Z16_INCLUDE_LIMITS_H */
diff --git a/nuttx/arch/z80/include/ez80/limits.h b/nuttx/arch/z80/include/ez80/limits.h
index b276dd399..1dfa2afee 100755
--- a/nuttx/arch/z80/include/ez80/limits.h
+++ b/nuttx/arch/z80/include/ez80/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/z80/include/ez80/limits.h
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,28 +45,33 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x8000
-#define INT_MAX 0x7fff
-#define UINT_MAX 0xffff
+#define INT_MIN (-32768)
+#define INT_MAX 32767
+#define UINT_MAX 65535
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
/* A pointer is 2 or 3 bytes, depending upon if the ez80 is in z80
* compatibility mode or not
@@ -76,13 +81,13 @@
*/
#ifdef CONFIG_EZ80_Z80MODE
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#else
-#define PTR_MIN 0x800000
-#define PTR_MAX 0x7fffff
-#define UPTR_MAX 0xffffff
+#define PTR_MIN (-8388608)
+#define PTR_MAX 8388607
+#define UPTR_MAX 16777215
#endif
#endif /* __ARCH_Z80_INCLUDE_EZ80_LIMITS_H */
diff --git a/nuttx/arch/z80/include/z8/limits.h b/nuttx/arch/z80/include/z8/limits.h
index 9084b65ef..94614ee25 100755
--- a/nuttx/arch/z80/include/z8/limits.h
+++ b/nuttx/arch/z80/include/z8/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/z80/include/z8/limits.h
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,33 +45,38 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x8000
-#define INT_MAX 0x7fff
-#define UINT_MAX 0xffff
+#define INT_MIN (-32768)
+#define INT_MAX 32767
+#define UINT_MAX 65535
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
/* A pointer is 2 bytes */
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#endif /* __ARCH_Z80_INCLUDE_Z8_LIMITS_H */
diff --git a/nuttx/arch/z80/include/z80/limits.h b/nuttx/arch/z80/include/z80/limits.h
index 4e412e3d6..ff5770442 100755
--- a/nuttx/arch/z80/include/z80/limits.h
+++ b/nuttx/arch/z80/include/z80/limits.h
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/z80/include/z80/limits.h
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,33 +45,38 @@
****************************************************************************/
#define CHAR_BIT 8
-#define SCHAR_MIN 0x80
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
+#define SCHAR_MIN (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MAX 255
/* These could be different on machines where char is unsigned */
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
+#endif
-#define SHRT_MIN 0x8000
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
+#define SHRT_MIN (-32768)
+#define SHRT_MAX 32767
+#define USHRT_MAX 65535
-#define INT_MIN 0x8000
-#define INT_MAX 0x7fff
-#define UINT_MAX 0xffff
+#define INT_MIN (-32768)
+#define INT_MAX 32767
+#define UINT_MAX 65535
/* These change on 32-bit and 64-bit platforms */
-#define LONG_MAX 0x80000000
-#define LONG_MIN 0x7fffffff
-#define ULONG_MAX 0xffffffff
+#define LONG_MIN (-2147483648L)
+#define LONG_MAX 2147483647L
+#define ULONG_MAX 4294967295UL
/* A pointer is 2 bytes */
-#define PTR_MIN 0x8000
-#define PTR_MAX 0x7fff
-#define UPTR_MAX 0xffff
+#define PTR_MIN (-32768)
+#define PTR_MAX 32767
+#define UPTR_MAX 65535
#endif /* __ARCH_Z80_INCLUDE_Z80_LIMITS_H */