Tidy-up codestyle

This commit is contained in:
George Oikonomou 2017-12-16 01:14:54 +00:00
parent b6aac6b008
commit fe2c960756

View File

@ -52,7 +52,6 @@
struct list { struct list {
struct list *next; struct list *next;
}; };
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**
* Initialize a list. * Initialize a list.
@ -164,8 +163,6 @@ list_add(list_t list, void *item)
void void
list_push(list_t list, void *item) list_push(list_t list, void *item)
{ {
/* struct list *l;*/
/* Make sure not to add the same element twice */ /* Make sure not to add the same element twice */
list_remove(list, item); list_remove(list, item);
@ -249,11 +246,11 @@ list_remove(list_t list, void *item)
for(l = *list; l != NULL; l = l->next) { for(l = *list; l != NULL; l = l->next) {
if(l == item) { if(l == item) {
if(r == NULL) { if(r == NULL) {
/* First on list */ /* First on list */
*list = l->next; *list = l->next;
} else { } else {
/* Not first on list */ /* Not first on list */
r->next = l->next; r->next = l->next;
} }
l->next = NULL; l->next = NULL;
return; return;
@ -324,7 +321,7 @@ list_insert(list_t list, void *previtem, void *newitem)
void * void *
list_item_next(void *item) list_item_next(void *item)
{ {
return item == NULL? NULL: ((struct list *)item)->next; return item == NULL ? NULL : ((struct list *)item)->next;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** @} */ /** @} */