From 550ad4e2a3fc8a8fafe7ec454b4a8b05e9c8aece Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 2 Mar 2006 20:54:22 +0000 Subject: [PATCH] * include/object.h: use uintptr_t instead of intptr_t to avoid side effects during divisions. git-svn-id: svn://svn.zoy.org/elk/trunk@258 55e467fa-43c5-0310-a8a2-de718669efc6 --- include/object.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/object.h b/include/object.h index 208e728..388e3d3 100644 --- a/include/object.h +++ b/include/object.h @@ -38,7 +38,7 @@ typedef struct { } Object; #define FIXBITS (8 * (int)sizeof(int)) -#define SIGNBIT ((unsigned)1 << (FIXBITS-1)) +#define SIGNBIT ((unsigned int)1 << (FIXBITS-1)) #define CONSTBIT 1 #define TYPEBITS (8 * (int)sizeof(int) - 1) #define MAX_TYPE ((1 << TYPEBITS) - 1) @@ -51,8 +51,8 @@ typedef struct { #define FIXNUM(x) ((int)(x).data) #define CHAR(x) ((int)(x).data) -#define POINTER(x) ((void *)(intptr_t)(x).data) -#define SETPOINTER(x,p) ((x).data = (intptr_t)(void *)(p)) +#define POINTER(x) ((void *)(uintptr_t)(x).data) +#define SETPOINTER(x,p) ((x).data = (uintptr_t)(void *)(p)) #define SET(x,t,p) ((x).tag = (int)t << 1, (x).data = (p)) #define ISCONST(x) ((x).tag & CONSTBIT) @@ -68,9 +68,9 @@ typedef struct { #ifdef GENERATIONAL_GC typedef int gcspace_t; /* type for space and type arrays */ - typedef intptr_t gcptr_t; /* type for pointers */ - typedef long int pageno_t; /* type for page numbers */ - typedef intptr_t addrarith_t; /* type for address arithmetic */ + typedef uintptr_t gcptr_t; /* type for pointers */ + typedef uintptr_t pageno_t; /* type for page numbers */ + typedef uintptr_t addrarith_t; /* type for address arithmetic */ extern gcspace_t *space; extern gcspace_t current_space;