summaryrefslogtreecommitdiff
path: root/libmenu/matemenu-tree.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-01 17:18:56 +0100
committerraveit65 <[email protected]>2021-01-28 20:10:03 +0100
commita4e85eb563a536b5b1cf90939b0421b3445add8e (patch)
treed273701596cf509db3d60d7e96c94cf72324396e /libmenu/matemenu-tree.c
parent1c989ea4e5ea375167a7646aaf4e6dbc1cf19446 (diff)
downloadmate-menus-a4e85eb563a536b5b1cf90939b0421b3445add8e.tar.bz2
mate-menus-a4e85eb563a536b5b1cf90939b0421b3445add8e.tar.xz
Remove -Wconversion -Wsign-compare -Wsign-conversion warnings
Diffstat (limited to 'libmenu/matemenu-tree.c')
-rw-r--r--libmenu/matemenu-tree.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/libmenu/matemenu-tree.c b/libmenu/matemenu-tree.c
index eb94ed3..370025b 100644
--- a/libmenu/matemenu-tree.c
+++ b/libmenu/matemenu-tree.c
@@ -112,37 +112,37 @@ struct MateMenuTreeIter
struct MateMenuTreeDirectory
{
- MateMenuTreeItem item;
+ MateMenuTreeItem item;
- DesktopEntry *directory_entry;
- char *name;
+ DesktopEntry *directory_entry;
+ char *name;
- GSList *entries;
- GSList *subdirs;
+ GSList *entries;
+ GSList *subdirs;
- MenuLayoutValues default_layout_values;
- GSList *default_layout_info;
- GSList *layout_info;
- GSList *contents;
+ MenuLayoutValues default_layout_values;
+ GSList *default_layout_info;
+ GSList *layout_info;
+ GSList *contents;
- guint only_unallocated : 1;
- guint is_nodisplay : 1;
- guint layout_pending_separator : 1;
- guint preprocessed : 1;
+ guint only_unallocated : 1;
+ guint is_nodisplay : 1;
+ guint layout_pending_separator : 1;
+ guint preprocessed : 1;
- /* 16 bits should be more than enough; G_MAXUINT16 means no inline header */
- guint will_inline_header : 16;
+ /* 16 bits should be more than enough; G_MAXUINT16 means no inline header */
+ guint will_inline_header : 16;
};
struct MateMenuTreeEntry
{
- MateMenuTreeItem item;
+ MateMenuTreeItem item;
- DesktopEntry *desktop_entry;
- char *desktop_file_id;
+ DesktopEntry *desktop_entry;
+ char *desktop_file_id;
- guint is_excluded : 1;
- guint is_unallocated : 1;
+ guint is_excluded : 1;
+ guint is_unallocated : 1;
};
struct MateMenuTreeSeparator
@@ -886,7 +886,7 @@ find_path (MateMenuTreeDirectory *directory,
slash = strchr (path, G_DIR_SEPARATOR);
if (slash)
{
- name = freeme = g_strndup (path, slash - path);
+ name = freeme = g_strndup (path, (gsize)(slash - path));
path = slash + 1;
}
else
@@ -2540,8 +2540,8 @@ add_menu_for_legacy_dir (MenuLayoutNode *parent,
GString *subdir_path;
GString *subdir_relative;
GSList *tmp;
- int legacy_dir_len;
- int relative_path_len;
+ size_t legacy_dir_len;
+ size_t relative_path_len;
menu = menu_layout_node_new (MENU_LAYOUT_NODE_MENU);
menu_layout_node_append_child (parent, menu);
@@ -3014,7 +3014,7 @@ find_submenu (MenuLayoutNode *layout,
slash = strchr (path, G_DIR_SEPARATOR);
if (slash != NULL)
{
- name = g_strndup (path, slash - path);
+ name = g_strndup (path, (gsize)(slash - path));
next_path = slash + 1;
if (*next_path == '\0')
next_path = NULL;
@@ -3440,7 +3440,7 @@ process_include_rules (MenuLayoutNode *layout,
if (set == NULL)
set = desktop_entry_set_new (); /* create an empty set */
- menu_verbose ("Matched %d entries\n", desktop_entry_set_get_count (set));
+ menu_verbose ("Matched %u entries\n", desktop_entry_set_get_count (set));
return set;
}
@@ -3620,7 +3620,7 @@ process_layout (MateMenuTree *tree,
*/
MenuLayoutNode *rule;
- menu_verbose ("Processing <Include> (%d entries)\n",
+ menu_verbose ("Processing <Include> (%u entries)\n",
desktop_entry_set_get_count (entries));
rule = menu_layout_node_get_children (layout_iter);
@@ -3641,7 +3641,7 @@ process_layout (MateMenuTree *tree,
rule = menu_layout_node_get_next (rule);
}
- menu_verbose ("Processed <Include> (%d entries)\n",
+ menu_verbose ("Processed <Include> (%u entries)\n",
desktop_entry_set_get_count (entries));
}
break;
@@ -3654,7 +3654,7 @@ process_layout (MateMenuTree *tree,
*/
MenuLayoutNode *rule;
- menu_verbose ("Processing <Exclude> (%d entries)\n",
+ menu_verbose ("Processing <Exclude> (%u entries)\n",
desktop_entry_set_get_count (entries));
rule = menu_layout_node_get_children (layout_iter);
@@ -3674,7 +3674,7 @@ process_layout (MateMenuTree *tree,
rule = menu_layout_node_get_next (rule);
}
- menu_verbose ("Processed <Exclude> (%d entries)\n",
+ menu_verbose ("Processed <Exclude> (%u entries)\n",
desktop_entry_set_get_count (entries));
}
break;
@@ -3753,7 +3753,7 @@ process_layout (MateMenuTree *tree,
desktop_entry_set_unref (entry_pool);
- directory->only_unallocated = only_unallocated;
+ directory->only_unallocated = only_unallocated != FALSE;
if (!directory->only_unallocated)
desktop_entry_set_union (allocated, allocated_set);
@@ -4121,7 +4121,7 @@ preprocess_layout_info_subdir_helper (MateMenuTree *tree,
* higher than that (would be crazy), we just consider it's
* unlimited */
if (layout_values->inline_limit < G_MAXUINT16)
- subdir->will_inline_header = layout_values->inline_limit;
+ subdir->will_inline_header = (guint16) layout_values->inline_limit;
else
subdir->will_inline_header = 0;
}