diff --git a/src/cmc/multiset.h b/src/cmc/multiset.h index bcdbbbb..0cd77cd 100644 --- a/src/cmc/multiset.h +++ b/src/cmc/multiset.h @@ -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; \ diff --git a/src/utl/foreach.h b/src/utl/foreach.h index 8d57a22..11362cd 100644 --- a/src/utl/foreach.h +++ b/src/utl/foreach.h @@ -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))