This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 495fb5e6f800ed8d171a18510f3603d5aa6a7932
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sat Jan 28 14:09:44 2023 +0100

    Loaders: Debug macro cleanups
---
 src/lib/Imlib2_Loader.h           | 10 ++++++----
 src/modules/loaders/loader_ani.c  |  6 ------
 src/modules/loaders/loader_bmp.c  | 10 +++++-----
 src/modules/loaders/loader_tiff.c |  2 +-
 4 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/lib/Imlib2_Loader.h b/src/lib/Imlib2_Loader.h
index 6bd4c36..63f8637 100644
--- a/src/lib/Imlib2_Loader.h
+++ b/src/lib/Imlib2_Loader.h
@@ -69,15 +69,16 @@ typedef struct _ImlibImage ImlibImage;
 
 #if IMLIB2_DEBUG
 
-#define DC(M, fmt...) if (__imlib_debug & M) __imlib_printf(DBG_PFX, fmt)
+#define DC(PFX, M, fmt...) if (__imlib_debug & M) __imlib_printf(PFX, fmt)
 
 #define DBG_FILE	0x0001
 #define DBG_LOAD	0x0002
 #define DBG_LDR 	0x0004
 #define DBG_LDR2	0x0008
 
-#define D(fmt...)  DC(DBG_LDR, fmt)
-#define DL(fmt...) DC(DBG_LDR2, fmt)
+#define D(fmt...)  DC(DBG_PFX, DBG_LDR, fmt)
+#define Dx(fmt...) DC(NULL, DBG_LDR, fmt)
+#define DL(fmt...) DC(DBG_PFX, DBG_LDR2, fmt)
 
 extern unsigned int __imlib_debug;
 
@@ -87,8 +88,9 @@ unsigned int        __imlib_time_us(void);
 
 #else
 
-#define D(fmt...)
 #define DC(fmt...)
+#define D(fmt...)
+#define Dx(fmt...)
 #define DL(fmt...)
 
 #endif /* IMLIB2_DEBUG */
diff --git a/src/modules/loaders/loader_ani.c b/src/modules/loaders/loader_ani.c
index 00eadfc..9bb344e 100644
--- a/src/modules/loaders/loader_ani.c
+++ b/src/modules/loaders/loader_ani.c
@@ -8,12 +8,6 @@
 #include "config.h"
 #include "Imlib2_Loader.h"
 
-#if IMLIB2_DEBUG
-#define Dx(fmt...) if (__imlib_debug & DBG_LDR) __imlib_printf(NULL, fmt)
-#else
-#define Dx(fmt...)
-#endif
-
 #define DBG_PFX "LDR-ani"
 
 #define T(a,b,c,d) ((a << 0) | (b << 8) | (c << 16) | (d << 24))
diff --git a/src/modules/loaders/loader_bmp.c b/src/modules/loaders/loader_bmp.c
index 9838fdd..0ace8b6 100644
--- a/src/modules/loaders/loader_bmp.c
+++ b/src/modules/loaders/loader_bmp.c
@@ -11,7 +11,7 @@
 #include "Imlib2_Loader.h"
 
 #define DBG_PFX "LDR-bmp"
-#define Dx(fmt...)
+#define DD(fmt...)
 
 static const char  *const _formats[] = { "bmp" };
 
@@ -459,7 +459,7 @@ _load(ImlibImage * im, int load_data)
                   byte1 = buffer_ptr[0];
                   byte2 = buffer_ptr[1];
                   buffer_ptr += 2;
-                  Dx("%3d %3d: %02x %02x (%d %d)\n",
+                  DD("%3d %3d: %02x %02x (%d %d)\n",
                      x, y, byte1, byte2, byte2 >> 4, byte2 & 0xf);
                   if (byte1)
                     {
@@ -520,7 +520,7 @@ _load(ImlibImage * im, int load_data)
                             for (j = 0; j < l; j++)
                               {
                                  byte = *buffer_ptr++;
-                                 Dx("%3d %3d:   %d/%d: %2d %2d\n",
+                                 DD("%3d %3d:   %d/%d: %2d %2d\n",
                                     x, y, j, l, byte >> 4, byte & 0xf);
                                  *ptr++ = argbCmap[byte >> 4];
                                  if (++j < l)
@@ -583,7 +583,7 @@ _load(ImlibImage * im, int load_data)
                   byte1 = buffer_ptr[0];
                   byte2 = buffer_ptr[1];
                   buffer_ptr += 2;
-                  Dx("%3d %3d: %02x %02x\n", x, y, byte1, byte2);
+                  DD("%3d %3d: %02x %02x\n", x, y, byte1, byte2);
                   if (byte1)
                     {
                        pixel = argbCmap[byte2];
@@ -632,7 +632,7 @@ _load(ImlibImage * im, int load_data)
                             for (j = 0; j < l; j++)
                               {
                                  byte = *buffer_ptr++;
-                                 Dx("%3d %3d:   %d/%d: %2d\n",
+                                 DD("%3d %3d:   %d/%d: %2d\n",
                                     x, y, j, l, byte);
                                  *ptr++ = argbCmap[byte];
                               }
diff --git a/src/modules/loaders/loader_tiff.c b/src/modules/loaders/loader_tiff.c
index c9a4ec4..00ca8cb 100644
--- a/src/modules/loaders/loader_tiff.c
+++ b/src/modules/loaders/loader_tiff.c
@@ -8,7 +8,7 @@
 
 static const char  *const _formats[] = { "tiff", "tif" };
 
-#define DD(fmt...)  DC(0x80, fmt)
+#define DD(fmt...)  DC(DBG_PFX, 0x80, fmt)
 
 static struct {
    const unsigned char *data, *dptr;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to