Remove rz_list_iter_next() (#5809)

This commit is contained in:
Khairul Azhar Kasmiran 2026-01-17 17:14:24 +08:00 committed by GitHub
parent 8494ae3c47
commit 2fe648f541
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

View file

@ -88,7 +88,7 @@ static ut64 pdb_omap_remap(RZ_NONNULL RzPdbOmapStream *omap_stream, ut64 address
return -1;
}
it = rz_list_iterator(omap_stream->entries);
while (rz_list_iter_next(it)) {
while (it) {
omap_entry = (OmapEntry *)rz_list_iter_get(it);
omap_stream->froms[i] = omap_entry->from;
i++;

View file

@ -60,7 +60,6 @@ typedef int (*RzListComparator)(const void *value, const void *list_data, void *
#define rz_list_iter_get(x) \
x->val; \
x = x->next
#define rz_list_iter_next(x) (x ? 1 : 0)
#define rz_list_iter_has_next(x) (x->next)
#define rz_list_iter_has_prev(x) (x->prev)

View file

@ -14,7 +14,7 @@ static void topo_sorting(RzGraphNode *n, RzGraphVisitor *vis) {
RzListIter *ita = rz_list_iterator(act); \
RzListIter *ite = rz_list_iterator(exp); \
int diff = 0; \
while (rz_list_iter_next(ita) && rz_list_iter_next(ite)) { \
while (ita && ite) { \
int a = (int)(size_t)rz_list_iter_get(ita); \
int e = (int)(size_t)rz_list_iter_get(ite); \
if (a != e) { \
@ -151,4 +151,4 @@ static int all_tests() {
return tests_passed != tests_run;
}
mu_main(all_tests)
mu_main(all_tests)

View file

@ -18,7 +18,7 @@ void add_to_list(RTreeNode *n, RTreeVisitor *vis) {
do { \
RzListIter *ita = rz_list_iterator(act); \
RzListIter *ite = rz_list_iterator(exp); \
while (rz_list_iter_next(ita) && rz_list_iter_next(ite)) { \
while (ita && ite) { \
int a = (int)(intptr_t)rz_list_iter_get(ita); \
int e = (int)(intptr_t)rz_list_iter_get(ite); \
mu_assert_eq(a, e, descr); \
@ -30,7 +30,7 @@ void add_to_list(RTreeNode *n, RTreeVisitor *vis) {
do { \
RzListIter *ita = rz_list_iterator(act); \
RzListIter *ite = rz_list_iterator(exp); \
while (rz_list_iter_next(ita) && rz_list_iter_next(ite)) { \
while (ita && ite) { \
char *a = rz_list_iter_get(ita); \
char *e = rz_list_iter_get(ite); \
mu_assert_streq(a, e, descr); \
@ -120,4 +120,4 @@ int all_tests() {
return tests_passed != tests_run;
}
mu_main(all_tests)
mu_main(all_tests)