scc

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

commit 1e257a4aedd7fe98c0f59750b26807da432d326b
parent 6624f3b6cd575a670cf4f424e4e93ae8df8a43df
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 18 Apr 2014 09:47:22 +0200

Change name of ISNODELOG to ISNODECMP

ISNODELOG stand for "is node logical", but it was not a good
mnemonic. ISNODECMP stands for "is node comparision", and it is
a better mnemonic, but is not true, because it is also true for
logical and and logical or. We are going to use ISNODECMP
because is more legible.

Diffstat:
Mcc1.h | 2+-
Mexpr.c | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cc1.h b/cc1.h @@ -221,7 +221,7 @@ extern Node #define TYP(s) ((union unode) {.type = s}) #define ISNODESYM(n) ((n)->code == emitsym) #define ISNODEBIN(n) ((n)->code == emitbin) -#define ISNODELOG(n) (ISNODEBIN(n) && (n)->u.op & 0x40) +#define ISNODECMP(n) (ISNODEBIN(n) && (n)->u.op & 0x40) extern Node *expr(void); extern void extdecl(void), decl(void), compound(void); diff --git a/expr.c b/expr.c @@ -241,7 +241,7 @@ incompatibles: static Node * exp2cond(Node *np, char neg) { - if (ISNODELOG(np)) { + if (ISNODECMP(np)) { np->u.op ^= neg; return np; } @@ -288,7 +288,7 @@ error: static Node * iszero(Node *np) { - if (ISNODELOG(np)) + if (ISNODECMP(np)) return np; return compare(ONE, np, constcode(zero)); } @@ -296,7 +296,7 @@ iszero(Node *np) static Node * eval(Node *np) { - if (!ISNODELOG(np)) + if (!ISNODECMP(np)) return np; return ternarycode(np, constcode(one), constcode(zero)); }