mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Uses the new tommy_arrayof type.
This commit is contained in:
parent
1285298300
commit
ef53cd4086
8 changed files with 226 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue