From 4f3a4ab01bc5303e988705faec2f3afba0ef28f7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 4 Mar 2011 23:53:45 +0000 Subject: [PATCH] x11: Use g_set_error_literal() The g_set_error() function takes a format string. --- clutter/x11/clutter-backend-x11.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 6c32ff0..c029500 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -349,12 +349,13 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend, * Only open connection if not already set by prior call to * clutter_x11_set_display() */ - if (!backend_x11->xdpy) + if (backend_x11->xdpy == NULL) { - if (clutter_display_name) + if (clutter_display_name != NULL && + *clutter_display_name != '\0') { - CLUTTER_NOTE (BACKEND, "XOpenDisplay on '%s'", - clutter_display_name); + CLUTTER_NOTE (BACKEND, "XOpenDisplay on '%s'", clutter_display_name); + backend_x11->xdpy = XOpenDisplay (clutter_display_name); if (backend_x11->xdpy == NULL) { @@ -367,16 +368,17 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend, } else { - g_set_error (error, CLUTTER_INIT_ERROR, - CLUTTER_INIT_ERROR_BACKEND, - "Unable to open display. You have to set the DISPLAY " - "environment variable, or use the --display command " - "line argument"); + g_set_error_literal (error, CLUTTER_INIT_ERROR, + CLUTTER_INIT_ERROR_BACKEND, + "Unable to open display. You have to set the " + "DISPLAY environment variable, or use the " + "--display command line argument"); return FALSE; } } - if (backend_x11->xdpy) + g_assert (backend_x11->xdpy != NULL); + { ClutterSettings *settings; Atom atoms[N_ATOM_NAMES]; -- 2.7.4