cleanup: Adapt loop counter to proper type

Fixing a couple of -Wsign-compare warnings.
This commit is contained in:
Michael Vetter
2026-02-19 12:23:40 +01:00
parent 3e0c9e79e4
commit 6e61383e97
12 changed files with 33 additions and 33 deletions

View File

@@ -175,7 +175,7 @@ autocomplete_add(Autocomplete ac, const char* item)
void
autocomplete_add_all(Autocomplete ac, char** items)
{
for (int i = 0; i < g_strv_length(items); i++) {
for (guint i = 0; i < g_strv_length(items); i++) {
autocomplete_add(ac, items[i]);
}
}
@@ -205,7 +205,7 @@ autocomplete_remove(Autocomplete ac, const char* const item)
void
autocomplete_remove_all(Autocomplete ac, char** items)
{
for (int i = 0; i < g_strv_length(items); i++) {
for (guint i = 0; i < g_strv_length(items); i++) {
autocomplete_remove(ac, items[i]);
}
}

View File

@@ -328,7 +328,7 @@ GHashTable*
parse_options(gchar** args, gchar** opt_keys, gboolean* res)
{
GList* keys = NULL;
for (int i = 0; i < g_strv_length(opt_keys); i++) {
for (guint i = 0; i < g_strv_length(opt_keys); i++) {
keys = g_list_append(keys, opt_keys[i]);
}
@@ -344,7 +344,7 @@ parse_options(gchar** args, gchar** opt_keys, gboolean* res)
// validate options
GList* found_keys = NULL;
for (int curr = 0; curr < g_strv_length(args); curr += 2) {
for (guint curr = 0; curr < g_strv_length(args); curr += 2) {
// check if option valid
if (g_list_find_custom(keys, args[curr], (GCompareFunc)g_strcmp0) == NULL) {
*res = FALSE;
@@ -377,7 +377,7 @@ parse_options(gchar** args, gchar** opt_keys, gboolean* res)
// create map
options = g_hash_table_new(g_str_hash, g_str_equal);
*res = TRUE;
for (int curr = 0; curr < g_strv_length(args); curr += 2) {
for (guint curr = 0; curr < g_strv_length(args); curr += 2) {
g_hash_table_insert(options, args[curr], args[curr + 1]);
}