mirror of
https://github.com/mirror/wget.git
synced 2024-12-28 22:00:27 +08:00
* src/hash.c: Explicitly convert float to int
This commit is contained in:
parent
9947663af8
commit
3186eb2976
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user