From 1be24ae9d421bd33a01743bea2d28bc45d2bdeaf Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 26 Sep 2014 12:25:53 +0900 Subject: [PATCH] suppress warnings from xvect.h and xhash.h --- include/picrin/xhash.h | 4 ++-- include/picrin/xvect.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; }