Fixing signedness in glib/gvariant.c

glib/gvariant.c: In function ‘g_variant_new_strv’:
glib/gvariant.c:1563:17: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
   for (i = 0; i < length; i++)
                 ^
glib/gvariant.c: In function ‘g_variant_new_objv’:
glib/gvariant.c:1699:17: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
   for (i = 0; i < length; i++)
                 ^
glib/gvariant.c: In function ‘g_variant_new_bytestring_array’:
glib/gvariant.c:1939:17: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
   for (i = 0; i < length; i++)
                 ^
This commit is contained in:
Emmanuel Fleury 2019-02-04 13:45:41 +01:00
parent 9023483d36
commit 3f3a7472b3

View File

@ -1552,19 +1552,20 @@ g_variant_new_strv (const gchar * const *strv,
gssize length)
{
GVariant **strings;
gsize i;
gsize i, length_unsigned;
g_return_val_if_fail (length == 0 || strv != NULL, NULL);
if (length < 0)
length = g_strv_length ((gchar **) strv);
length_unsigned = length;
strings = g_new (GVariant *, length);
for (i = 0; i < length; i++)
strings = g_new (GVariant *, length_unsigned);
for (i = 0; i < length_unsigned; i++)
strings[i] = g_variant_ref_sink (g_variant_new_string (strv[i]));
return g_variant_new_from_children (G_VARIANT_TYPE_STRING_ARRAY,
strings, length, TRUE);
strings, length_unsigned, TRUE);
}
/**
@ -1688,19 +1689,20 @@ g_variant_new_objv (const gchar * const *strv,
gssize length)
{
GVariant **strings;
gsize i;
gsize i, length_unsigned;
g_return_val_if_fail (length == 0 || strv != NULL, NULL);
if (length < 0)
length = g_strv_length ((gchar **) strv);
length_unsigned = length;
strings = g_new (GVariant *, length);
for (i = 0; i < length; i++)
strings = g_new (GVariant *, length_unsigned);
for (i = 0; i < length_unsigned; i++)
strings[i] = g_variant_ref_sink (g_variant_new_object_path (strv[i]));
return g_variant_new_from_children (G_VARIANT_TYPE_OBJECT_PATH_ARRAY,
strings, length, TRUE);
strings, length_unsigned, TRUE);
}
/**
@ -1928,19 +1930,20 @@ g_variant_new_bytestring_array (const gchar * const *strv,
gssize length)
{
GVariant **strings;
gsize i;
gsize i, length_unsigned;
g_return_val_if_fail (length == 0 || strv != NULL, NULL);
if (length < 0)
length = g_strv_length ((gchar **) strv);
length_unsigned = length;
strings = g_new (GVariant *, length);
for (i = 0; i < length; i++)
strings = g_new (GVariant *, length_unsigned);
for (i = 0; i < length_unsigned; i++)
strings[i] = g_variant_ref_sink (g_variant_new_bytestring (strv[i]));
return g_variant_new_from_children (G_VARIANT_TYPE_BYTESTRING_ARRAY,
strings, length, TRUE);
strings, length_unsigned, TRUE);
}
/**