[gnome-panel/gtk3] panel: Explicitly check return value of cairo_surface_status()



commit d376b00a0a5856b3d5eb20a7dc1b39440d2f3938
Author: Vincent Untz <vuntz gnome org>
Date:   Mon Jan 31 15:26:50 2011 +0100

    panel: Explicitly check return value of cairo_surface_status()
    
    Do not assume that CAIRO_STATUS_SUCCESS == 0. This clarifies the code.

 gnome-panel/panel-background.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome-panel/panel-background.c b/gnome-panel/panel-background.c
index 6a3081e..9d73f7f 100644
--- a/gnome-panel/panel-background.c
+++ b/gnome-panel/panel-background.c
@@ -182,7 +182,7 @@ composite_image_onto_desktop (PanelBackground *background)
         surface = gdk_window_create_similar_surface (background->window,
                                                      CAIRO_CONTENT_COLOR_ALPHA,
                                                      width, height);
-        if (cairo_surface_status (surface)) {
+        if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) {
                 cairo_surface_destroy (surface);
                 return NULL;
         }
@@ -227,7 +227,7 @@ composite_color_onto_desktop (PanelBackground *background)
                                                      CAIRO_CONTENT_COLOR_ALPHA,
                                                      background->region.width,
                                                      background->region.height);
-        if (cairo_surface_status (surface)) {
+        if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) {
                 cairo_surface_destroy (surface);
                 return NULL;
         }



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