Fix signedness warning in gio/giomodule.c

gio/giomodule.c: In function ‘print_help’:
glib/gmacros.h:806:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
  806 | #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
      |                          ^
../glib.git/gio/giomodule.c:733:19: note: in expansion of macro ‘MAX’
  733 |           width = MAX (width, strlen (g_io_extension_get_name (extension)));
      |                   ^~~
This commit is contained in:
Emmanuel Fleury 2020-11-18 19:53:33 +01:00
parent e0bd609f76
commit 5fec112453

View File

@ -731,7 +731,7 @@ print_help (const char *envvar,
{
GList *l;
GIOExtension *extension;
int width = 0;
gsize width = 0;
for (l = g_io_extension_point_get_extensions (ep); l; l = l->next)
{
@ -743,7 +743,9 @@ print_help (const char *envvar,
{
extension = l->data;
g_print (" %*s - %d\n", width, g_io_extension_get_name (extension), g_io_extension_get_priority (extension));
g_print (" %*s - %d\n", (int) MIN (width, G_MAXINT),
g_io_extension_get_name (extension),
g_io_extension_get_priority (extension));
}
}
}