Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!1918
This commit is contained in:
Philip Withnall 2021-02-09 10:45:51 +00:00
commit 652026b9d1
4 changed files with 9 additions and 8 deletions

View File

@ -170,14 +170,14 @@ read_link (const gchar *full_name)
{
#if defined (HAVE_READLINK)
gchar *buffer;
guint size;
gsize size;
size = 256;
buffer = g_malloc (size);
while (1)
{
int read_size;
gssize read_size;
read_size = readlink (full_name, buffer, size);
if (read_size < 0)
@ -185,7 +185,7 @@ read_link (const gchar *full_name)
g_free (buffer);
return NULL;
}
if (read_size < size)
if ((gsize) read_size < size)
{
buffer[read_size] = 0;
return buffer;
@ -929,7 +929,7 @@ get_access_rights (GFileAttributeMatcher *attribute_matcher,
uid_t uid = geteuid ();
if (uid == _g_stat_uid (statbuf) ||
uid == parent_info->owner ||
uid == (uid_t) parent_info->owner ||
uid == 0)
writable = TRUE;
}

View File

@ -46,6 +46,7 @@ typedef struct
gboolean writable;
gboolean is_sticky;
gboolean has_trash_dir;
/* owner should be uid_t but it breaks compliance with MS-Windows */
int owner;
dev_t device;
ino_t inode;

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);
@ -480,7 +480,7 @@ g_menu_remove (GMenu *menu,
gint position)
{
g_return_if_fail (G_IS_MENU (menu));
g_return_if_fail (0 <= position && position < menu->items->len);
g_return_if_fail (0 <= position && (guint) position < menu->items->len);
g_menu_clear_item (&g_array_index (menu->items, struct item, position));
g_array_remove_index (menu->items, position);

View File

@ -683,8 +683,8 @@ parse_into_text_tables (const gchar *directory,
GHashTable *summaries,
GHashTable *descriptions)
{
GMarkupParser parser = { start_element, end_element, text };
TextTableParseInfo info = { summaries, descriptions };
GMarkupParser parser = { start_element, end_element, text, NULL, NULL };
TextTableParseInfo info = { summaries, descriptions, NULL, NULL, NULL, NULL };
const gchar *basename;
GDir *dir;