* src/hash.c: Explicitly convert float to int

This commit is contained in:
Tim Rühsen 2017-02-03 12:03:50 +01:00
parent 9947663af8
commit 3186eb2976

View File

@ -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));