From e7992b7b06df986bd36dd745a4cca2661e77f497 Mon Sep 17 00:00:00 2001 From: Paolo Borelli Date: Sun, 29 Nov 2009 15:14:10 +0100 Subject: [PATCH] Fix return type of g_converter_[in|out]put_stream. Fixes bug #603265 --- gio/gconverterinputstream.c | 8 ++++---- gio/gconverterinputstream.h | 4 ++-- gio/gconverteroutputstream.c | 10 +++++----- gio/gconverteroutputstream.h | 4 ++-- gio/tests/converter-stream.c | 30 +++++++++++++----------------- 5 files changed, 26 insertions(+), 30 deletions(-) diff --git a/gio/gconverterinputstream.c b/gio/gconverterinputstream.c index 9bd2cbac0..633973097 100644 --- a/gio/gconverterinputstream.c +++ b/gio/gconverterinputstream.c @@ -191,13 +191,13 @@ g_converter_input_stream_init (GConverterInputStream *stream) * * Creates a new converter input stream for the @base_stream. * - * Returns: a new #GConverterInputStream. + * Returns: a new #GInputStream. **/ -GConverterInputStream * +GInputStream * g_converter_input_stream_new (GInputStream *base_stream, - GConverter *converter) + GConverter *converter) { - GConverterInputStream *stream; + GInputStream *stream; g_return_val_if_fail (G_IS_INPUT_STREAM (base_stream), NULL); diff --git a/gio/gconverterinputstream.h b/gio/gconverterinputstream.h index 9ebbf208b..7c61640ee 100644 --- a/gio/gconverterinputstream.h +++ b/gio/gconverterinputstream.h @@ -71,8 +71,8 @@ struct _GConverterInputStreamClass }; GType g_converter_input_stream_get_type (void) G_GNUC_CONST; -GConverterInputStream *g_converter_input_stream_new (GInputStream *base_stream, - GConverter *converter); +GInputStream *g_converter_input_stream_new (GInputStream *base_stream, + GConverter *converter); GConverter *g_converter_input_stream_get_converter (GConverterInputStream *converter_stream); G_END_DECLS diff --git a/gio/gconverteroutputstream.c b/gio/gconverteroutputstream.c index f4c24b503..7b41c1b12 100644 --- a/gio/gconverteroutputstream.c +++ b/gio/gconverteroutputstream.c @@ -192,8 +192,8 @@ g_converter_output_stream_get_property (GObject *object, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } - } + static void g_converter_output_stream_init (GConverterOutputStream *stream) { @@ -208,13 +208,13 @@ g_converter_output_stream_init (GConverterOutputStream *stream) * * Creates a new converter output stream for the @base_stream. * - * Returns: a new #GConverterOutputStream. + * Returns: a new #GOutputStream. **/ -GConverterOutputStream * +GOutputStream * g_converter_output_stream_new (GOutputStream *base_stream, - GConverter *converter) + GConverter *converter) { - GConverterOutputStream *stream; + GOutputStream *stream; g_return_val_if_fail (G_IS_OUTPUT_STREAM (base_stream), NULL); diff --git a/gio/gconverteroutputstream.h b/gio/gconverteroutputstream.h index 1e89560ac..7e6364782 100644 --- a/gio/gconverteroutputstream.h +++ b/gio/gconverteroutputstream.h @@ -71,8 +71,8 @@ struct _GConverterOutputStreamClass }; GType g_converter_output_stream_get_type (void) G_GNUC_CONST; -GConverterOutputStream *g_converter_output_stream_new (GOutputStream *base_stream, - GConverter *converter); +GOutputStream *g_converter_output_stream_new (GOutputStream *base_stream, + GConverter *converter); GConverter *g_converter_output_stream_get_converter (GConverterOutputStream *converter_stream); G_END_DECLS diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c index 530649eb4..0efd5fce4 100644 --- a/gio/tests/converter-stream.c +++ b/gio/tests/converter-stream.c @@ -298,10 +298,8 @@ test_expander (void) gsize total_read; gssize res; GConverterResult cres; - GInputStream *mem; - GConverterInputStream *cstream; - GOutputStream *mem_out; - GConverterOutputStream *cstream_out; + GInputStream *mem, *cstream; + GOutputStream *mem_out, *cstream_out; GConverter *expander; GError *error; int i; @@ -334,7 +332,7 @@ test_expander (void) while (TRUE) { error = NULL; - res = g_input_stream_read (G_INPUT_STREAM (cstream), + res = g_input_stream_read (cstream, ptr, 1, NULL, &error); g_assert (res != -1); @@ -356,7 +354,7 @@ test_expander (void) for (i = 0; i < sizeof(unexpanded_data); i++) { error = NULL; - res = g_output_stream_write (G_OUTPUT_STREAM (cstream_out), + res = g_output_stream_write (cstream_out, unexpanded_data + i, 1, NULL, &error); g_assert (res != -1); @@ -368,7 +366,7 @@ test_expander (void) g_assert (res == 1); } - g_output_stream_close (G_OUTPUT_STREAM (cstream_out), NULL, NULL); + g_output_stream_close (cstream_out, NULL, NULL); g_assert (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mem_out)) == n_written); g_assert (memcmp (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (mem_out)), @@ -390,10 +388,8 @@ test_compressor (void) gsize total_read; gssize res; GConverterResult cres; - GInputStream *mem; - GOutputStream *mem_out; - GConverterInputStream *cstream; - GConverterOutputStream *cstream_out; + GInputStream *mem, *cstream; + GOutputStream *mem_out, *cstream_out; GConverter *expander, *compressor; GError *error; int i; @@ -424,7 +420,7 @@ test_compressor (void) while (TRUE) { error = NULL; - res = g_input_stream_read (G_INPUT_STREAM (cstream), + res = g_input_stream_read (cstream, ptr, 1, NULL, &error); g_assert (res != -1); @@ -448,7 +444,7 @@ test_compressor (void) for (i = 0; i < expanded_size; i++) { error = NULL; - res = g_output_stream_write (G_OUTPUT_STREAM (cstream_out), + res = g_output_stream_write (cstream_out, expanded + i, 1, NULL, &error); g_assert (res != -1); @@ -460,7 +456,7 @@ test_compressor (void) g_assert (res == 1); } - g_output_stream_close (G_OUTPUT_STREAM (cstream_out), NULL, NULL); + g_output_stream_close (cstream_out, NULL, NULL); g_assert (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mem_out)) == n_read - 1); /* Last 2 zeros are combined */ g_assert (memcmp (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (mem_out)), @@ -484,7 +480,7 @@ test_compressor (void) while (TRUE) { error = NULL; - res = g_input_stream_read (G_INPUT_STREAM (cstream), + res = g_input_stream_read (cstream, ptr, 1, NULL, &error); g_assert (res != -1); @@ -508,7 +504,7 @@ test_compressor (void) while (TRUE) { error = NULL; - res = g_input_stream_read (G_INPUT_STREAM (cstream), + res = g_input_stream_read (cstream, ptr, 1, NULL, &error); g_assert (res != -1); @@ -537,7 +533,7 @@ test_compressor (void) while (TRUE) { error = NULL; - res = g_input_stream_read (G_INPUT_STREAM (cstream), + res = g_input_stream_read (cstream, ptr, 1, NULL, &error); if (res == -1)