aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-06-16 19:28:28 +0800
committerMistivia <i@mistivia.com>2025-06-16 19:28:28 +0800
commite3bc104f9b3df0649d2a5b1ac9b110b3729ffdbf (patch)
tree76f4344a890fc4c872ac1ab92688072ffb66dfee /src
parentd614ec90581e504b9888d2ed66c20a8a86fbc8b2 (diff)
add list test
Diffstat (limited to 'src')
-rw-r--r--src/list.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/list.h b/src/list.h
index e20771f..a2453b6 100644
--- a/src/list.h
+++ b/src/list.h
@@ -45,7 +45,7 @@ LIST_DEF(Int);
self->vhead->next = self->vtail; \
self->vhead->prev = NULL; \
self->vtail->next = NULL; \
- self->vhead->prev = self->vhead; \
+ self->vtail->prev = self->vhead; \
self->len = 0; \
} \
void T##List_free(T##List *self) { \
@@ -118,10 +118,10 @@ LIST_DEF(Int);
return self->len; \
} \
T##ListIter T##List_push_back(T##List *self, T val) { \
- T##List_insert_before(self, self->vtail, val); \
+ return T##List_insert_before(self, self->vtail, val); \
} \
T##ListIter T##List_push_front(T##List *self, T val) { \
- T##List_insert_after(self, self->vhead, val); \
+ return T##List_insert_after(self, self->vhead, val); \
} \
void T##List_pop_back(T##List *self) { \
T##List_remove(self, self->vtail->prev); \