mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-06 06:10:17 +01:00
[boilerplate] Suppress xlib warnings on stderr
If we cannot test the xlib backend simply because there is no Display, just report UNTESTED and do not clutter the output with superfluous warnings [see the output from the buildbots for an example]. However, keep the warnings around so that a developer can re-enable them and so simply move them to a new "lower priority" macro.
This commit is contained in:
parent
75538962c8
commit
ff1f5de551
2 changed files with 13 additions and 9 deletions
|
|
@ -108,11 +108,11 @@ _cairo_boilerplate_xlib_test_create_surface (Display *dpy,
|
|||
break;
|
||||
case CAIRO_CONTENT_ALPHA:
|
||||
default:
|
||||
CAIRO_BOILERPLATE_LOG ("Invalid content for xlib test: %d\n", content);
|
||||
CAIRO_BOILERPLATE_DEBUG ("Invalid content for xlib test: %d\n", content);
|
||||
return NULL;
|
||||
}
|
||||
if (xrender_format == NULL) {
|
||||
CAIRO_BOILERPLATE_LOG ("X server does not have the Render extension.\n");
|
||||
CAIRO_BOILERPLATE_DEBUG ("X server does not have the Render extension.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
|
|||
case CAIRO_CONTENT_COLOR_ALPHA:
|
||||
xrender_format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
|
||||
if (xrender_format == NULL) {
|
||||
CAIRO_BOILERPLATE_LOG ("X server does not have the Render extension.\n");
|
||||
CAIRO_BOILERPLATE_DEBUG ("X server does not have the Render extension.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -154,14 +154,14 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
|
|||
if (! _cairo_boilerplate_xlib_check_screen_size (dpy,
|
||||
DefaultScreen (dpy),
|
||||
width, height)) {
|
||||
CAIRO_BOILERPLATE_LOG ("Surface is larger than the Screen.\n");
|
||||
CAIRO_BOILERPLATE_DEBUG ("Surface is larger than the Screen.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
visual = DefaultVisual (dpy, DefaultScreen (dpy));
|
||||
xrender_format = XRenderFindVisualFormat (dpy, visual);
|
||||
if (xrender_format == NULL) {
|
||||
CAIRO_BOILERPLATE_LOG ("X server does not have the Render extension.\n");
|
||||
CAIRO_BOILERPLATE_DEBUG ("X server does not have the Render extension.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
|
|||
|
||||
case CAIRO_CONTENT_ALPHA:
|
||||
default:
|
||||
CAIRO_BOILERPLATE_LOG ("Invalid content for xlib test: %d\n", content);
|
||||
CAIRO_BOILERPLATE_DEBUG ("Invalid content for xlib test: %d\n", content);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
|
|||
xtc->dpy = dpy = XOpenDisplay (NULL);
|
||||
if (xtc->dpy == NULL) {
|
||||
free (xtc);
|
||||
CAIRO_BOILERPLATE_LOG ("Failed to open display: %s\n", XDisplayName(0));
|
||||
CAIRO_BOILERPLATE_DEBUG ("Failed to open display: %s\n", XDisplayName(0));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name,
|
|||
|
||||
xtc->dpy = dpy = XOpenDisplay (NULL);
|
||||
if (xtc->dpy == NULL) {
|
||||
CAIRO_BOILERPLATE_LOG ("Failed to open display: %s\n", XDisplayName(0));
|
||||
CAIRO_BOILERPLATE_DEBUG ("Failed to open display: %s\n", XDisplayName(0));
|
||||
free (xtc);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name,
|
|||
screen = DefaultScreen (dpy);
|
||||
if (! _cairo_boilerplate_xlib_check_screen_size (dpy, screen,
|
||||
width, height)) {
|
||||
CAIRO_BOILERPLATE_LOG ("Surface is larger than the Screen.\n");
|
||||
CAIRO_BOILERPLATE_DEBUG ("Surface is larger than the Screen.\n");
|
||||
XCloseDisplay (dpy);
|
||||
free (xtc);
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@
|
|||
#define CAIRO_BOILERPLATE_LOG(...) fprintf(stderr, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef CAIRO_BOILERPLATE_DEBUG
|
||||
#define CAIRO_BOILERPLATE_DEBUG(...)
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
#define CAIRO_BOILERPLATE_PRINTF_FORMAT(fmt_index, va_index) \
|
||||
__attribute__((__format__(__printf__, fmt_index, va_index)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue