Change SkipAsyncData fields to be gsize (and not gssize)

This commit is contained in:
Emmanuel Fleury 2021-02-16 13:17:26 +01:00
parent 49d5c4f859
commit 23dad977d8

View File

@ -1104,8 +1104,8 @@ g_buffered_input_stream_real_fill_finish (GBufferedInputStream *stream,
typedef struct typedef struct
{ {
gssize bytes_skipped; gsize bytes_skipped;
gssize count; gsize count;
} SkipAsyncData; } SkipAsyncData;
static void static void
@ -1186,6 +1186,7 @@ skip_fill_buffer_callback (GObject *source_object,
priv->pos += data->count; priv->pos += data->count;
} }
g_assert (data->bytes_skipped <= G_MAXSSIZE);
g_task_return_int (task, data->bytes_skipped); g_task_return_int (task, data->bytes_skipped);
} }
@ -1243,9 +1244,12 @@ g_buffered_input_stream_skip_async (GInputStream *stream,
if (count > priv->len) if (count > priv->len)
{ {
/* Large request, shortcut buffer */ /* Large request, shortcut buffer */
base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream;
/* If 'count > G_MAXSSIZE then 'g_input_stream_skip_async()'
* will return an error anyway before calling this.
* Assert that this is never called for too big `count` for clarity. */
g_assert ((gssize) count >= 0);
g_input_stream_skip_async (base_stream, g_input_stream_skip_async (base_stream,
count, count,
io_priority, cancellable, io_priority, cancellable,