diff options
author | ragge <ragge> | 2007-10-18 20:41:41 +0000 |
---|---|---|
committer | ragge <ragge> | 2007-10-18 20:41:41 +0000 |
commit | 1fe448760d95b13aabd5f78001afcfa52872662e (patch) | |
tree | 5ad382a22cc2990cc743356785bb5e9979b549f9 /cpp.h | |
parent | 5423d472aaa22fd5bf8b9c342a99a1ea8198ac15 (diff) |
More fixes to cpp arithmetic, sanitychecked by otto and stefan.
Diffstat (limited to 'cpp.h')
-rw-r--r-- | cpp.h | 31 |
1 files changed, 10 insertions, 21 deletions
@@ -90,33 +90,22 @@ struct initar { char *str; }; -struct val { +/* + * Struct used in parse tree evaluation. + * op is one of: + * - number type (NUMBER, UNUMBER) + * - zero (0) if divided by zero. + */ +struct nd { + int op; union { long long val; unsigned long long uval; - } v; - int type; -}; - -struct nd { - union { - struct { - struct nd *left; - struct nd *right; - } t; - struct val v; } n; - int op; }; -#define nd_left n.t.left -#define nd_right n.t.right -#define nd_val n.v.v.val -#define nd_uval n.v.v.uval -#define nd_type n.v.type - -struct nd *mknode(int, struct nd *, struct nd *); -struct nd *mknum(struct val); +#define nd_val n.val +#define nd_uval n.uval struct recur; /* not used outside cpp.c */ int subst(struct symtab *, struct recur *); |