Skip to content

Commit

Permalink
hash_offt, rename internal macro for unity builds
Browse files Browse the repository at this point in the history
  • Loading branch information
icing committed Apr 4, 2024
1 parent ee9a3df commit 90ffabf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/hash_offt.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ mk_hash_entry(curl_off_t id, const void *elem)
return he;
}

#define FETCH_LIST(x,y) &(x)->table[offt_hash(y, (x)->bits)]
#define CURL_HASH_OFFT_LIST(x,y) &(x)->table[offt_hash(y, (x)->bits)]

void *Curl_hash_offt_set(struct Curl_hash_offt *h, curl_off_t id, void *elem)
{
Expand All @@ -103,7 +103,7 @@ void *Curl_hash_offt_set(struct Curl_hash_offt *h, curl_off_t id, void *elem)
Curl_llist_init(&h->table[i], offt_hash_entry_dtor);
}

l = FETCH_LIST(h, id);
l = CURL_HASH_OFFT_LIST(h, id);

for(le = l->head; le; le = le->next) {
he = (struct Curl_hash_offt_entry *) le->ptr;
Expand Down Expand Up @@ -132,7 +132,7 @@ int Curl_hash_offt_remove(struct Curl_hash_offt *h, curl_off_t id)
DEBUGASSERT(h);
DEBUGASSERT(h->slots);
if(h->table) {
l = FETCH_LIST(h, id);
l = CURL_HASH_OFFT_LIST(h, id);

for(le = l->head; le; le = le->next) {
struct Curl_hash_offt_entry *he = le->ptr;
Expand All @@ -154,7 +154,7 @@ void *Curl_hash_offt_get(struct Curl_hash_offt *h, curl_off_t id)
DEBUGASSERT(h);
if(h->table) {
DEBUGASSERT(h->slots);
l = FETCH_LIST(h, id);
l = CURL_HASH_OFFT_LIST(h, id);
for(le = l->head; le; le = le->next) {
struct Curl_hash_offt_entry *he = le->ptr;
if(id == he->id) {
Expand Down

0 comments on commit 90ffabf

Please sign in to comment.