Removing CMC_FOR_EACH and CMC_FOR_EACH_REV and small fix to multiset

This commit is contained in:
Leonardo committed 2020-03-02 22:50:07 -03:00
1 parent f020df12f6
commit ecc0b51e4b
2 files changed
+2 -22

No files matched your search

+2 -2
View File
@@ -772,8 +772,8 @@ struct cmc_callbacks_multiset
struct SNAME *PFX##_copy_of(struct SNAME *_set_) \
{ \
struct SNAME *result = \
PFX##_new_custom(_set_->capacity, _set_->load, _set_->f_val, \
_set_->alloc, _set_->callbacks); \
PFX##_new_custom(_set_->capacity * _set_->load, _set_->load, \
_set_->f_val, _set_->alloc, _set_->callbacks); \
\
if (!result) \
return NULL; \
-20
View File
@@ -11,26 +11,6 @@
#ifndef CMC_FOR_EACH_H
#define CMC_FOR_EACH_H
#define CMC_FOR_EACH(PFX, SNAME, TARGET, BODY) \
do \
{ \
for (struct SNAME##_iter iter = (TARGET)->it_start(TARGET); \
!PFX##_iter_end(&iter); PFX##_iter_next(&iter)) \
{ \
BODY; \
} \
} while (0)
#define CMC_FOR_EACH_REV(PFX, SNAME, TARGET, BODY) \
do \
{ \
for (struct SNAME##_iter iter = (TARGET)->it_end(TARGET); \
!PFX##_iter_start(&iter); PFX##_iter_prev(&iter)) \
{ \
BODY; \
} \
} while (0)
#define CMC_FOREACH(PFX, SNAME, ITERNAME, TARGET) \
for (struct SNAME##_iter ITERNAME = (TARGET)->it_start(TARGET); \
!PFX##_iter_end(&ITERNAME); PFX##_iter_next(&ITERNAME))