From 0eb8c7dcf744f9d4b711dcb7319d01efab1249d4 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 4 Apr 2019 01:26:45 -0400 Subject: Add listClear --- layout.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'layout.h') 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 { -- cgit 1.4.1