commit - a65eb347ec46282b4b47db4da106baaa6c716ab3
commit + 9dfd42a7e6c4d0cbc9ce2189e143c791f868de85
blob - bc405351e0d5fd825cba4e89f6412b06131a13ba
blob + 041cc8271880c13d8387427bd21f08c48a4eefd8
--- src/ngircd/array.c
+++ src/ngircd/array.c
#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>
#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)
aligned = ALIGN_4096U(alloc);
}
}
-#ifdef DEBUG
+#ifdef DEBUG_ARRAY
Log(LOG_DEBUG, "array_alloc(): rounded %u to %u bytes.", alloc, aligned);
#endif
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
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);
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
#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>
#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);
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;
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);
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);