From 7ce86771c8da4fa53a46a057e7b0ce45a903803b Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan.olivier@wanadoo.fr>
Date: Sun, 17 Oct 2004 12:45:39 +0000
Subject: [PATCH] Fix compiler warnings.

(Old svn revision: 12082)
---
 src/compositor.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 9eb98fde9..57bb0a013 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1776,7 +1776,6 @@ compositorHandleExpose (DisplayInfo *display_info, XExposeEvent *ev)
 static void
 compositorHandleConfigureNotify (DisplayInfo *display_info, XConfigureEvent *ev)
 {
-    XserverRegion extents;
     CWindow *cw;
 
     g_return_if_fail (display_info != NULL);
@@ -2164,12 +2163,21 @@ compositorManageScreen (ScreenInfo *screen_info, gboolean manual_redirect)
     visual_format = XRenderFindVisualFormat (display_info->dpy,
                                              DefaultVisual (display_info->dpy,
                                                             screen_info->screen));
-    g_return_if_fail (visual_format != NULL);
+    if (!visual_format)
+    {
+        g_warning (_("%s: Cannot find visual format on screen %i"), PACKAGE, screen_info->screen);
+        return FALSE;
+    }
 
     pa.subwindow_mode = IncludeInferiors;
     screen_info->rootPicture = XRenderCreatePicture (display_info->dpy, screen_info->xroot,
                                                      visual_format, CPSubwindowMode, &pa);
-    g_return_if_fail (screen_info->rootPicture != None);
+
+    if (screen_info->rootPicture == None)
+    {
+        g_warning (_("%s: Cannot create root picture on screen %i"), PACKAGE, screen_info->screen);
+        return FALSE;
+    }
 
     screen_info->gsize = -1;
     screen_info->gaussianMap = make_gaussian_map(SHADOW_RADIUS);
-- 
GitLab