Uses the new tommy_arrayof type.

This commit is contained in:
Andrea Mazzoleni 2013-06-23 21:49:36 +02:00
parent 1285298300
commit ef53cd4086
8 changed files with 226 additions and 13 deletions

View file

@ -114,9 +114,9 @@ tommy_inline void** tommy_array_ref(tommy_array* array, unsigned pos)
* You must be sure that space for this position is already
* allocated calling tommy_array_grow().
*/
tommy_inline void tommy_array_set(tommy_array* array, unsigned pos, void* node)
tommy_inline void tommy_array_set(tommy_array* array, unsigned pos, void* element)
{
*tommy_array_ref(array, pos) = node;
*tommy_array_ref(array, pos) = element;
}
/**
@ -132,13 +132,13 @@ tommy_inline void* tommy_array_get(tommy_array* array, unsigned pos)
/**
* Grows and inserts a new element at the end of the array.
*/
tommy_inline void tommy_array_insert(tommy_array* array, void* node)
tommy_inline void tommy_array_insert(tommy_array* array, void* element)
{
unsigned pos = array->size;
tommy_array_grow(array, pos + 1);
tommy_array_set(array, pos, node);
tommy_array_set(array, pos, element);
}
/**