suppress warnings from xvect.h and xhash.h

This commit is contained in:
Yuichi Nishiwaki 2014-09-26 12:25:53 +09:00
parent d33a98cd41
commit 1be24ae9d4
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ extern "C" {
#define XHASH_RESIZE_RATIO 0.75 #define XHASH_RESIZE_RATIO 0.75
#define XHASH_ALIGNMENT 3 /* quad word alignment */ #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)) #define XHASH_ALIGN(i) ((((i) - 1) & XHASH_MASK) + (1 << XHASH_ALIGNMENT))
typedef struct xh_entry { typedef struct xh_entry {
@ -325,7 +325,7 @@ xh_ptr_hash(const void *key, void *data)
{ {
(void)data; (void)data;
return (size_t)*(const void **)key; return (int)(size_t)*(const void **)key;
} }
static inline int static inline int

View File

@ -45,7 +45,7 @@ xv_init(xvect *x, size_t width)
x->data = NULL; x->data = NULL;
x->width = width; x->width = width;
x->size = 0; x->size = 0;
x->mask = -1; x->mask = (size_t)-1;
x->head = 0; x->head = 0;
x->tail = 0; x->tail = 0;
} }