diff --git a/include/picrin/xhash.h b/include/picrin/xhash.h index b43884df..1d3596ca 100644 --- a/include/picrin/xhash.h +++ b/include/picrin/xhash.h @@ -21,7 +21,7 @@ extern "C" { #define XHASH_RESIZE_RATIO 0.75 #define XHASH_ALIGNMENT 3 /* quad word alignment */ -#define XHASH_MASK (~((1 << XHASH_ALIGNMENT) - 1)) +#define XHASH_MASK (~(size_t)((1 << XHASH_ALIGNMENT) - 1)) #define XHASH_ALIGN(i) ((((i) - 1) & XHASH_MASK) + (1 << XHASH_ALIGNMENT)) typedef struct xh_entry { @@ -325,7 +325,7 @@ xh_ptr_hash(const void *key, void *data) { (void)data; - return (size_t)*(const void **)key; + return (int)(size_t)*(const void **)key; } static inline int diff --git a/include/picrin/xvect.h b/include/picrin/xvect.h index b98886e9..3701205e 100644 --- a/include/picrin/xvect.h +++ b/include/picrin/xvect.h @@ -45,7 +45,7 @@ xv_init(xvect *x, size_t width) x->data = NULL; x->width = width; x->size = 0; - x->mask = -1; + x->mask = (size_t)-1; x->head = 0; x->tail = 0; }