Fix several signedness warnings in gio/tests/converter-stream.c:g_compressor_converter_convert()

gio/tests/converter-stream.c: In function ‘g_compressor_converter_convert’:
gio/tests/converter-stream.c:234:23: error: comparison of integer expressions of different signedness: ‘long int’ and ‘gsize’ {aka ‘long unsigned int’}
  234 |       if (in_end - in < block_size)
      |                       ^
gio/tests/converter-stream.c:244:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’}
  244 |       for (i = 0; i < block_size; i++)
      |                     ^
gio/tests/converter-stream.c:257:33: error: comparison of integer expressions of different signedness: ‘long int’ and ‘gsize’ {aka ‘long unsigned int’}
  257 |       if (v == 0 && in_end - in == block_size && (flags & G_CONVERTER_INPUT_AT_END) == 0)
      |                                 ^~
This commit is contained in:
Emmanuel Fleury 2020-11-17 23:56:30 +01:00
parent cc1e7302f3
commit 56e25d81f6

View File

@ -210,7 +210,7 @@ g_compressor_converter_convert (GConverter *converter,
{
const guint8 *in, *in_end;
guint8 v, *out;
int i;
gsize i;
gsize block_size;
in = inbuf;
@ -231,7 +231,7 @@ g_compressor_converter_convert (GConverter *converter,
block_size = v * 1000;
/* Not enough data */
if (in_end - in < block_size)
if ((gsize) (in_end - in) < block_size)
{
if (*bytes_read > 0)
break;
@ -254,7 +254,7 @@ g_compressor_converter_convert (GConverter *converter,
}
}
if (v == 0 && in_end - in == block_size && (flags & G_CONVERTER_INPUT_AT_END) == 0)
if (v == 0 && (gsize) (in_end - in) == block_size && (flags & G_CONVERTER_INPUT_AT_END) == 0)
{
if (*bytes_read > 0)
break;