From 222e3618eec7bbbd07683213a41718f3859b3516 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 24 Mar 2014 10:49:20 +0900 Subject: [PATCH] use uint**_t for nan-boxing --- include/picrin/value.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/picrin/value.h b/include/picrin/value.h index 628259fc..1317cca5 100644 --- a/include/picrin/value.h +++ b/include/picrin/value.h @@ -50,14 +50,14 @@ typedef struct { pic_sym sym; char c; }; - unsigned int type_; + uint32_t type_; }; } u; } pic_value; -#define pic_ptr(v) ((void *)((long long)0xffffffffffff & (long long)(v).u.data)) -#define pic_vtype(v) (((unsigned)0xfff00000 >= (v).u.type_) ? PIC_VTYPE_FLOAT : (((v).u.type_ & 0xf0000)>>16)) -#define pic_init_value(v,vtype) (((v).u.type_ = ((unsigned int)0xfff00000|(unsigned int)((vtype)<<16))), (v).u.i = 0) +#define pic_ptr(v) ((void *)((uint64_t)0xffffffffffff & (uint64_t)(v).u.data)) +#define pic_vtype(v) (((uint32_t)0xfff00000 >= (v).u.type_) ? PIC_VTYPE_FLOAT : (((v).u.type_ & 0xf0000)>>16)) +#define pic_init_value(v,vtype) (((v).u.type_ = (((uint32_t)0xfff00000)|((uint32_t)((vtype)<<16)))), (v).u.i = 0) #else