Need to parenthesize "n" in SPECIAL_VALUE macro for precedence.

This was causing the type tags to overlap with fixnums.
This commit is contained in:
Jesse D. McDonald 2009-11-09 09:49:09 -06:00
parent 26819cafdc
commit dc35896174
1 changed files with 2 additions and 2 deletions

4
gc.h
View File

@ -25,13 +25,13 @@ typedef intptr_t fixnum_t;
/* Special values (0 <= n < 1024) */ /* Special values (0 <= n < 1024) */
/* These correspond to objects within the first page of memory */ /* These correspond to objects within the first page of memory */
#define SPECIAL_VALUE(n) ((value_t)(4*n+2)) #define SPECIAL_VALUE(n) ((value_t)(4*(n)+2))
#define TYPE_TAG(n) SPECIAL_VALUE(768+(n))
#define MAX_SPECIAL SPECIAL_VALUE(1023) #define MAX_SPECIAL SPECIAL_VALUE(1023)
#define BROKEN_HEART SPECIAL_VALUE(0) #define BROKEN_HEART SPECIAL_VALUE(0)
#define FALSE_VALUE SPECIAL_VALUE(1) #define FALSE_VALUE SPECIAL_VALUE(1)
#define TRUE_VALUE SPECIAL_VALUE(2) #define TRUE_VALUE SPECIAL_VALUE(2)
#define TYPE_TAG(n) SPECIAL_VALUE(2+(n))
#define TYPE_TAG_BOX TYPE_TAG(0) #define TYPE_TAG_BOX TYPE_TAG(0)
#define TYPE_TAG_VECTOR TYPE_TAG(1) #define TYPE_TAG_VECTOR TYPE_TAG(1)