From 80ff7b315a6b5a9f9c62de5c6b03f52ddf099837 Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 6 Dec 2018 05:24:30 +0300 Subject: Add simple documentation in comments, refactor. Change all `unsigned int` and `unsigned long` types to `size_t`. Fix names alignment in headers. Add documentation and simple description: Painter - painter.h Main - tetris.c Unicode - unicode.h IDList - idlist.h Engine - engine.c Minor changes: tetris.c - fix indentation and code blocks separation with newlines, remove unused includes. idlist.h - fix structure field name alignment. field.h, engine.c - define aliases for ghost and active shapes indexes in the field. engine.c - rename menuTick to snake case, fix curly braces style of functions. Makefile - switch SFML deprecated warnings off. --- include/idlist.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'include/idlist.h') diff --git a/include/idlist.h b/include/idlist.h index 3318be4..c006a32 100644 --- a/include/idlist.h +++ b/include/idlist.h @@ -1,13 +1,22 @@ +/* + * idlist.h + * + * IDList - List datatype implementation. Element can be taken by id only. + * + * IDList is used by the Painter module and loadable texts. + * + * */ + struct idlist { - unsigned long id; - void *obj; - struct idlist *next; - struct idlist *prev; + size_t id; + void *obj; + struct idlist *next; + struct idlist *prev; }; -struct idlist *list_new(); -struct idlist *list_append(struct idlist *list); -struct idlist *list_get(const struct idlist *list, unsigned long id); -void list_rm_node(struct idlist *node); -void list_foreach(struct idlist *list, void (*job)(void *)); -void list_destroy(struct idlist *list); +struct idlist *list_new(); +struct idlist *list_append(struct idlist *list); +struct idlist *list_get(const struct idlist *list, size_t id); +void list_rm_node(struct idlist *node); +void list_foreach(struct idlist *list, void (*job)(void *)); +void list_destroy(struct idlist *list); -- cgit v1.2.3