From 784c42d85040761d21c5d27030ab6d35df0d650e Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 19 Jul 2020 00:55:35 +0200 Subject: [PATCH] Update _insert functions to update iterators as per new specification. --- m-array.h | 1 + m-i-list.h | 1 + m-list.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/m-array.h b/m-array.h index d8456c6b..2ea78670 100644 --- a/m-array.h +++ b/m-array.h @@ -755,6 +755,7 @@ { \ assert (it != NULL && a == it->array); \ M_C(name, _push_at)(a, it->index + 1, x); \ + it->index ++; \ } \ , /* End of INIT_SET */ ) \ \ diff --git a/m-i-list.h b/m-i-list.h index cd7f60db..5c6c756d 100644 --- a/m-i-list.h +++ b/m-i-list.h @@ -481,6 +481,7 @@ typedef struct ilist_head_s { M_CALL_INIT_SET(oplist, *p, x); \ type *obj = M_C(name, _ref)(it); \ M_C(name, _push_after)(obj, p); \ + it->current = p; \ (void) list; \ ILISTI_CONTRACT(name, list); \ } \ diff --git a/m-list.h b/m-list.h index c4dd9745..e3cbeb29 100644 --- a/m-list.h +++ b/m-list.h @@ -472,6 +472,8 @@ next->next = current->next; \ current->next = next; \ } \ + /* Update insertion_point to this element */ \ + insertion_point->current = next; \ LISTI_CONTRACT(list); \ } \ \