From f3d14e76167dd6fff98197dc8817333f63b7a2b6 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 19 Apr 2021 22:53:38 -0400 Subject: [PATCH] glx: Add and use DebugMessageF convenience macro Reviewed-by: Eric Anholt Part-of: --- src/glx/dri_common.c | 12 ++++-------- src/glx/glxclient.h | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index dcf1070a287..45b9779e1fb 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -206,8 +206,7 @@ driConfigEqual(const __DRIcoreExtension *core, if (config->visualRating == GLX_NONE) { static int warned; if (!warned) { - glx_message(_LOADER_DEBUG, - "Not downgrading visual rating\n"); + DebugMessageF("Not downgrading visual rating\n"); warned = 1; } } else { @@ -220,8 +219,7 @@ driConfigEqual(const __DRIcoreExtension *core, if (!scalarEqual(config, attrib, value)) { static int warned; if (!warned) { - glx_message(_LOADER_DEBUG, - "Disabling server's aux buffer support\n"); + DebugMessageF("Disabling server's aux buffer support\n"); warned = 1; } config->numAuxBuffers = 0; @@ -232,8 +230,7 @@ driConfigEqual(const __DRIcoreExtension *core, if (!scalarEqual(config, attrib, value)) { static int warned; if (!warned) { - glx_message(_LOADER_DEBUG, - "Disabling server's tfp mipmap support\n"); + DebugMessageF("Disabling server's tfp mipmap support\n"); warned = 1; } config->bindToMipmapTexture = 0; @@ -244,8 +241,7 @@ driConfigEqual(const __DRIcoreExtension *core, if (!scalarEqual(config, attrib, value)) { static int warned; if (!warned) { - glx_message(_LOADER_DEBUG, - "Disabling server's sRGB support\n"); + DebugMessageF("Disabling server's sRGB support\n"); warned = 1; } config->sRGBCapable = 0; diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 3e3fbd0ea83..a3d2447be0a 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -68,6 +68,7 @@ extern "C" { extern void glx_message(int level, const char *f, ...) PRINTFLIKE(2, 3); +#define DebugMessageF(...) glx_message(_LOADER_DEBUG, __VA_ARGS__) #define InfoMessageF(...) glx_message(_LOADER_INFO, __VA_ARGS__) #define ErrorMessageF(...) glx_message(_LOADER_WARNING, __VA_ARGS__) #define CriticalErrorMessageF(...) glx_message(_LOADER_FATAL, __VA_ARGS__)