diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-05 23:45:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-05 23:45:57 +0000 |
commit | 731439099b56dea8ffdcbecb5657ce327bd7252a (patch) | |
tree | 5e97e5b83d816176a3ac9d85f01119ac040b91ca /nuttx/arch/z16/include/limits.h | |
parent | 6a40832bcdd0acbfa1aa6b6c93b36dfeab5f4623 (diff) | |
download | px4-nuttx-731439099b56dea8ffdcbecb5657ce327bd7252a.tar.gz px4-nuttx-731439099b56dea8ffdcbecb5657ce327bd7252a.tar.bz2 px4-nuttx-731439099b56dea8ffdcbecb5657ce327bd7252a.zip |
Change all values in all limits.h for all architectures to signed decimal; the hex values were not sign extending appropriate in most uses
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4911 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z16/include/limits.h')
-rw-r--r-- | nuttx/arch/z16/include/limits.h | 45 |
1 files changed, 25 insertions, 20 deletions
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 */ |