Mercurial > hg > early-roguelike
diff srogue/list.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:28:34 -0500 |
parents | 94a0d9dd5ce1 |
children | 0250220d8cdd |
line wrap: on
line diff
--- a/srogue/list.c Fri Feb 26 17:30:30 2016 -0500 +++ b/srogue/list.c Wed Mar 02 21:28:34 2016 -0500 @@ -23,8 +23,8 @@ * Takes an item out of whatever linked list it might be in */ -_detach(list, item) -struct linked_list **list, *item; +void +_detach(struct linked_list **list, struct linked_list *item) { if (*list == item) *list = next(item); @@ -39,8 +39,8 @@ /* * _attach: add an item to the head of a list */ -_attach(list, item) -struct linked_list **list, *item; +void +_attach(struct linked_list **list, struct linked_list *item) { if (*list != NULL) { item->l_next = *list; @@ -57,8 +57,8 @@ /* * _free_list: Throw the whole blamed thing away */ -_free_list(ptr) -struct linked_list **ptr; +void +_free_list(struct linked_list **ptr) { register struct linked_list *item; @@ -72,8 +72,8 @@ /* * discard: free up an item */ -discard(item) -struct linked_list *item; +void +discard(struct linked_list *item) { total -= 2; FREE(item->l_data); @@ -84,8 +84,7 @@ * new_item: get a new item with a specified size */ struct linked_list * -new_item(size) -int size; +new_item(int size) { register struct linked_list *item; @@ -96,8 +95,7 @@ } char * -new(size) -int size; +new(int size) { register char *space = ALLOC(size);