diff options
author | June McEnroe <june@causal.agency> | 2019-04-04 01:26:45 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-04-04 01:26:45 -0400 |
commit | 0eb8c7dcf744f9d4b711dcb7319d01efab1249d4 (patch) | |
tree | aed4b09b9831054d83938ef505427394beeba217 /layout.h | |
parent | Tweak mouseButtonUp code a bit (diff) | |
download | cards-0eb8c7dcf744f9d4b711dcb7319d01efab1249d4.tar.gz cards-0eb8c7dcf744f9d4b711dcb7319d01efab1249d4.zip |
Add listClear
Diffstat (limited to '')
-rw-r--r-- | layout.h | 8 |
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 { |