Skip to content

Friday night special: hash map cleanup

Stefan Beller git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10attr.c: drop hashmap_cmp_fn castattr.c+7 -50 replies
2/10builtin/difftool.c: drop hashmap_cmp_fn castbuiltin/difftool.c+22 -150 replies
3/10builtin/describe: drop hashmap_cmp_fn castbuiltin/describe.c+6 -30 replies
4/10config.c: drop hashmap_cmp_fn castconfig.c+6 -40 replies
5/10convert/sub-process: drop cast to hashmap_cmp_fnconvert.c sub-process.c sub-process.h+8 -60 replies
6/10patch-ids.c: drop hashmap_cmp_fn castpatch-ids.c+9 -50 replies
7/10remote.c: drop hashmap_cmp_fn castremote.c+8 -40 replies
8/10submodule-config.c: drop hashmap_cmp_fn castsubmodule-config.c+12 -60 replies
9/10name-hash.c: drop hashmap_cmp_fn castname-hash.c+13 -90 replies
10/10t/helper/test-hashmap: use custom data instead of duplicate cmp functionst/helper/test-hashmap.c+16 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] Friday night special: hash map cleanup

This goes on top of sb/hashmap-customize-comparison. No functional impact but a pure cleanup series:
No casts to hashmap_cmp_fn in the whole code base any more.

This revealed another interesting thing, which is not a bug per se:
The const correctness of hashmap_cmp_fn as it requires all its void pointers to be const!

We violate this in patch-ids.c as we modify the fndata at some uncritical part (a part that doesn't change the equal-functionality AFAICT).

Thanks,
Stefan

Stefan Beller (10):
attr.c: drop hashmap_cmp_fn cast
builtin/difftool.c: drop hashmap_cmp_fn cast builtin/describe: drop hashmap_cmp_fn cast
config.c: drop hashmap_cmp_fn cast convert/sub-process: drop cast to hashmap_cmp_fn patch-ids.c: drop hashmap_cmp_fn cast
remote.c: drop hashmap_cmp_fn cast submodule-config.c: drop hashmap_cmp_fn cast name-hash.c: drop hashmap_cmp_fn cast t/helper/test-hashmap: use custom data instead of duplicate cmp
functions

 attr.c                  | 12 +++++++-----
 builtin/describe.c      |  9 ++++++---
 builtin/difftool.c      | 37 ++++++++++++++++++++++---------------
 config.c                | 10 ++++++----
 convert.c               |  3 +--
 name-hash.c             | 22 +++++++++++++---------
 patch-ids.c             | 14 +++++++++-----
 remote.c                | 12 ++++++++----
 sub-process.c           |  7 +++++--
 sub-process.h           |  4 ++--
 submodule-config.c      | 18 ++++++++++++------
 t/helper/test-hashmap.c | 34 ++++++++++++++++------------------
 12 files changed, 107 insertions(+), 75 deletions(-)
Signature · 1 line
2.13.0.31.g9b732c453e