Switch sparse set to use unsigned size_t.

This commit is contained in:
2017-07-21 17:45:04 -07:00
parent 1d037dd31e
commit 32de4e478f
2 changed files with 8 additions and 8 deletions

View File

@@ -58,7 +58,7 @@ struct sprs_s {
* The dense array.
* This is a pointer so that an array of a certain size can be allocated as needed.
*/
int* dense;
size_t* dense;
/**
* The sparse array.
* This is a pointer so that an array of a certain size can be allocated as needed.
@@ -94,14 +94,14 @@ void sprs_free(sprs* sprs);
* @param index the index at which to store the value
* @param data the value to store.
*/
void sprs_put(sprs* sprs, int index, void* data);
void sprs_put(sprs* sprs, size_t index, void* data);
/**
* Checks if the sparse set contains data under a given index.
* @param sprs the sparse set to check.
* @param index the index for which to check.
* @return 1 if the index exists, 0 if not.
*/
int sprs_contains(sprs* sprs, int index);
int sprs_contains(sprs* sprs, size_t index);
/**
* Gets the value stored under the given sparse set index.
* This will check for whether the index is in the sparse set first,
@@ -113,7 +113,7 @@ int sprs_contains(sprs* sprs, int index);
* @param index the index from under which to retrieve the value.
* @return the value stored under the index, or NULL if there is nothing there.
*/
void* sprs_get(sprs* sprs, int index);
void* sprs_get(sprs* sprs, size_t index);
/**
* Runs through every element in the sparse set, and compares it against the