summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-07 01:20:10 (GMT)
commit6bcbdfb277bdc81b5ad6996b3fb005382a35c2ee (patch)
treed2c5a170735b75f905cfe0314aec1d6431e6142a /t/helper
parent973d5eea7455e1053842f7474c8ec34755f3525b (diff)
downloadgit-6bcbdfb277bdc81b5ad6996b3fb005382a35c2ee.zip
git-6bcbdfb277bdc81b5ad6996b3fb005382a35c2ee.tar.gz
git-6bcbdfb277bdc81b5ad6996b3fb005382a35c2ee.tar.bz2
hashmap_get_next returns "struct hashmap_entry *"
This is a step towards removing the requirement for hashmap_entry being the first field of a struct. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-hashmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index de2bd08..d85b8dc 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -194,16 +194,18 @@ int cmd__hashmap(int argc, const char **argv)
free(entry);
} else if (!strcmp("get", cmd) && p1) {
+ struct hashmap_entry *e;
/* lookup entry in hashmap */
- entry = hashmap_get_from_hash(&map, hash, p1);
+ e = hashmap_get_from_hash(&map, hash, p1);
/* print result */
- if (!entry)
+ if (!e)
puts("NULL");
- while (entry) {
+ while (e) {
+ entry = container_of(e, struct test_entry, ent);
puts(get_value(entry));
- entry = hashmap_get_next(&map, &entry->ent);
+ e = hashmap_get_next(&map, e);
}
} else if (!strcmp("remove", cmd) && p1) {