summary refs log tree commit diff
path: root/layout.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--layout.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/layout.h b/layout.h
index a9b3917..cbff6df 100644
--- a/layout.h
+++ b/layout.h
@@ -38,6 +38,10 @@ struct List {
 	struct Item items[LAYOUT_CAP];
 };
 
+static inline void listClear(struct List *list) {
+	list->len = 0;
+}
+
 static inline void
 listPush(struct List *list, const struct SDL_Rect *rect, Card card) {
 	assert(list->len < LAYOUT_CAP);
@@ -61,8 +65,8 @@ struct Layout {
 };
 
 static inline void layoutClear(struct Layout *layout) {
-	layout->main.len = 0;
-	layout->drag.len = 0;
+	listClear(&layout->main);
+	listClear(&layout->drag);
 }
 
 struct Style {