Fix tab_depth: it should not create an extra debug header.
authorMichael Adam <obnox@samba.org>
Tue, 22 Jan 2008 23:30:28 +0000 (00:30 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 23 Jan 2008 07:16:37 +0000 (08:16 +0100)
In pstring removal 4ae4b23586, the behaviour of tab_depth was
changed to create an extra debug header (by using the DEBUGLVL
macro).

This extracts the debug level check from DEBUGLVL into
a macro CHECK_DEBUGLVL without the debug header creation
and uses this instead of DEBUGLVL in tab_depth.

Michael
(This used to be commit cbc7d921fa696e6c3c5197ad9f87442ba679df82)

source3/include/debug.h
source3/lib/util.c

index 284671c730f00faa7b922fcbd008683143b8258c..d8dafcbd457509b25f35ca423d0b4f7b46668028 100644 (file)
@@ -176,11 +176,14 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
 #define unlikely(x) (x)
 #endif
 
-#define DEBUGLVL( level ) \
+#define CHECK_DEBUGLVL( level ) \
   ( ((level) <= MAX_DEBUG_LEVEL) && \
      unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))||  \
      (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
-      DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) \
+      DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) )
+
+#define DEBUGLVL( level ) \
+  ( CHECK_DEBUGLVL(level) \
    && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
 
 
index 11f3660df80ebc4ee31f46f329085412dd67ccf3..e5ac3752f5ed52bc73a790008e25ea3fe49fcb0d 100644 (file)
@@ -2182,7 +2182,7 @@ void dump_data_pw(const char *msg, const uchar * data, size_t len)
 
 const char *tab_depth(int level, int depth)
 {
-       if( DEBUGLVL(level) ) {
+       if( CHECK_DEBUGLVL(level) ) {
                dbgtext("%*s", depth*4, "");
        }
        return "";