From 1a0886d852bb8a0d9428dc6f54c1e503d06073a0 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sun, 28 Jul 2019 21:23:27 +0300 Subject: Refactor idlist, move all global vars to local scope - Replace list_foreach with LIST_FOREACH macro. - Remove `game` global variable and make it local everywhere. - Move global vars `fld`, `nxt` and `texts` into `game` struct. - Add `static` qualifier to engine.c's specific global vars. - Move `sfRenderWindow window` global var to local scope --- src/idlist.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/idlist.c') diff --git a/src/idlist.c b/src/idlist.c index 14db85f..e4e7c91 100644 --- a/src/idlist.c +++ b/src/idlist.c @@ -45,15 +45,6 @@ void list_rm_node(struct idlist *node) } } -void list_foreach(struct idlist *list, void (*job)(void *)) -{ - if (list) { - job(list->obj); - while ((list = list->next)) - job(list->obj); - } -} - void list_destroy(struct idlist *list) { if (list) { -- cgit v1.2.3