Switch vector to use size_t for its array sizes and indices.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user