summaryrefslogtreecommitdiff
path: root/boilerplate
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-01-03 11:44:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-01-03 21:53:09 +0000
commitff1f5de5511ba0b7842b53223c26986e4bcdc38a (patch)
tree249467a7bec44bc928720451aced16642f9244ac /boilerplate
parent75538962c8af11b1ec669caca6259b7769b5cc1d (diff)
[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.
Diffstat (limited to 'boilerplate')
-rw-r--r--boilerplate/cairo-boilerplate-xlib.c18
-rw-r--r--boilerplate/cairo-boilerplate.h4
2 files changed, 13 insertions, 9 deletions
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 250b23f3f..e9642e5d6 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -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;
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index 19b29572e..b2d79a7f0 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -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)))