scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 02c9435d33bf0bfbf15210cff500a3de14f209e8
parent fbda8879666e4144c62bcab1bd6530dac1ea09c0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 25 Sep 2017 10:49:43 +0100

[libc] Do not use () in ctype macros

The parenthesis are unneded in this case because it
is impossible to have any precedence problem in this context.

Diffstat:
Mlib/c/include/ctype.h | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/c/include/ctype.h b/lib/c/include/ctype.h @@ -30,17 +30,17 @@ extern int toupper(int c); extern unsigned char __ctype[]; extern int __ctmp; -#define isalnum(c) ((__ctype+1)[(c)] & (_U|_L|_D)) -#define isalpha(c) ((__ctype+1)[(c)] & (_U|_L)) -#define iscntrl(c) ((__ctype+1)[(c)] & (_C)) -#define isdigit(c) ((__ctype+1)[(c)] & (_D)) -#define isgraph(c) ((__ctype+1)[(c)] & (_P|_U|_L|_D)) -#define islower(c) ((__ctype+1)[(c)] & (_L)) -#define isprint(c) ((__ctype+1)[(c)] & (_P|_U|_L|_D|_SP)) -#define ispunct(c) ((__ctype+1)[(c)] & (_P)) -#define isspace(c) ((__ctype+1)[(c)] & (_S)) -#define isupper(c) ((__ctype+1)[(c)] & (_U)) -#define isxdigit(c) ((__ctype+1)[(c)] & (_D|_X)) +#define isalnum(c) ((__ctype+1)[c] & (_U|_L|_D)) +#define isalpha(c) ((__ctype+1)[c] & (_U|_L)) +#define iscntrl(c) ((__ctype+1)[c] & (_C)) +#define isdigit(c) ((__ctype+1)[c] & (_D)) +#define isgraph(c) ((__ctype+1)[c] & (_P|_U|_L|_D)) +#define islower(c) ((__ctype+1)[c] & (_L)) +#define isprint(c) ((__ctype+1)[c] & (_P|_U|_L|_D|_SP)) +#define ispunct(c) ((__ctype+1)[c] & (_P)) +#define isspace(c) ((__ctype+1)[c] & (_S)) +#define isupper(c) ((__ctype+1)[c] & (_U)) +#define isxdigit(c) ((__ctype+1)[c] & (_D|_X)) #define tolower(c) ((__ctmp=c, isupper(__ctmp) ? __ctmp | 0x20 : __ctmp)) #define toupper(c) ((__ctmp=c, islower(__ctmp) ? __ctmp & ~0x20 : __ctmp))