Fix signedness warning in gio/gmenu.c:g_menu_insert_item()

gio/gmenu.c: In function ‘g_menu_insert_item’:
gio/gmenu.c:165:32: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
  165 |   if (position < 0 || position > menu->items->len)
      |                                ^
This commit is contained in:
Emmanuel Fleury 2020-11-17 21:45:34 +01:00
parent f598a93332
commit 2174bcf000

View File

@ -162,7 +162,7 @@ g_menu_insert_item (GMenu *menu,
g_return_if_fail (G_IS_MENU (menu));
g_return_if_fail (G_IS_MENU_ITEM (item));
if (position < 0 || position > menu->items->len)
if (position < 0 || (guint) position > menu->items->len)
position = menu->items->len;
new_item.attributes = g_hash_table_ref (item->attributes);