From d345284faf734d0de219971a7a589f0b8c383b0e Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 22 May 2017 21:20:16 +0200 Subject: [PATCH] Uniformization with list _remove operator. --- m-array.h | 5 +++-- tests/test-marray.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/m-array.h b/m-array.h index 59204da7..8bbe7cf4 100644 --- a/m-array.h +++ b/m-array.h @@ -602,9 +602,10 @@ } \ \ static inline void \ - M_C3(array_,name, _remove)(array_it_t it) \ + M_C3(array_,name, _remove)(array_t a, array_it_t it) \ { \ - M_C3(array_, name, _pop_at)(NULL, it->array, it->index); \ + assert (a == it->array); \ + M_C3(array_, name, _pop_at)(NULL, a, it->index); \ } \ \ M_IF_METHOD(CMP, oplist) \ diff --git a/tests/test-marray.c b/tests/test-marray.c index ba30f19d..13c3e468 100644 --- a/tests/test-marray.c +++ b/tests/test-marray.c @@ -262,7 +262,7 @@ static void test_d(void) } array_it_uint_t it; array_uint_it(it, a1); - array_uint_remove (it); + array_uint_remove (a1, it); assert (array_uint_size(a1) == 299); array_uint_it_last (it, a1);