From 731439099b56dea8ffdcbecb5657ce327bd7252a Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 5 Jul 2012 23:45:57 +0000 Subject: 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 --- nuttx/arch/z80/include/ez80/limits.h | 45 ++++++++++++++++++++---------------- nuttx/arch/z80/include/z8/limits.h | 39 +++++++++++++++++-------------- nuttx/arch/z80/include/z80/limits.h | 39 +++++++++++++++++-------------- 3 files changed, 69 insertions(+), 54 deletions(-) (limited to 'nuttx/arch/z80') 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 + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * 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 + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * 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 + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * 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 */ -- cgit v1.2.3