Skip to content

Commit

Permalink
Merge pull request #85 from bgilbert/uthash
Browse files Browse the repository at this point in the history
Call uthash `HASH_VALUE()` instead of `HASH_FUNCTION()`
  • Loading branch information
jcupitt authored Mar 28, 2024
2 parents 60f291d + bedc718 commit f9abe8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## main

* fix build with uthash \< 2.3.0 [bgilbert]

## 1.1.0, 28/3/24

* deprecate `dcm_init()` [bgilbert]
* improve memory usage [bgilbert]
* fix docs build with LLVM != 14 [bgilbert]
Expand Down
2 changes: 1 addition & 1 deletion src/dicom-dict-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void make_table(const char *name, const void *items, int count,
}
int this_key_len = key_len ? key_len : (int) strlen(KEY(i));
unsigned hash;
HASH_FUNCTION(KEY(i), this_key_len, hash);
HASH_VALUE(KEY(i), this_key_len, hash);
int cell, probe;
for (probe = 0, cell = hash % table_len;
probe < MAX_PROBES && table[cell] != EMPTY;
Expand Down
2 changes: 1 addition & 1 deletion src/dicom-dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define LOOKUP(table, field, hash, key, key_len, out) do { \
unsigned hash_value; \
HASH_FUNCTION(key, key_len, hash_value); \
HASH_VALUE(key, key_len, hash_value); \
for (int probe = 0; true; probe++) { \
int i = hash ## _dict[(hash_value + probe) % hash ## _len]; \
if (i == hash ## _empty || probe == LOOKUP_MAX_PROBES) { \
Expand Down

0 comments on commit f9abe8f

Please sign in to comment.