rizin
rizin copied to clipboard
Implement one line `foreach` macros for hash tables.
Your checklist for this pull request
- [x] I've read the guidelines for contributing to this repository
- [x] I made sure to follow the project's coding style
- [x] I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
- [x] I've added tests that prove my fix is effective or that my feature works (if possible)
- [ ] I've updated the rizin book with the relevant information (if needed)
Detailed description
Adds one line foreach macros for hash tables and in extend sets.
Additionally:
- Renames the already existing
for eachmechanism toht_foreach_cb(cbforcall back), so they can be distinguished. - it adds a
ht_xx_size()function for simpler access to theht->countmember. - Renames file for hash table unit tests from
test_sdb_hash.ctotest_ht.c. Because it was hard to find before with a search.
Test plan
Tests added.
Closing issues
...
@Rot127 one bindgen linter error:
Mismatched function annotation for rz_set_s_size at <rizin/librz/include/rz_util/rz_set.h:23:13> : RZ_NONNULL (was RZ_NULLABLE at <rizin/librz/util/set.c:75:13>
Please rebase.
Superseded by https://github.com/rizinorg/rizin/pull/4639