diff options
-rw-r--r-- | misc/tsearch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/tsearch.c b/misc/tsearch.c index 852cadf7b9..1787cf4991 100644 --- a/misc/tsearch.c +++ b/misc/tsearch.c @@ -131,15 +131,15 @@ typedef struct node_t uintptr_t right_node; } *node; -#define RED(N) (node)((N)->left_node & ((uintptr_t) 0x1)) +#define RED(N) (unsigned int)((N)->left_node & ((uintptr_t) 0x1)) #define SETRED(N) (N)->left_node |= ((uintptr_t) 0x1) #define SETBLACK(N) (N)->left_node &= ~((uintptr_t) 0x1) -#define SETNODEPTR(NP,P) (*NP) = (node)((((uintptr_t)(*NP)) \ +#define SETNODEPTR(NP,P) (*NP) = (node)((unsigned int)(((uintptr_t)(*NP)) \ & (uintptr_t) 0x1) | (uintptr_t)(P)) #define LEFT(N) (node)((N)->left_node & ~((uintptr_t) 0x1)) #define LEFTPTR(N) (node *)(&(N)->left_node) -#define SETLEFT(N,L) (N)->left_node = (((N)->left_node & (uintptr_t) 0x1) \ - | (uintptr_t)(L)) +#define SETLEFT(N,L) (N)->left_node = ((unsigned int)((N)->left_node \ + & (uintptr_t) 0x1) | (uintptr_t)(L)) #define RIGHT(N) (node)((N)->right_node) #define RIGHTPTR(N) (node *)(&(N)->right_node) #define SETRIGHT(N,R) (N)->right_node = (uintptr_t)(R) |