mirror of
https://github.com/curl/curl.git
synced 2026-08-26 13:03:32 +03:00
hash: change 'slots' to size_t from int
- an unsigned type makes more sense - size_t seems suitable - on 64 bit args, the struct alignment makes the new Curl_hash remain the same size Closes #13502
This commit is contained in:
parent
602fc213ae
commit
cc907e80a2
2 changed files with 13 additions and 14 deletions
|
|
@ -54,7 +54,7 @@ struct Curl_hash {
|
|||
/* Comparator function to compare keys */
|
||||
comp_function comp_func;
|
||||
Curl_hash_dtor dtor;
|
||||
int slots;
|
||||
size_t slots;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
|
|
@ -67,12 +67,12 @@ struct Curl_hash_element {
|
|||
|
||||
struct Curl_hash_iterator {
|
||||
struct Curl_hash *hash;
|
||||
int slot_index;
|
||||
size_t slot_index;
|
||||
struct Curl_llist_element *current_element;
|
||||
};
|
||||
|
||||
void Curl_hash_init(struct Curl_hash *h,
|
||||
int slots,
|
||||
size_t slots,
|
||||
hash_function hfunc,
|
||||
comp_function comparator,
|
||||
Curl_hash_dtor dtor);
|
||||
|
|
@ -99,8 +99,7 @@ void Curl_hash_print(struct Curl_hash *h,
|
|||
void (*func)(void *));
|
||||
|
||||
/* Hash for `curl_off_t` as key */
|
||||
void Curl_hash_offt_init(struct Curl_hash *h,
|
||||
unsigned int slots,
|
||||
void Curl_hash_offt_init(struct Curl_hash *h, size_t slots,
|
||||
Curl_hash_dtor dtor);
|
||||
|
||||
void *Curl_hash_offt_set(struct Curl_hash *h, curl_off_t id, void *elem);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue