Switch vector to use size_t for its array sizes and indices.

This commit is contained in:
2017-07-20 21:34:33 -07:00
parent c97538265d
commit 1b57ebb027
2 changed files with 9 additions and 9 deletions

View File

@@ -18,11 +18,11 @@ struct vec_s {
/**
* The maximum size of the vector.
*/
int capacity;
size_t capacity;
/**
* The current number of items in the vector.
*/
int size;
size_t size;
};
typedef struct vec_s vec;
@@ -87,7 +87,7 @@ int vec_foreach(vec* vec, void* data, compare_func compare, foreach_func foreach
* @param index the index to retreive a value from
* @return pointer to the value, or, if the index is out of bounds (or there is nothing there) NULL.
*/
void* vec_index(vec* vec, int index);
void* vec_index(vec* vec, size_t index);
/**
* Clears the vector, removing all elements from it
* but not resizing it down.