diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-03-30 06:16:08 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-03-30 06:16:08 +0000 |
commit | 2d33d82794559b83131b83528279ce898716c112 (patch) | |
tree | 0cf9f625341314a54010e027a9c01305de797c08 /src/common/cbasetypes.h | |
parent | 5b5afa7bb6cad66880bbbeee26d0851f25f85d45 (diff) | |
download | hercules-2d33d82794559b83131b83528279ce898716c112.tar.gz hercules-2d33d82794559b83131b83528279ce898716c112.tar.bz2 hercules-2d33d82794559b83131b83528279ce898716c112.tar.xz hercules-2d33d82794559b83131b83528279ce898716c112.zip |
* Added all the missing defines for ctype.h functions and converted all the direct uses to the defines.
Ref: http://www.eathena.ws/board/index.php?showtopic=145235
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10091 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/cbasetypes.h')
-rw-r--r-- | src/common/cbasetypes.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 1a1cd22a9..b513b7fa3 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -297,9 +297,22 @@ typedef char bool; ////////////////////////////////////////////////////////////////////////// // Has to be unsigned to avoid problems in some systems -#define TOLOWER(c) ((char)tolower((unsigned char)(c))) -#define ISSPACE(c) (isspace((unsigned char)(c))) -#define ISALPHA(c) (isalpha((unsigned char)(c))) +// Problems arise when these functions expect an argument in the range [0,256[ and are feed a signed char. +// NOTE: <ctype.h> needs to be included when using these defines #define ISALNUM(c) (isalnum((unsigned char)(c))) +#define ISALPHA(c) (isalpha((unsigned char)(c))) +#define ISCNTRL(c) (iscntrl((unsigned char)(c))) +#define ISDIGIT(c) (isdigit((unsigned char)(c))) +#define ISGRAPH(c) (isgraph((unsigned char)(c))) +#define ISLOWER(c) (islower((unsigned char)(c))) +#define ISPRINT(c) (isprint((unsigned char)(c))) +#define ISPUNCT(c) (ispunct((unsigned char)(c))) +#define ISSPACE(c) (isspace((unsigned char)(c))) +#define ISUPPER(c) (isupper((unsigned char)(c))) +#define ISXDIGIT(c) (isxdigit((unsigned char)(c))) +#define TOASCII(c) (toascii((unsigned char)(c))) +#define TOLOWER(c) (tolower((unsigned char)(c))) +#define TOUPPER(c) (toupper((unsigned char)(c))) + #endif /* _CBASETYPES_H_ */ |