[gtk+] gdk: Add some return_if_fail() warnings



commit 0bff20691560829487863c5b6c4d30fd2a669c76
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 6 19:21:27 2013 +0100

    gdk: Add some return_if_fail() warnings
    
    so we have a better chance of catching the correct cause of bugs like
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719977

 gdk/gdkcairo.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index 9624392..78003c7 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -284,6 +284,10 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
   cairo_format_t format;
   cairo_surface_t *surface;
 
+  g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
+  g_return_val_if_fail (scale > 0, NULL);
+  g_return_val_if_fail (for_window == NULL || GDK_IS_WINDOW (for_window), NULL);
+
   if (gdk_pixbuf_get_n_channels (pixbuf) == 3)
     format = CAIRO_FORMAT_RGB24;
   else


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