[glib] GMemoryOutputStream: Don't return -1 as a gboolean in precondition



commit e2d5282636bcbf4c8ac64a599bb020d33cd59897
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 8 12:17:16 2013 -0400

    GMemoryOutputStream: Don't return -1 as a gboolean in precondition
    
    Since it could confuse callers (admittedly who are already violating
    a precondition).
    
    Just spotted while adapting some bits of this code for a ssh library.

 gio/gmemoryoutputstream.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gmemoryoutputstream.c b/gio/gmemoryoutputstream.c
index d37b46e..82edceb 100644
--- a/gio/gmemoryoutputstream.c
+++ b/gio/gmemoryoutputstream.c
@@ -678,7 +678,7 @@ g_memory_output_stream_close_finish (GOutputStream  *stream,
                                      GAsyncResult   *result,
                                      GError        **error)
 {
-  g_return_val_if_fail (g_task_is_valid (result, stream), -1);
+  g_return_val_if_fail (g_task_is_valid (result, stream), FALSE);
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }


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