]> arthur.barton.de Git - ngircd-alex.git/commitdiff
disabled most (rather annoying) debug messages using DEBUG_ARRAY / DEBUG_IO defines
authorFlorian Westphal <fw@strlen.de>
Tue, 9 May 2006 17:02:40 +0000 (17:02 +0000)
committerFlorian Westphal <fw@strlen.de>
Tue, 9 May 2006 17:02:40 +0000 (17:02 +0000)
src/ngircd/array.c
src/ngircd/io.c

index bc405351e0d5fd825cba4e89f6412b06131a13ba..041cc8271880c13d8387427bd21f08c48a4eefd8 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "array.h"
 
-static char UNUSED id[] = "$Id: array.c,v 1.9 2006/05/07 10:52:47 fw Exp $";
+static char UNUSED id[] = "$Id: array.c,v 1.10 2006/05/09 17:02:40 fw Exp $";
 
 #include <assert.h>
 
@@ -21,6 +21,11 @@ static char UNUSED id[] = "$Id: array.c,v 1.9 2006/05/07 10:52:47 fw Exp $";
 
 #include "log.h"
 
+/* Enable more Debug messages in alloc / append / memmove code. */
+/* #define DEBUG_ARRAY */
+
+
+
 #define array_UNUSABLE(x)      ( !(x)->mem || (0 == (x)->allocated) )
 
 #define ALIGN_32U(x)           (((x) | 0x1fU) +1)
@@ -79,7 +84,7 @@ array_alloc(array * a, size_t size, size_t pos)
                                aligned = ALIGN_4096U(alloc);
                        }
                }
-#ifdef DEBUG
+#ifdef DEBUG_ARRAY
                Log(LOG_DEBUG, "array_alloc(): rounded %u to %u bytes.", alloc, aligned);
 #endif
 
@@ -89,7 +94,7 @@ array_alloc(array * a, size_t size, size_t pos)
                        return NULL;
 
                alloc = aligned;
-#ifdef DEBUG
+#ifdef DEBUG_ARRAY
                Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.",
                    a->allocated, aligned);
 #endif
@@ -190,7 +195,7 @@ array_catb(array * dest, const char *src, size_t len)
 
        assert(ptr != NULL);
 
-#ifdef DEBUG
+#ifdef DEBUG_ARRAY
        Log(LOG_DEBUG,
            "array_catb(): appending %u bytes to array (now %u bytes in array).",
            len, tmp);
@@ -339,7 +344,7 @@ array_moveleft(array * a, size_t membersize, size_t pos)
        if (!bytepos)
                return; /* nothing to do */
 
-#ifdef DEBUG
+#ifdef DEBUG_ARRAY
        Log(LOG_DEBUG,
            "array_moveleft(): %u bytes used in array, starting at position %u.",
            a->used, bytepos);
index a04c81defa245495d3d2f636f733a3145ef635c2..b5ec13e2abdea92f681f4e1349615e223bfe48b5 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: io.c,v 1.12 2006/05/07 10:54:42 fw Exp $";
+static char UNUSED id[] = "$Id: io.c,v 1.13 2006/05/09 17:02:40 fw Exp $";
 
 #include <assert.h>
 #include <stdlib.h>
@@ -26,6 +26,8 @@ static char UNUSED id[] = "$Id: io.c,v 1.12 2006/05/07 10:54:42 fw Exp $";
 #include "io.h"
 #include "log.h"
 
+/* Enables extra debug messages in event add/delete/callback code. */
+/* #define DEBUG_IO */
 
 typedef struct {
  void (*callback)(int, short);
@@ -313,7 +315,7 @@ io_event_add(int fd, short what)
 
        if (!i) return false;
        if (i->what == what) return true;
-#ifdef DEBUG
+#ifdef DEBUG_IO
        Log(LOG_DEBUG, "io_event_add(): fd %d (arg: %d), what %d.", i->fd, fd, what);
 #endif
        i->what |= what;
@@ -399,7 +401,7 @@ bool
 io_event_del(int fd, short what)
 {
        io_event *i = io_event_get(fd);
-#ifdef DEBUG
+#ifdef DEBUG_IO
        Log(LOG_DEBUG, "io_event_del(): trying to delete eventtype %d on fd %d", what, fd);
 #endif
        assert(i != NULL);
@@ -591,7 +593,7 @@ static void
 io_docallback(int fd, short what)
 {
        io_event *i;
-#ifdef DEBUG
+#ifdef DEBUG_IO
        Log(LOG_DEBUG, "doing callback for fd %d, what %d", fd, what);
 #endif
        i = io_event_get(fd);