[glib] GMemoryInputStream/GMemoryOutputStream: make these properly subclassable



commit a5876e5fc1b1e192e8cde664780957798b8a2607
Author: Dan Winship <danw gnome org>
Date:   Wed Nov 30 10:32:42 2011 +0100

    GMemoryInputStream/GMemoryOutputStream: make these properly subclassable
    
    The async methods were directly invoking their own implementations of
    the sync methods, making it impossible for a subclass to reimplement
    them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664635

 gio/gmemoryinputstream.c  |    4 ++--
 gio/gmemoryoutputstream.c |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gio/gmemoryinputstream.c b/gio/gmemoryinputstream.c
index 9107b22..47f4873 100644
--- a/gio/gmemoryinputstream.c
+++ b/gio/gmemoryinputstream.c
@@ -347,7 +347,7 @@ g_memory_input_stream_read_async (GInputStream        *stream,
   GSimpleAsyncResult *simple;
   gssize nread;
 
-  nread = g_memory_input_stream_read (stream, buffer, count, cancellable, NULL);
+  nread = g_input_stream_read (stream, buffer, count, cancellable, NULL);
   simple = g_simple_async_result_new (G_OBJECT (stream),
 				      callback,
 				      user_data,
@@ -383,7 +383,7 @@ g_memory_input_stream_skip_async (GInputStream        *stream,
   GSimpleAsyncResult *simple;
   gssize nskipped;
 
-  nskipped = g_memory_input_stream_skip (stream, count, cancellable, NULL);
+  nskipped = g_input_stream_skip (stream, count, cancellable, NULL);
   simple = g_simple_async_result_new (G_OBJECT (stream),
                                       callback,
                                       user_data,
diff --git a/gio/gmemoryoutputstream.c b/gio/gmemoryoutputstream.c
index b6b532d..78c1139 100644
--- a/gio/gmemoryoutputstream.c
+++ b/gio/gmemoryoutputstream.c
@@ -622,11 +622,11 @@ g_memory_output_stream_write_async (GOutputStream       *stream,
   GSimpleAsyncResult *simple;
   gssize nwritten;
 
-  nwritten = g_memory_output_stream_write (stream,
-                                           buffer,
-                                           count,
-                                           cancellable,
-                                           NULL);
+  nwritten = g_output_stream_write (stream,
+				    buffer,
+				    count,
+				    cancellable,
+				    NULL);
 
   simple = g_simple_async_result_new (G_OBJECT (stream),
                                       callback,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]