commit 9dfd42a7e6c4d0cbc9ce2189e143c791f868de85 from: Florian Westphal date: Tue May 09 17:02:40 2006 UTC disabled most (rather annoying) debug messages using DEBUG_ARRAY / DEBUG_IO defines commit - a65eb347ec46282b4b47db4da106baaa6c716ab3 commit + 9dfd42a7e6c4d0cbc9ce2189e143c791f868de85 blob - bc405351e0d5fd825cba4e89f6412b06131a13ba blob + 041cc8271880c13d8387427bd21f08c48a4eefd8 --- src/ngircd/array.c +++ src/ngircd/array.c @@ -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 @@ -21,6 +21,11 @@ static char UNUSED id[] = "$Id: array.c,v 1.9 2006/05/ #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 po 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); blob - a04c81defa245495d3d2f636f733a3145ef635c2 blob + b5ec13e2abdea92f681f4e1349615e223bfe48b5 --- src/ngircd/io.c +++ src/ngircd/io.c @@ -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 #include @@ -26,6 +26,8 @@ static char UNUSED id[] = "$Id: io.c,v 1.12 2006/05/07 #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);