Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!1940
This commit is contained in:
Philip Withnall 2021-02-16 13:11:43 +00:00
commit 4946569730
5 changed files with 14 additions and 11 deletions

View File

@ -47,10 +47,12 @@ static const struct help_topic topics[] = {
N_("[COMMAND]")
},
{ "version", N_("Print version"),
N_("Print version information and exit")
N_("Print version information and exit"),
NULL
},
{ "list-apps", N_("List applications"),
N_("List the installed D-Bus activatable applications (by .desktop files)")
N_("List the installed D-Bus activatable applications (by .desktop files)"),
NULL
},
{ "launch", N_("Launch an application"),
N_("Launch the application (with optional files to open)"),
@ -85,7 +87,7 @@ app_help (gboolean requested,
if (command)
{
gint i;
gsize i;
for (i = 0; i < G_N_ELEMENTS (topics); i++)
if (g_str_equal (topics[i].command, command))
@ -102,8 +104,8 @@ app_help (gboolean requested,
if (topic)
{
gint maxwidth;
gint i;
guint maxwidth;
gsize i;
g_string_append_printf (string, "\n %s %s %s\n\n", "gapplication",
topic->command, topic->synopsis ? _(topic->synopsis) : "");
@ -127,8 +129,8 @@ app_help (gboolean requested,
}
else
{
gint maxwidth;
gint i;
guint maxwidth;
gsize i;
g_string_append_printf (string, "\n %s %s %s\n\n", "gapplication", _("COMMAND"), _("[ARGS…]"));
g_string_append_printf (string, _("Commands:\n"));

View File

@ -896,7 +896,8 @@ g_buffered_input_stream_seek (GSeekable *seekable,
if (type == G_SEEK_CUR)
{
if (offset <= priv->end - priv->pos && offset >= -priv->pos)
if (offset <= (goffset) (priv->end - priv->pos) &&
offset >= (goffset) -priv->pos)
{
priv->pos += offset;
return TRUE;

View File

@ -916,7 +916,7 @@ handle_call (gint *argc,
GPtrArray *in_signature_types;
#ifdef G_OS_UNIX
GUnixFDList *fd_list;
guint fd_id;
gint fd_id;
#endif
gboolean complete_names;
gboolean complete_paths;

View File

@ -482,7 +482,7 @@ unescape_string (const gchar *escaped_string,
}
*out = '\0';
g_warn_if_fail (out - result <= strlen (escaped_string));
g_warn_if_fail ((gsize) (out - result) <= strlen (escaped_string));
return result;
}

View File

@ -789,7 +789,7 @@ g_memory_output_stream_seek (GSeekable *seekable,
* stream is valid (eg: a 1-byte fixed sized stream can have position
* 0 or 1). Therefore '>' is what we want.
* */
if (priv->realloc_fn == NULL && absolute > priv->len)
if (priv->realloc_fn == NULL && (gsize) absolute > priv->len)
{
g_set_error_literal (error,
G_IO_ERROR,