summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-11 17:48:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-11 17:48:17 +0100
commit46d79228df5c5fda114e68d3df02eaa33b5a41c9 (patch)
treefd4538b5674987f70be4b7533730b287385a6ab5 /src/cairo-xlib-display.c
parent40e6be327861397a821e92ab626269e31fd13979 (diff)
xlib: Silence compiler warning
cairo-xlib-display.c: In function '_cairo_xlib_display_get_xrender_format': cairo-xlib-display.c:519:21: warning: 'pict_format' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-display.c')
-rw-r--r--src/cairo-xlib-display.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index e685c7cd..d806bfd5 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -492,7 +492,7 @@ _cairo_xlib_display_get_xrender_format (cairo_xlib_display_t *display,
xrender_format = display->cached_xrender_formats[format];
if (xrender_format == NULL) {
- int pict_format;
+ int pict_format = 0;
switch (format) {
case CAIRO_FORMAT_A1:
@@ -515,9 +515,10 @@ _cairo_xlib_display_get_xrender_format (cairo_xlib_display_t *display,
case CAIRO_FORMAT_ARGB32:
pict_format = PictStandardARGB32; break;
}
- if (!xrender_format)
- xrender_format = XRenderFindStandardFormat (display->display,
- pict_format);
+ if (pict_format) {
+ xrender_format =
+ XRenderFindStandardFormat (display->display, pict_format);
+ }
display->cached_xrender_formats[format] = xrender_format;
}