diff --git a/flisp.h b/flisp.h index 7eed78d..52ddbf9 100644 --- a/flisp.h +++ b/flisp.h @@ -6,6 +6,7 @@ typedef uptrint_t value_t; typedef int_t fixnum_t; +typedef uint_t ufixnum_t; #ifdef BITS64 #define T_FIXNUM T_INT64 #else @@ -52,7 +53,7 @@ typedef struct { #define tag(x) ((x)&0x7) #define ptr(x) ((void *)((x) & (~(value_t)0x7))) #define tagptr(p, t) (((value_t)(p)) | (t)) -#define fixnum(x) ((value_t)(((fixnum_t)(x)) << 2)) +#define fixnum(x) ((value_t)(((ufixnum_t)(fixnum_t)(x)) << 2)) #define numval(x) (((fixnum_t)(x)) >> 2) #ifdef BITS64 #define fits_fixnum(x) (((x) >> 61) == 0 || (~((x) >> 61)) == 0)