diff options
Diffstat (limited to 'nuttx/arch/8051/include/limits.h')
-rw-r--r-- | nuttx/arch/8051/include/limits.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/nuttx/arch/8051/include/limits.h b/nuttx/arch/8051/include/limits.h index 3344a8d2d9..f3021f6cce 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 */ |