From 3186eb297661399d641a3b718e178394dd86ff78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Fri, 3 Feb 2017 12:03:50 +0100 Subject: [PATCH] * src/hash.c: Explicitly convert float to int --- src/hash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hash.c b/src/hash.c index 4116ca0b..bc74c522 100644 --- a/src/hash.c +++ b/src/hash.c @@ -283,10 +283,10 @@ hash_table_new (int items, /* Calculate the size that ensures that the table will store at least ITEMS keys without the need to resize. */ - size = 1 + items / HASH_MAX_FULLNESS; + size = (int) (1 + items / HASH_MAX_FULLNESS); size = prime_size (size, &ht->prime_offset); ht->size = size; - ht->resize_threshold = size * HASH_MAX_FULLNESS; + ht->resize_threshold = (int) (size * HASH_MAX_FULLNESS); /*assert (ht->resize_threshold >= items);*/ ht->cells = xnew_array (struct cell, ht->size); @@ -394,7 +394,7 @@ grow_hash_table (struct hash_table *ht) #endif ht->size = newsize; - ht->resize_threshold = newsize * HASH_MAX_FULLNESS; + ht->resize_threshold = (int) (newsize * HASH_MAX_FULLNESS); cells = xnew_array (struct cell, newsize); memset (cells, INVALID_PTR_CHAR, newsize * sizeof (struct cell));