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>
This commit is contained in:
Chris Wilson 2012-08-11 17:48:17 +01:00
parent 40e6be3278
commit 46d79228df

View file

@ -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;
}