X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Frasterize;a=blobdiff_plain;f=list.h;h=5adf22874fede7db45e32a99ad7d77a3ef078b1a;hp=5b7980e6a241c98f445ac76b9932ebda4fa80d48;hb=c875478cdd823c7df8fdc859941bd9e5948c9315;hpb=0f2508a4f227523a6b7e54798487af19d06a6ce9 diff --git a/list.h b/list.h index 5b7980e..5adf228 100644 --- a/list.h +++ b/list.h @@ -5,8 +5,8 @@ * mcgarvey@eng.utah.edu */ -#ifndef __LIST_H__ -#define __LIST_H__ +#ifndef _LIST_H_ +#define _LIST_H_ #include "common.h" @@ -28,7 +28,7 @@ typedef struct list list_t; * Add a value to the list. It will become the first item. * This is a O(1) operation. */ -__fast__ +INLINE_MAYBE void list_push2(list_t** l, void* value, void (*destructor)(void*)) { list_t* n = (list_t*)mem_alloc(sizeof(list_t)); @@ -41,17 +41,17 @@ void list_push2(list_t** l, void* value, void (*destructor)(void*)) /* * Add a value to the list with no destructor set. */ -__fast__ +INLINE_MAYBE void list_push(list_t** l, void* value) { - list_push2(l, value, 0); + list_push2(l, value, NULL); } /* * Create a new list with a single value. */ -__fast__ +INLINE_MAYBE list_t* list_new2(void* value, void (*destructor)(void*)) { list_t* l = NULL; @@ -62,7 +62,7 @@ list_t* list_new2(void* value, void (*destructor)(void*)) /* * Create a new list with a single value without a destructor set. */ -__fast__ +INLINE_MAYBE list_t* list_new(void* value) { list_t* l = NULL; @@ -76,7 +76,7 @@ list_t* list_new(void* value) * will be used to destroy the value. * This is a O(1) operation. */ -__fast__ +INLINE_MAYBE void list_pop(list_t** l) { list_t* n = (*l)->link; @@ -93,7 +93,7 @@ void list_pop(list_t** l) * Destroy the list, freeing up all of its memory. * This is a O(n) operation. */ -__fast__ +INLINE_MAYBE void list_destroy(list_t* l) { while (l) { @@ -109,5 +109,5 @@ void list_destroy(list_t* l) void list_reverse(list_t** l); -#endif // __LIST_H__ +#endif // _LIST_H_