mirror of
https://github.com/osmarks/ngircd.git
synced 2025-08-07 14:23:45 +00:00
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"
|
#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 <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"
|
#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 array_UNUSABLE(x) ( !(x)->mem || (0 == (x)->allocated) )
|
||||||
|
|
||||||
#define ALIGN_32U(x) (((x) | 0x1fU) +1)
|
#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);
|
aligned = ALIGN_4096U(alloc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_ARRAY
|
||||||
Log(LOG_DEBUG, "array_alloc(): rounded %u to %u bytes.", alloc, aligned);
|
Log(LOG_DEBUG, "array_alloc(): rounded %u to %u bytes.", alloc, aligned);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -89,7 +94,7 @@ array_alloc(array * a, size_t size, size_t pos)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
alloc = aligned;
|
alloc = aligned;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_ARRAY
|
||||||
Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.",
|
Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.",
|
||||||
a->allocated, aligned);
|
a->allocated, aligned);
|
||||||
#endif
|
#endif
|
||||||
@ -190,7 +195,7 @@ array_catb(array * dest, const char *src, size_t len)
|
|||||||
|
|
||||||
assert(ptr != NULL);
|
assert(ptr != NULL);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_ARRAY
|
||||||
Log(LOG_DEBUG,
|
Log(LOG_DEBUG,
|
||||||
"array_catb(): appending %u bytes to array (now %u bytes in array).",
|
"array_catb(): appending %u bytes to array (now %u bytes in array).",
|
||||||
len, tmp);
|
len, tmp);
|
||||||
@ -339,7 +344,7 @@ array_moveleft(array * a, size_t membersize, size_t pos)
|
|||||||
if (!bytepos)
|
if (!bytepos)
|
||||||
return; /* nothing to do */
|
return; /* nothing to do */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_ARRAY
|
||||||
Log(LOG_DEBUG,
|
Log(LOG_DEBUG,
|
||||||
"array_moveleft(): %u bytes used in array, starting at position %u.",
|
"array_moveleft(): %u bytes used in array, starting at position %u.",
|
||||||
a->used, bytepos);
|
a->used, bytepos);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "portab.h"
|
#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 <assert.h>
|
||||||
#include <stdlib.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 "io.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
/* Enables extra debug messages in event add/delete/callback code. */
|
||||||
|
/* #define DEBUG_IO */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*callback)(int, short);
|
void (*callback)(int, short);
|
||||||
@ -313,7 +315,7 @@ io_event_add(int fd, short what)
|
|||||||
|
|
||||||
if (!i) return false;
|
if (!i) return false;
|
||||||
if (i->what == what) return true;
|
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);
|
Log(LOG_DEBUG, "io_event_add(): fd %d (arg: %d), what %d.", i->fd, fd, what);
|
||||||
#endif
|
#endif
|
||||||
i->what |= what;
|
i->what |= what;
|
||||||
@ -399,7 +401,7 @@ bool
|
|||||||
io_event_del(int fd, short what)
|
io_event_del(int fd, short what)
|
||||||
{
|
{
|
||||||
io_event *i = io_event_get(fd);
|
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);
|
Log(LOG_DEBUG, "io_event_del(): trying to delete eventtype %d on fd %d", what, fd);
|
||||||
#endif
|
#endif
|
||||||
assert(i != NULL);
|
assert(i != NULL);
|
||||||
@ -591,7 +593,7 @@ static void
|
|||||||
io_docallback(int fd, short what)
|
io_docallback(int fd, short what)
|
||||||
{
|
{
|
||||||
io_event *i;
|
io_event *i;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_IO
|
||||||
Log(LOG_DEBUG, "doing callback for fd %d, what %d", fd, what);
|
Log(LOG_DEBUG, "doing callback for fd %d, what %d", fd, what);
|
||||||
#endif
|
#endif
|
||||||
i = io_event_get(fd);
|
i = io_event_get(fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user