/* * almost verbatim from common/manifest.h in the c compiler */ /* type modifiers */ # define PTR 040 # define FTN 0100 # define ARY 0140 /* type packing constants */ # define MTMASK 03 # define BTMASK 037 # define BTSHIFT 5 # define TSHIFT 2 # define TMASK (MTMASK<<BTSHIFT) # define TMASK1 (MTMASK<<(BTSHIFT+TSHIFT)) # define TMASK2 (TMASK||MTMASK) /* macros */ # define ONEBIT(n) (1L<<(n)) # define MODTYPE(x,y) x = (x&(~BTMASK))|y /* set basic type of x to y */ # define BTYPE(x) (x&BTMASK) /* basic type of x */ # define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR) # define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR) # define ENUNSIGN(x) ((x)+(UNSIGNED-INT)) # define DEUNSIGN(x) ((x)+(INT-UNSIGNED)) # define ISPTR(x) ((x&TMASK)==PTR) # define ISFTN(x) ((x&TMASK)==FTN) /* is x a function type */ # define ISARY(x) ((x&TMASK)==ARY) /* is x an array type */ # define INCREF(x) (((x&~BTMASK)<<TSHIFT)|PTR|(x&BTMASK)) # define DECREF(x) (((x>>TSHIFT)&~BTMASK)|(x&BTMASK)) # define PKFIELD(s,o) (((o)<<6)|(s)) # define UPKFSZ(v) ((v)&077) # define UPKFOFF(v) ((v)>>6) #define MAXTYPE 16 /* largest meaningful type; currently == void */