summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-10-02 12:48:32 +0200
committerTyge Løvset <[email protected]>2021-10-02 12:48:32 +0200
commitce9ef95a3beb195b5f29fde80a3d7b0f57f84c22 (patch)
treeeb17f3857977ed843d6fefb6c6b711b356ca79be /include
parentc952b72df544e5d4cb555140f4d0c3f251444b45 (diff)
downloadSTC-modified-ce9ef95a3beb195b5f29fde80a3d7b0f57f84c22.tar.gz
STC-modified-ce9ef95a3beb195b5f29fde80a3d7b0f57f84c22.zip
Moved ref member in clist_X_iter_t to start of struct;
Diffstat (limited to 'include')
-rw-r--r--include/stc/clist.h6
-rw-r--r--include/stc/forward.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h
index 7678b540..071cd8cb 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -135,13 +135,13 @@ cx_memb(_copy)(Self *self, Self other) {
STC_INLINE cx_iter_t
cx_memb(_iter)(const Self* self, cx_node_t* prev) {
- return c_make(cx_iter_t){&self->last, prev, &prev->next->value};
+ return c_make(cx_iter_t){&prev->next->value, &self->last, prev};
}
STC_INLINE cx_iter_t
cx_memb(_begin)(const Self* self) {
cx_value_t* head = self->last ? &self->last->next->value : NULL;
- return c_make(cx_iter_t){&self->last, self->last, head};
+ return c_make(cx_iter_t){head, &self->last, self->last};
}
STC_INLINE cx_iter_t
@@ -290,7 +290,7 @@ cx_memb(_split_off)(Self* self, cx_iter_t it1, cx_iter_t it2) {
Self cx = {NULL};
if (it1.ref == it2.ref) return cx;
cx_node_t *p1 = it1.prev,
- *p2 = it2.ref ? it2.prev : self->last;
+ *p2 = it2.ref ? it2.prev : self->last;
p1->next = p2->next, p2->next = clist_node_(it1.ref);
if (self->last == p2) self->last = (p1 == p2) ? NULL : p1;
cx.last = p2;
diff --git a/include/stc/forward.h b/include/stc/forward.h
index 2d22b9ca..ec5f77b9 100644
--- a/include/stc/forward.h
+++ b/include/stc/forward.h
@@ -65,8 +65,8 @@
typedef struct SELF##_node_t SELF##_node_t; \
\
typedef struct { \
- SELF##_node_t *const *_last, *prev; \
SELF##_value_t *ref; \
+ SELF##_node_t *const *_last, *prev; \
} SELF##_iter_t; \
\
typedef struct { \