disabled most (rather annoying) debug messages using DEBUG_ARRAY / DEBUG_IO defines
This commit is contained in:
parent
a65eb347ec
commit
9dfd42a7e6
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue