diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2011-04-22 16:39:29 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2011-05-03 14:44:11 +0200 |
commit | 2a611d9955546dc52be37651e6f7b6f7f03c7aa4 (patch) | |
tree | f3bfb731ffadbec59f32943029b4957022beb66c | |
parent | edfe2683583d7a849661cc08dc1964a5c925dff2 (diff) |
move WARN and WARN_ONCE to spice_common.h
-rw-r--r-- | common/glc.c | 11 | ||||
-rw-r--r-- | common/ogl_ctx.c | 1 | ||||
-rw-r--r-- | common/rop3.c | 8 | ||||
-rw-r--r-- | common/spice_common.h | 2 |
4 files changed, 7 insertions, 15 deletions
diff --git a/common/glc.c b/common/glc.c index 0396fc98..1c81dd86 100644 --- a/common/glc.c +++ b/common/glc.c @@ -39,14 +39,7 @@ #include "mem.h" #include "glc.h" #include "gl_utils.h" - -#define WARN_ONCE(x) { \ - static int warn = TRUE; \ - if (warn) { \ - printf x; \ - warn = FALSE; \ - } \ -} +#include "spice_common.h" #define TESS_VERTEX_ALLOC_BUNCH 20 @@ -1015,7 +1008,7 @@ void _glc_fill_mask(GLCCtx glc, int x_dest, int y_dest, int width, int height, i ASSERT(ctx && bitmap); start_draw(ctx); if (ctx->pat) { - WARN_ONCE(("%s: unimplemented fill mask with pattern\n", __FUNCTION__)); + WARN_ONCE("%s: unimplemented fill mask with pattern\n", __FUNCTION__); } fill_mask(ctx, x_dest, y_dest, width, height, stride, bitmap); } diff --git a/common/ogl_ctx.c b/common/ogl_ctx.c index 76a35514..0917f424 100644 --- a/common/ogl_ctx.c +++ b/common/ogl_ctx.c @@ -25,6 +25,7 @@ #include <GL/glx.h> #include "ogl_ctx.h" +#include "spice_common.h" enum { OGLCTX_TYPE_PBUF, diff --git a/common/rop3.c b/common/rop3.c index 1ce2cd25..af872c1d 100644 --- a/common/rop3.c +++ b/common/rop3.c @@ -24,10 +24,6 @@ #include "rop3.h" #include "spice_common.h" -#ifndef WARN -#define WARN(x) printf("warning: %s\n", x) -#endif - typedef void (*rop3_with_pattern_handler_t)(pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos, pixman_image_t *p, SpicePoint *pat_pos); @@ -51,13 +47,13 @@ static void default_rop3_with_pattern_handler(pixman_image_t *d, pixman_image_t SpicePoint *src_pos, pixman_image_t *p, SpicePoint *pat_pos) { - WARN("not implemented 0x%x"); + WARN("not implemented"); } static void default_rop3_withe_color_handler(pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos, uint32_t rgb) { - WARN("not implemented 0x%x"); + WARN("not implemented"); } static void default_rop3_test_handler() diff --git a/common/spice_common.h b/common/spice_common.h index 430c8aff..ed286892 100644 --- a/common/spice_common.h +++ b/common/spice_common.h @@ -53,6 +53,8 @@ printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__ ); \ } \ } +#define WARN(format, ...) red_printf("warning: "format"\n", ##__VA_ARGS__ ); +#define WARN_ONCE red_printf_once #define red_printf_some(every, format, ...) { \ static int count = 0; \ |