@@ -159,7 +159,7 @@ int strs_add(struct strs *strs, char *s)
{
if (strs->num + 1 > strs->size) {
char **new;
- unsigned i = strs->size;
+ size_t i = strs->size;
strs->size *= 2;
new = reallocarray(strs->list, strs->size, sizeof(char *));
if (!new) {
@@ -212,11 +212,11 @@ char *strs_remove_last(struct strs *strs)
return strs->list[strs->num];
}
-int strs_add_at_index(struct strs *strs, char *s, unsigned index)
+int strs_add_at_index(struct strs *strs, char *s, size_t index)
{
if (index >= strs->size) {
char **new;
- unsigned i = strs->size;
+ size_t i = strs->size;
while (index >= strs->size) {
strs->size *= 2;
}
@@ -237,7 +237,7 @@ int strs_add_at_index(struct strs *strs, char *s, unsigned index)
return 0;
}
-char *strs_read_at_index(struct strs *strs, unsigned index)
+char *strs_read_at_index(struct strs *strs, size_t index)
{
if (index >= strs->num) {
return NULL;
@@ -99,8 +99,8 @@ int strs_add(struct strs *strs, char *s);
__attribute__ ((format(printf, 2, 4)))
int strs_create_and_add(struct strs *strs, const char *fmt, int num, ...);
char *strs_remove_last(struct strs *strs);
-int strs_add_at_index(struct strs *strs, char *s, unsigned index);
-char *strs_read_at_index(struct strs *strs, unsigned index);
+int strs_add_at_index(struct strs *strs, char *s, size_t index);
+char *strs_read_at_index(struct strs *strs, size_t index);
void strs_sort(struct strs *strs);
unsigned strs_num_items(struct strs *strs);
size_t strs_len_items(struct strs *strs);
Use size_t, as the strs struct uses it for its size member. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- libsepol/src/kernel_to_common.c | 8 ++++---- libsepol/src/kernel_to_common.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)