Removing CMC_FOR_EACH and CMC_FOR_EACH_REV and small fix to multiset
This commit is contained in:
1 parent
f020df12f6
commit
ecc0b51e4b
2 files changed
+2
-22
No files matched your search
+2
-2
@@ -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; \
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user