From 9ecfdf63340c167a243cd479534110b34737e80b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 17 Jul 2015 16:54:01 -0400 Subject: cosmetics --- lisc/lisc.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'lisc/lisc.h') diff --git a/lisc/lisc.h b/lisc/lisc.h index 0ed9411..fde55c4 100644 --- a/lisc/lisc.h +++ b/lisc/lisc.h @@ -1,10 +1,10 @@ #include +#include #include #include #include typedef unsigned int uint; -typedef unsigned short ushort; typedef unsigned char uchar; typedef unsigned long long ullong; @@ -39,27 +39,29 @@ struct Bits { #define BCLR(b, n) ((b).t[n/NBit] &= ~((ullong)1<<(n%NBit))) struct Ref { - ushort type:1; - ushort val:15; + uint16_t type:1; + uint16_t val:15; }; -#define R (Ref){0, 0} // Invalid reference - -static inline int -req(Ref a, Ref b) -{ - return a.type == b.type && a.val == b.val; -} - enum { RSym = 0, RConst = 1, NRef = (1<<15) - 1 }; +#define R (Ref){0, 0} #define SYM(x) (Ref){RSym, x} #define CONST(x) (Ref){RConst, x} +static inline int req(Ref a, Ref b) +{ + return a.type == b.type && a.val == b.val; +} +static inline int rtype(Ref r) +{ + return req(r, R) ? -1 : r.type; +} + enum { OXXX = 0, OAdd, -- cgit 1.4.1