From: Kevin L. Mitchell Date: Sat, 21 Apr 2001 21:49:14 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=1b4e637606464f9af948a6e87879565f9fc1b726 Author: Kev Log message: Some small, misc. changes, along with the first step in redesigning the configuration system. runmalloc.[ch] finally retired, msgq_integrity() retired, and C++-style // comments replaced with C-style /* */ comments, since, unfortunately, all the world's not gcc. Almost all .c files contain an include for config.h first thing, now, and all of the includes in .h files for config.h have been removed, since they are now redundant. As I say, this is only the first step toward redesigning the configuration system; make config shouldn't be necessary anymore since most of the plethora of compile-time options have been made run-time configurable. This change includes those changes that must be made to the .c files, and there shouldn't be any other change that will affect them, except possibly some macro changes in configure.in. The end goal is to get rid of the config subdirectory completely, and arrange things so that the remaining compile-time options--things like DEBUGMODE and CONFIG_NDEBUG--can be given on the ./configure command line. Changes will also include a way to cache those results. Testing: Server has been compiled and run with no obvious ill effects as a result of the changes. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@429 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 3cc1fa8..0f8a10d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2001-04-21 Kevin L. Mitchell + + * ircd/msgq.c: finally remove the msgq_integrity() hack, as it's + turned up no more bugs + + * ircd/ircd.c: use /* */ comments instead of // comments--all the + world's not gcc :( + + * ircd/s_conf.c (conf_add_server): use /* */ comments instead of + // comments--all the world's not gcc :( + + * ircd/runmalloc.c: finally garbage-collect unused file + + * include/runmalloc.h: finally garbage-collect unused file + + * ircd/: addition of '#include "config.h"' before + all other includes in most .c files + + * include/: remove includes of config.h, which are + now going into the raw .c files + 2001-04-20 Kevin L. Mitchell * ircd/m_whois.c (do_whois): display proper server name if the diff --git a/include/channel.h b/include/channel.h index a8c4c3c..75037c5 100644 --- a/include/channel.h +++ b/include/channel.h @@ -21,9 +21,6 @@ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_ircd_defs_h #include "ircd_defs.h" /* NICKLEN */ #endif diff --git a/include/client.h b/include/client.h index 22125ed..61a57d2 100644 --- a/include/client.h +++ b/include/client.h @@ -25,9 +25,6 @@ #ifndef INCLUDED_ircd_defs_h #include "ircd_defs.h" #endif -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_dbuf_h #include "dbuf.h" #endif diff --git a/include/gline.h b/include/gline.h index d0dc65a..cc4e815 100644 --- a/include/gline.h +++ b/include/gline.h @@ -22,9 +22,6 @@ * * $Id$ */ -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_sys_types_h #include #define INCLUDED_sys_types_h diff --git a/include/ircd.h b/include/ircd.h index f2900e7..df1a398 100644 --- a/include/ircd.h +++ b/include/ircd.h @@ -5,9 +5,6 @@ */ #ifndef INCLUDED_ircd_h #define INCLUDED_ircd_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_struct_h #include "struct.h" /* struct Client */ #endif diff --git a/include/ircd_snprintf.h b/include/ircd_snprintf.h index 5fa984e..ba7277c 100644 --- a/include/ircd_snprintf.h +++ b/include/ircd_snprintf.h @@ -20,9 +20,6 @@ * * $Id$ */ -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_sys_types_h #include #define INCLUDED_sys_types_h diff --git a/include/ircd_string.h b/include/ircd_string.h index 778a028..d7b97c6 100644 --- a/include/ircd_string.h +++ b/include/ircd_string.h @@ -5,9 +5,6 @@ */ #ifndef INCLUDED_ircd_string_h #define INCLUDED_ircd_string_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_ircd_chattr_h #include "ircd_chattr.h" #endif diff --git a/include/jupe.h b/include/jupe.h index f5efe9d..e59788d 100644 --- a/include/jupe.h +++ b/include/jupe.h @@ -22,9 +22,6 @@ * * $Id$ */ -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_sys_types_h #include #define INCLUDED_sys_types_h diff --git a/include/runmalloc.h b/include/runmalloc.h deleted file mode 100644 index 3d9820d..0000000 --- a/include/runmalloc.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * runmalloc.h - * - * (C) Copyright 1996 - 1997, Carlo Wood (carlo@runaway.xs4all.nl) - * - * Headerfile of runmalloc.c - * - * $Id$ - */ -#ifndef INCLUDED_runmalloc_h -#define INCLUDED_runmalloc_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif -#ifndef INCLUDED_sys_types_h -#include /* size_t */ -#define INCLUDED_sys_types_h -#endif - -typedef void (*OutOfMemoryHandler)(void); - -extern void set_nomem_handler(OutOfMemoryHandler handler); - -#if 0 -/* - * we want to be able to test in DEBUGMODE without turning - * DEBUGMALLOC on, change in the config not in the code - */ -#if defined(DEBUGMODE) && !defined(DEBUGMALLOC) -#define DEBUGMALLOC -#endif -#endif - -#ifdef DEBUGMALLOC - -#if defined(MEMMAGICNUMS) && !defined(MEMSIZESTATS) -#define MEMSIZESTATS -#endif - -#ifndef MEMLEAKSTATS -#undef MEMTIMESTATS -#endif - -/* - * Proto types - */ - -#ifdef MEMLEAKSTATS -extern void *RunMalloc_memleak(size_t size, int line, const char *filename); -extern void *RunCalloc_memleak(size_t nmemb, size_t size, - int line, const char *filename); -extern void *RunRealloc_memleak(void *ptr, size_t size, - int line, const char *filename); -struct Client; -extern void report_memleak_stats(struct Client *sptr, int parc, char *parv[]); -#define MyMalloc(x) RunMalloc_memleak(x, __LINE__, __FILE__) -#define MyCalloc(x,y) RunCalloc_memleak(x,y, __LINE__, __FILE__) -#define MyRealloc(x,y) RunRealloc_memleak(x,y, __LINE__, __FILE__) - -#else /* !MEMLEAKSTATS */ -extern void *MyMalloc(size_t size); -extern void *MyCalloc(size_t nmemb, size_t size); -extern void *MyRealloc(void *ptr, size_t size); -#endif /* MEMLEAKSTATS */ - -extern int MyFree_test(void *ptr); -extern void MyFree(void *ptr); - -#ifdef MEMSIZESTATS -extern unsigned int get_alloc_cnt(void); -extern size_t get_mem_size(void); -#endif - -#else /* !DEBUGMALLOC */ - -#ifndef INCLUDED_stdlib_h -#include -#define INCLUDED_stdlib_h -#endif - -#undef MEMSIZESTATS -#undef MEMMAGICNUMS -#undef MEMLEAKSTATS -#undef MEMTIMESTATS - -#define MyFree(x) do { free((x)); (x) = 0; } while(0) -#define Debug_malloc(x) -extern void* MyMalloc(size_t size); -extern void* MyCalloc(size_t nelem, size_t size); -extern void* MyRealloc(void* x, size_t size); - -#endif /* DEBUGMALLOC */ - -#endif /* INCLUDED_runmalloc_h */ diff --git a/include/s_auth.h b/include/s_auth.h index 30feea0..0b03355 100644 --- a/include/s_auth.h +++ b/include/s_auth.h @@ -23,9 +23,6 @@ #include #define INCLUDED_sys_types_h #endif -#ifndef INCLUDED_config_h -#include "config.h" -#endif struct Client; diff --git a/include/s_bsd.h b/include/s_bsd.h index b9a8856..a0248c1 100644 --- a/include/s_bsd.h +++ b/include/s_bsd.h @@ -5,9 +5,6 @@ */ #ifndef INCLUDED_s_bsd_h #define INCLUDED_s_bsd_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_sys_types_h #include /* size_t, time_t */ #define INCLUDED_sys_types_h diff --git a/include/s_debug.h b/include/s_debug.h index a707a71..f3bbfd7 100644 --- a/include/s_debug.h +++ b/include/s_debug.h @@ -5,9 +5,6 @@ */ #ifndef INCLUDED_s_debug_h #define INCLUDED_s_debug_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif #ifndef INCLUDED_ircd_defs_h #include "ircd_defs.h" /* Needed for HOSTLEN */ #endif diff --git a/include/support.h b/include/support.h index 09ce20d..a580989 100644 --- a/include/support.h +++ b/include/support.h @@ -5,10 +5,6 @@ */ #ifndef INCLUDED_support_h #define INCLUDED_support_h -#ifndef INCLUDED_config_h -#include "config.h" -#define INCLUDED_config_h -#endif #if 0 #ifndef INCLUDED_sys_types_h #include /* broken BSD system headers */ diff --git a/include/supported.h b/include/supported.h index 4f73a04..5fbde13 100644 --- a/include/supported.h +++ b/include/supported.h @@ -25,7 +25,6 @@ #ifndef INCLUDED_supported_h #define INCLUDED_supported_h -#include "config.h" #include "channel.h" #include "ircd_defs.h" diff --git a/include/sys.h b/include/sys.h index 11d23a3..e35bc97 100644 --- a/include/sys.h +++ b/include/sys.h @@ -20,9 +20,6 @@ */ #ifndef INCLUDED_sys_h #define INCLUDED_sys_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif #if WORDS_BIGENDIAN # define BIT_ZERO_ON_LEFT diff --git a/include/whocmds.h b/include/whocmds.h index 247f6c5..44110f7 100644 --- a/include/whocmds.h +++ b/include/whocmds.h @@ -5,9 +5,6 @@ */ #ifndef INCLUDED_whocmds_h #define INCLUDED_whocmds_h -#ifndef INCLUDED_config_h -#include "config.h" -#endif struct Client; struct Channel; diff --git a/ircd/IPcheck.c b/ircd/IPcheck.c index 0fc2cac..3d850d8 100644 --- a/ircd/IPcheck.c +++ b/ircd/IPcheck.c @@ -22,6 +22,8 @@ * This file should be edited in a window with a width of 141 characters * ick */ +#include "config.h" + #include "IPcheck.h" #include "client.h" #include "ircd.h" diff --git a/ircd/channel.c b/ircd/channel.c index b478373..bd13efe 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "channel.h" #include "client.h" #include "hash.h" diff --git a/ircd/class.c b/ircd/class.c index 2a4d9cb..f377247 100644 --- a/ircd/class.c +++ b/ircd/class.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "class.h" #include "client.h" #include "ircd.h" diff --git a/ircd/client.c b/ircd/client.c index 23a03b8..a7aaa23 100644 --- a/ircd/client.c +++ b/ircd/client.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "client.h" #include "class.h" #include "ircd.h" diff --git a/ircd/crule.c b/ircd/crule.c index 4607107..5fd660d 100644 --- a/ircd/crule.c +++ b/ircd/crule.c @@ -32,6 +32,8 @@ * * $Id$ */ +#include "config.h" + #include "crule.h" #ifndef CR_DEBUG diff --git a/ircd/dbuf.c b/ircd/dbuf.c index d8c00a6..f856132 100644 --- a/ircd/dbuf.c +++ b/ircd/dbuf.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "dbuf.h" #include "ircd_alloc.h" #include "ircd_chattr.h" diff --git a/ircd/fda.c b/ircd/fda.c index 6349384..6355a97 100644 --- a/ircd/fda.c +++ b/ircd/fda.c @@ -19,6 +19,8 @@ /* * NOTE: Do not include fda.h here */ +#include "config.h" + #include #include #include diff --git a/ircd/fileio.c b/ircd/fileio.c index e79936a..f6ba89d 100644 --- a/ircd/fileio.c +++ b/ircd/fileio.c @@ -18,6 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "config.h" + #include "fileio.h" #include "ircd_alloc.h" /* MyMalloc, MyFree */ diff --git a/ircd/gline.c b/ircd/gline.c index 0627377..7f0186f 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "gline.h" #include "client.h" #include "ircd.h" diff --git a/ircd/hash.c b/ircd/hash.c index 8061a45..5414af4 100644 --- a/ircd/hash.c +++ b/ircd/hash.c @@ -21,6 +21,8 @@ * * $Id$ */ +#include "config.h" + #include "hash.h" #include "client.h" #include "channel.h" diff --git a/ircd/ircd.c b/ircd/ircd.c index a8f088c..97ff9f1 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "ircd.h" #include "IPcheck.h" #include "class.h" @@ -84,21 +86,22 @@ enum { /*---------------------------------------------------------------------------- * Global data (YUCK!) *--------------------------------------------------------------------------*/ -struct Client me; // That's me -struct Connection me_con; // That's me too -struct Client *GlobalClientList = &me; // Pointer to beginning of Client list -time_t TSoffset = 0; // Offset of timestamps to system clock -int GlobalRehashFlag = 0; // do a rehash if set -int GlobalRestartFlag = 0; // do a restart if set -time_t CurrentTime; // Updated every time we leave select() - -char *configfile = CPATH; // Server configuration file -int debuglevel = -1; // Server debug level -char *debugmode = ""; // Server debug level +struct Client me; /* That's me */ +struct Connection me_con; /* That's me too */ +struct Client *GlobalClientList = &me; /* Pointer to beginning of + Client list */ +time_t TSoffset = 0;/* Offset of timestamps to system clock */ +int GlobalRehashFlag = 0; /* do a rehash if set */ +int GlobalRestartFlag = 0; /* do a restart if set */ +time_t CurrentTime; /* Updated every time we leave select() */ + +char *configfile = CPATH; /* Server configuration file */ +int debuglevel = -1; /* Server debug level */ +char *debugmode = ""; /* Server debug level */ static char *dpath = DPATH; -time_t nextconnect = 1; // time for next try_connections call -time_t nextping = 1; // same as above for check_pings() +time_t nextconnect = 1; /* time for next try_connections call */ +time_t nextping = 1; /* same as above for check_pings() */ static struct Daemon thisServer = { 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0 }; diff --git a/ircd/ircd_alloc.c b/ircd/ircd_alloc.c index ced748d..17c6571 100644 --- a/ircd/ircd_alloc.c +++ b/ircd/ircd_alloc.c @@ -21,6 +21,8 @@ * * $Id$ */ +#include "config.h" + #include "ircd_alloc.h" #include "ircd_string.h" #include "s_debug.h" diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index b6a4d0a..05ed003 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -19,6 +19,7 @@ * $Id$ */ #include "config.h" + #include "ircd_features.h" #include "channel.h" /* list_set_default */ #include "class.h" diff --git a/ircd/ircd_log.c b/ircd/ircd_log.c index 53e8e00..52d459e 100644 --- a/ircd/ircd_log.c +++ b/ircd/ircd_log.c @@ -22,9 +22,10 @@ * * $Id$ */ +#include "config.h" + #include "ircd_log.h" #include "client.h" -#include "config.h" #include "ircd_alloc.h" #include "ircd_reply.h" #include "ircd_snprintf.h" diff --git a/ircd/ircd_relay.c b/ircd/ircd_relay.c index f099219..3eebe2c 100644 --- a/ircd/ircd_relay.c +++ b/ircd/ircd_relay.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "ircd_relay.h" #include "channel.h" #include "client.h" diff --git a/ircd/ircd_reply.c b/ircd/ircd_reply.c index 39d6514..0a25fe5 100644 --- a/ircd/ircd_reply.c +++ b/ircd/ircd_reply.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "ircd_reply.h" #include "client.h" #include "ircd.h" diff --git a/ircd/ircd_signal.c b/ircd/ircd_signal.c index 2ee429b..00e09f5 100644 --- a/ircd/ircd_signal.c +++ b/ircd/ircd_signal.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "ircd_signal.h" #include "ircd.h" diff --git a/ircd/ircd_snprintf.c b/ircd/ircd_snprintf.c index 7a85d6b..8706e80 100644 --- a/ircd/ircd_snprintf.c +++ b/ircd/ircd_snprintf.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "client.h" #include "channel.h" #include "ircd_snprintf.h" diff --git a/ircd/ircd_string.c b/ircd/ircd_string.c index 113f59d..359d36e 100644 --- a/ircd/ircd_string.c +++ b/ircd/ircd_string.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "ircd_string.h" #include "ircd_defs.h" #include "ircd_chattr.h" diff --git a/ircd/ircd_xopen.c b/ircd/ircd_xopen.c index 8eccda7..d4ce70c 100644 --- a/ircd/ircd_xopen.c +++ b/ircd/ircd_xopen.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #define _XOPEN_SOURCE #define _XOPEN_VERSION 4 #include "ircd_xopen.h" diff --git a/ircd/jupe.c b/ircd/jupe.c index 8c0ecef..2a58812 100644 --- a/ircd/jupe.c +++ b/ircd/jupe.c @@ -20,6 +20,8 @@ * * $Id$ */ +#include "config.h" + #include "jupe.h" #include "client.h" #include "hash.h" diff --git a/ircd/list.c b/ircd/list.c index 601d5bf..581a3ce 100644 --- a/ircd/list.c +++ b/ircd/list.c @@ -19,8 +19,9 @@ * * $Id$ */ -#include "list.h" +#include "config.h" +#include "list.h" #include "client.h" #include "ircd.h" #include "ircd_alloc.h" diff --git a/ircd/listener.c b/ircd/listener.c index 921678e..75f4add 100644 --- a/ircd/listener.c +++ b/ircd/listener.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "listener.h" #include "client.h" #include "ircd.h" diff --git a/ircd/m_admin.c b/ircd/m_admin.c index d7d3a8b..2ecd08f 100644 --- a/ircd/m_admin.c +++ b/ircd/m_admin.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_away.c b/ircd/m_away.c index 79127a3..ebd3cf7 100644 --- a/ircd/m_away.c +++ b/ircd/m_away.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_burst.c b/ircd/m_burst.c index f9a5969..e91484e 100644 --- a/ircd/m_burst.c +++ b/ircd/m_burst.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_clearmode.c b/ircd/m_clearmode.c index b64dd00..d71708e 100644 --- a/ircd/m_clearmode.c +++ b/ircd/m_clearmode.c @@ -80,6 +80,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_close.c b/ircd/m_close.c index 5337639..9f87177 100644 --- a/ircd/m_close.c +++ b/ircd/m_close.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_connect.c b/ircd/m_connect.c index 43d704a..5e372d4 100644 --- a/ircd/m_connect.c +++ b/ircd/m_connect.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_cprivmsg.c b/ircd/m_cprivmsg.c index 19b986f..9c81c4a 100644 --- a/ircd/m_cprivmsg.c +++ b/ircd/m_cprivmsg.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_create.c b/ircd/m_create.c index f413c29..26a4b9c 100644 --- a/ircd/m_create.c +++ b/ircd/m_create.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_defaults.c b/ircd/m_defaults.c index 06f6baa..bb52d2a 100644 --- a/ircd/m_defaults.c +++ b/ircd/m_defaults.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_destruct.c b/ircd/m_destruct.c index c05e41e..299abc3 100644 --- a/ircd/m_destruct.c +++ b/ircd/m_destruct.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_desynch.c b/ircd/m_desynch.c index a0e99d0..2e41c52 100644 --- a/ircd/m_desynch.c +++ b/ircd/m_desynch.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_die.c b/ircd/m_die.c index fbc1c42..f99aa7d 100644 --- a/ircd/m_die.c +++ b/ircd/m_die.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_endburst.c b/ircd/m_endburst.c index 9243d30..d2236b0 100644 --- a/ircd/m_endburst.c +++ b/ircd/m_endburst.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_error.c b/ircd/m_error.c index 907f31e..c335485 100644 --- a/ircd/m_error.c +++ b/ircd/m_error.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_get.c b/ircd/m_get.c index 3cdd6db..e136577 100644 --- a/ircd/m_get.c +++ b/ircd/m_get.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_gline.c b/ircd/m_gline.c index cc87f3c..e1aa27d 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_help.c b/ircd/m_help.c index a56341f..3e63723 100644 --- a/ircd/m_help.c +++ b/ircd/m_help.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_info.c b/ircd/m_info.c index 6c08e84..e98639c 100644 --- a/ircd/m_info.c +++ b/ircd/m_info.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_invite.c b/ircd/m_invite.c index 6950552..43ef8f5 100644 --- a/ircd/m_invite.c +++ b/ircd/m_invite.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_ison.c b/ircd/m_ison.c index 7f68d28..9968a44 100644 --- a/ircd/m_ison.c +++ b/ircd/m_ison.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_join.c b/ircd/m_join.c index f07d1f1..82f3655 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_jupe.c b/ircd/m_jupe.c index 3926f32..f49cb61 100644 --- a/ircd/m_jupe.c +++ b/ircd/m_jupe.c @@ -80,6 +80,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_kick.c b/ircd/m_kick.c index 6252247..86e7af8 100644 --- a/ircd/m_kick.c +++ b/ircd/m_kick.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_kill.c b/ircd/m_kill.c index 52c64a4..730d540 100644 --- a/ircd/m_kill.c +++ b/ircd/m_kill.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_links.c b/ircd/m_links.c index 38d5abd..7f1f98e 100644 --- a/ircd/m_links.c +++ b/ircd/m_links.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_list.c b/ircd/m_list.c index 0270d00..eaf9707 100644 --- a/ircd/m_list.c +++ b/ircd/m_list.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_lusers.c b/ircd/m_lusers.c index 313492c..764252d 100644 --- a/ircd/m_lusers.c +++ b/ircd/m_lusers.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_map.c b/ircd/m_map.c index 8346b4e..74ed166 100644 --- a/ircd/m_map.c +++ b/ircd/m_map.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_mode.c b/ircd/m_mode.c index 7479232..f2b2f00 100644 --- a/ircd/m_mode.c +++ b/ircd/m_mode.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #include "handlers.h" #include "channel.h" #include "client.h" diff --git a/ircd/m_motd.c b/ircd/m_motd.c index ba16ad6..f75cadf 100644 --- a/ircd/m_motd.c +++ b/ircd/m_motd.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_names.c b/ircd/m_names.c index f36a767..1ccb304 100644 --- a/ircd/m_names.c +++ b/ircd/m_names.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_nick.c b/ircd/m_nick.c index 3f37708..f532a89 100644 --- a/ircd/m_nick.c +++ b/ircd/m_nick.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_notice.c b/ircd/m_notice.c index caff3d0..f7de7c3 100644 --- a/ircd/m_notice.c +++ b/ircd/m_notice.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_oper.c b/ircd/m_oper.c index 5bbf215..47cb0b0 100644 --- a/ircd/m_oper.c +++ b/ircd/m_oper.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_opmode.c b/ircd/m_opmode.c index af9b03f..f0f1eec 100644 --- a/ircd/m_opmode.c +++ b/ircd/m_opmode.c @@ -80,6 +80,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_part.c b/ircd/m_part.c index 19ea1f0..86d772d 100644 --- a/ircd/m_part.c +++ b/ircd/m_part.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_pass.c b/ircd/m_pass.c index 5dee35b..4629f69 100644 --- a/ircd/m_pass.c +++ b/ircd/m_pass.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_ping.c b/ircd/m_ping.c index 60e2232..d882ce7 100644 --- a/ircd/m_ping.c +++ b/ircd/m_ping.c @@ -130,6 +130,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_pong.c b/ircd/m_pong.c index a6b9967..a746ca8 100644 --- a/ircd/m_pong.c +++ b/ircd/m_pong.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_privmsg.c b/ircd/m_privmsg.c index 2aa19b8..fc351e7 100644 --- a/ircd/m_privmsg.c +++ b/ircd/m_privmsg.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_privs.c b/ircd/m_privs.c index a5a307d..3603c20 100644 --- a/ircd/m_privs.c +++ b/ircd/m_privs.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_proto.c b/ircd/m_proto.c index 85cf1c8..e7731d2 100644 --- a/ircd/m_proto.c +++ b/ircd/m_proto.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_quit.c b/ircd/m_quit.c index 45a3a95..d1a7751 100644 --- a/ircd/m_quit.c +++ b/ircd/m_quit.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_rehash.c b/ircd/m_rehash.c index 28864e7..e43793c 100644 --- a/ircd/m_rehash.c +++ b/ircd/m_rehash.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_reset.c b/ircd/m_reset.c index 6a7981a..3bdd7aa 100644 --- a/ircd/m_reset.c +++ b/ircd/m_reset.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_restart.c b/ircd/m_restart.c index d566eae..6c52b93 100644 --- a/ircd/m_restart.c +++ b/ircd/m_restart.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_rping.c b/ircd/m_rping.c index 70f21b7..e30acb6 100644 --- a/ircd/m_rping.c +++ b/ircd/m_rping.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_rpong.c b/ircd/m_rpong.c index a325568..1ff2916 100644 --- a/ircd/m_rpong.c +++ b/ircd/m_rpong.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_server.c b/ircd/m_server.c index 796f839..32f275a 100644 --- a/ircd/m_server.c +++ b/ircd/m_server.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_set.c b/ircd/m_set.c index 76be0af..6059ee7 100644 --- a/ircd/m_set.c +++ b/ircd/m_set.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_settime.c b/ircd/m_settime.c index 08b5d6e..a532605 100644 --- a/ircd/m_settime.c +++ b/ircd/m_settime.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_silence.c b/ircd/m_silence.c index 9e61fec..2c92997 100644 --- a/ircd/m_silence.c +++ b/ircd/m_silence.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_squit.c b/ircd/m_squit.c index c36af4b..dbe234b 100644 --- a/ircd/m_squit.c +++ b/ircd/m_squit.c @@ -22,6 +22,7 @@ * * $Id$ */ +#include "config.h" #if 0 /* diff --git a/ircd/m_stats.c b/ircd/m_stats.c index d205ad1..e212494 100644 --- a/ircd/m_stats.c +++ b/ircd/m_stats.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #include "handlers.h" /* * XXX - ack!!! diff --git a/ircd/m_time.c b/ircd/m_time.c index b74794e..b02fa0f 100644 --- a/ircd/m_time.c +++ b/ircd/m_time.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_tmpl.c b/ircd/m_tmpl.c index 0b2eeef..2bc58fc 100644 --- a/ircd/m_tmpl.c +++ b/ircd/m_tmpl.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_topic.c b/ircd/m_topic.c index a8d5649..1cd2433 100644 --- a/ircd/m_topic.c +++ b/ircd/m_topic.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_trace.c b/ircd/m_trace.c index ff9981e..f06aaa9 100644 --- a/ircd/m_trace.c +++ b/ircd/m_trace.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_uping.c b/ircd/m_uping.c index de45e31..584f93a 100644 --- a/ircd/m_uping.c +++ b/ircd/m_uping.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_user.c b/ircd/m_user.c index 4a1a9b9..55ac6a8 100644 --- a/ircd/m_user.c +++ b/ircd/m_user.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #include "handlers.h" #include "client.h" #include "ircd.h" diff --git a/ircd/m_userhost.c b/ircd/m_userhost.c index 63b0a51..db862b0 100644 --- a/ircd/m_userhost.c +++ b/ircd/m_userhost.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_userip.c b/ircd/m_userip.c index 41aa223..14ccba8 100644 --- a/ircd/m_userip.c +++ b/ircd/m_userip.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_version.c b/ircd/m_version.c index 4893f01..7eef88d 100644 --- a/ircd/m_version.c +++ b/ircd/m_version.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_wallchops.c b/ircd/m_wallchops.c index 6fa55c1..f5163b4 100644 --- a/ircd/m_wallchops.c +++ b/ircd/m_wallchops.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_wallops.c b/ircd/m_wallops.c index d71f7e0..442a97d 100644 --- a/ircd/m_wallops.c +++ b/ircd/m_wallops.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_wallusers.c b/ircd/m_wallusers.c index e23eb73..cd840d7 100644 --- a/ircd/m_wallusers.c +++ b/ircd/m_wallusers.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_who.c b/ircd/m_who.c index a2d8718..e82222e 100644 --- a/ircd/m_who.c +++ b/ircd/m_who.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_whois.c b/ircd/m_whois.c index 0847f53..a6253d6 100644 --- a/ircd/m_whois.c +++ b/ircd/m_whois.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/m_whowas.c b/ircd/m_whowas.c index 40fab99..2b8faed 100644 --- a/ircd/m_whowas.c +++ b/ircd/m_whowas.c @@ -79,6 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ +#include "config.h" + #if 0 /* * No need to include handlers.h here the signatures must match diff --git a/ircd/match.c b/ircd/match.c index 06993da..0d43b57 100644 --- a/ircd/match.c +++ b/ircd/match.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "match.h" #include "ircd_chattr.h" /* diff --git a/ircd/motd.c b/ircd/motd.c index 4617a36..262e2ea 100644 --- a/ircd/motd.c +++ b/ircd/motd.c @@ -23,6 +23,8 @@ * * $Id$ */ +#include "config.h" + #include "motd.h" #include "class.h" #include "client.h" diff --git a/ircd/msgq.c b/ircd/msgq.c index 41ae242..e6ad9e4 100644 --- a/ircd/msgq.c +++ b/ircd/msgq.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "msgq.h" #include "ircd_alloc.h" #include "ircd_defs.h" @@ -52,32 +54,6 @@ static struct { struct MsgCounts msgBufCounts = { 0, 0 }; struct MsgCounts msgCounts = { 0, 0 }; -/* XXX HACK HACK HACK XXX */ -#if 1 -/* First, force assertion checking */ -#undef NDEBUG -#include - -/* This routine is TEMPORARY and is intended to track down a problem we're - * having with apparent buffer overflows in this file. - */ -static void -msgq_integrity(void) -{ - struct MsgBuf *mb; - struct Msg *msg; - - for (mb = MQData.msgs; mb; mb = mb->next) - assert(((unsigned long)mb) != 0x8000a0d); - for (mb = MQData.free_mbs; mb; mb = mb->next) - assert(((unsigned long)mb) != 0x8000a0d); - for (msg = MQData.free_msgs; msg; msg = msg->next) - assert(((unsigned long)msg) != 0x8000a0d); -} -#else -#define msgq_integrity() ((void)0) -#endif /* XXX HACK HACK HACK XXX */ - /* * This routine is used to remove a certain amount of data from a given * queue and release the Msg (and MsgBuf) structure if needed @@ -88,8 +64,6 @@ msgq_delmsg(struct MsgQ *mq, struct MsgQList *qlist, unsigned int *length_p) struct Msg *m; unsigned int msglen; - msgq_integrity(); - assert(0 != mq); assert(0 != qlist); assert(0 != qlist->head); @@ -121,8 +95,6 @@ msgq_delmsg(struct MsgQ *mq, struct MsgQList *qlist, unsigned int *length_p) m->sent += *length_p; /* this much of the message has been sent */ *length_p = 0; /* we've dealt with it all */ } - - msgq_integrity(); } /* @@ -131,8 +103,6 @@ msgq_delmsg(struct MsgQ *mq, struct MsgQList *qlist, unsigned int *length_p) void msgq_init(struct MsgQ *mq) { - msgq_integrity(); - assert(0 != mq); mq->length = 0; @@ -141,8 +111,6 @@ msgq_init(struct MsgQ *mq) mq->queue.tail = 0; mq->prio.head = 0; mq->prio.tail = 0; - - msgq_integrity(); } /* @@ -154,8 +122,6 @@ msgq_init(struct MsgQ *mq) void msgq_delete(struct MsgQ *mq, unsigned int length) { - msgq_integrity(); - assert(0 != mq); while (length > 0) { @@ -168,8 +134,6 @@ msgq_delete(struct MsgQ *mq, unsigned int length) else break; } - - msgq_integrity(); } /* @@ -184,17 +148,13 @@ msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count, struct Msg *prio; int i = 0; - msgq_integrity(); - assert(0 != mq); assert(0 != iov); assert(0 != count); assert(0 != len); - if (mq->length <= 0) { /* no data to map */ - msgq_integrity(); + if (mq->length <= 0) /* no data to map */ return 0; - } if (mq->queue.head && mq->queue.head->sent > 0) { /* partial msg on norm q */ iov[i].iov_base = mq->queue.head->msg->msg + mq->queue.head->sent; @@ -204,10 +164,8 @@ msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count, queue = mq->queue.head->next; /* where we start later... */ i++; /* filled an iovec... */ - if (!--count) { /* check for space */ - msgq_integrity(); + if (!--count) /* check for space */ return i; - } } else queue = mq->queue.head; /* start at head of queue */ @@ -219,10 +177,8 @@ msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count, prio = mq->prio.head->next; /* where we start later... */ i++; /* filled an iovec... */ - if (!--count) { /* check for space */ - msgq_integrity(); + if (!--count) /* check for space */ return i; - } } else prio = mq->prio.head; /* start at head of prio */ @@ -232,10 +188,8 @@ msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count, *len += iov[i].iov_len; i++; /* filled an iovec... */ - if (!--count) { /* check for space */ - msgq_integrity(); + if (!--count) /* check for space */ return i; - } } for (; queue; queue = queue->next) { /* go through normal queue */ @@ -244,14 +198,10 @@ msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count, *len += iov[i].iov_len; i++; /* filled an iovec... */ - if (!--count) { /* check for space */ - msgq_integrity(); + if (!--count) /* check for space */ return i; - } } - msgq_integrity(); - return i; } @@ -265,8 +215,6 @@ msgq_vmake(struct Client *dest, const char *format, va_list vl) { struct MsgBuf *mb; - msgq_integrity(); - assert(0 != format); if (!(mb = MQData.free_mbs)) { /* do I need to allocate one? */ @@ -297,8 +245,6 @@ msgq_vmake(struct Client *dest, const char *format, va_list vl) MQData.msgs->prev_p = &mb->next; MQData.msgs = mb; - msgq_integrity(); - return mb; } @@ -323,8 +269,6 @@ msgq_append(struct Client *dest, struct MsgBuf *mb, const char *format, ...) { va_list vl; - msgq_integrity(); - assert(0 != mb); assert(0 != format); @@ -346,8 +290,6 @@ msgq_append(struct Client *dest, struct MsgBuf *mb, const char *format, ...) mb->msg[mb->length] = '\0'; /* not strictly necessary */ assert(mb->length < sizeof(mb->msg)); - - msgq_integrity(); } /* @@ -357,8 +299,6 @@ msgq_append(struct Client *dest, struct MsgBuf *mb, const char *format, ...) void msgq_clean(struct MsgBuf *mb) { - msgq_integrity(); - assert(0 != mb); assert(0 < mb->ref); assert(0 != mb->prev_p); @@ -375,8 +315,6 @@ msgq_clean(struct MsgBuf *mb) msgBufCounts.used--; /* decrement the usage count */ } - - msgq_integrity(); } /* @@ -388,8 +326,6 @@ msgq_add(struct MsgQ *mq, struct MsgBuf *mb, int prio) struct MsgQList *qlist; struct Msg *msg; - msgq_integrity(); - assert(0 != mq); assert(0 != mb); assert(0 < mb->ref); @@ -424,8 +360,6 @@ msgq_add(struct MsgQ *mq, struct MsgBuf *mb, int prio) mq->length += mb->length; /* update the queue length */ mq->count++; /* and the queue count */ - - msgq_integrity(); } /* @@ -435,8 +369,6 @@ void msgq_count_memory(size_t *msg_alloc, size_t *msg_used, size_t *msgbuf_alloc, size_t *msgbuf_used) { - msgq_integrity(); - assert(0 != msg_alloc); assert(0 != msg_used); assert(0 != msgbuf_alloc); @@ -446,8 +378,6 @@ msgq_count_memory(size_t *msg_alloc, size_t *msg_used, size_t *msgbuf_alloc, *msg_used = msgCounts.used * sizeof(struct Msg); *msgbuf_alloc = msgCounts.alloc * sizeof(struct MsgBuf); *msgbuf_used = msgCounts.used * sizeof(struct MsgBuf); - - msgq_integrity(); } /* diff --git a/ircd/numnicks.c b/ircd/numnicks.c index 6bdca99..b0474a0 100644 --- a/ircd/numnicks.c +++ b/ircd/numnicks.c @@ -18,6 +18,7 @@ * * $Id$ */ +#include "config.h" #include "numnicks.h" #include "client.h" diff --git a/ircd/opercmds.c b/ircd/opercmds.c index cceb1d3..22016f1 100644 --- a/ircd/opercmds.c +++ b/ircd/opercmds.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "opercmds.h" #include "class.h" #include "client.h" diff --git a/ircd/os_bsd.c b/ircd/os_bsd.c index acb0056..f26cb73 100644 --- a/ircd/os_bsd.c +++ b/ircd/os_bsd.c @@ -19,10 +19,11 @@ * $Id$ * */ +#include "config.h" + #define _XOPEN_SOURCE /* make limits.h #define IOV_MAX */ #include "ircd_osdep.h" -#include "config.h" #include "msgq.h" #include diff --git a/ircd/os_generic.c b/ircd/os_generic.c index 8c65459..73c2f79 100644 --- a/ircd/os_generic.c +++ b/ircd/os_generic.c @@ -19,10 +19,11 @@ * $Id$ * */ +#include "config.h" + #define _XOPEN_SOURCE /* make limits.h #define IOV_MAX */ #include "ircd_osdep.h" -#include "config.h" #include "msgq.h" #include diff --git a/ircd/os_linux.c b/ircd/os_linux.c index b17dbe4..7e37129 100644 --- a/ircd/os_linux.c +++ b/ircd/os_linux.c @@ -19,6 +19,8 @@ * $Id$ * */ +#include "config.h" + #define _XOPEN_SOURCE /* make limits.h #define IOV_MAX */ #include "ircd_osdep.h" diff --git a/ircd/os_openbsd.c b/ircd/os_openbsd.c index 88a3cd1..805d87f 100644 --- a/ircd/os_openbsd.c +++ b/ircd/os_openbsd.c @@ -19,6 +19,8 @@ * $Id$ * */ +#include "config.h" + #define _XOPEN_SOURCE /* Need this for IOV_MAX */ /* These typedef's are needed for socket.h to be happy. Bleep PROMISES to make @@ -30,7 +32,6 @@ typedef unsigned int u_int; typedef unsigned long u_long; #include "ircd_osdep.h" -#include "config.h" #include "msgq.h" #include diff --git a/ircd/os_solaris.c b/ircd/os_solaris.c index 9c3c353..e4ba40f 100644 --- a/ircd/os_solaris.c +++ b/ircd/os_solaris.c @@ -19,6 +19,8 @@ * $Id$ * */ +#include "config.h" + #define _XOPEN_SOURCE /* make limits.h #define IOV_MAX */ #include "ircd_osdep.h" diff --git a/ircd/packet.c b/ircd/packet.c index 12323a5..59f8cd2 100644 --- a/ircd/packet.c +++ b/ircd/packet.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "packet.h" #include "client.h" #include "ircd.h" diff --git a/ircd/parse.c b/ircd/parse.c index ecc91a5..77a37ee 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -20,6 +20,7 @@ * $Id$ */ #include "config.h" + #include "parse.h" #include "client.h" #include "channel.h" diff --git a/ircd/querycmds.c b/ircd/querycmds.c index 95c9b91..30a69c0 100644 --- a/ircd/querycmds.c +++ b/ircd/querycmds.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "querycmds.h" #include diff --git a/ircd/random.c b/ircd/random.c index 528b8d4..e85b228 100644 --- a/ircd/random.c +++ b/ircd/random.c @@ -17,6 +17,8 @@ * * $Id$ */ +#include "config.h" + #include "random.h" #include "client.h" #include "ircd_log.h" diff --git a/ircd/res.c b/ircd/res.c index fea222e..d9eb035 100644 --- a/ircd/res.c +++ b/ircd/res.c @@ -10,6 +10,8 @@ * added callbacks and reference counting of returned hostents. * --Bleep (Thomas Helvey ) */ +#include "config.h" + #include "res.h" #include "client.h" #include "ircd.h" diff --git a/ircd/runmalloc.c b/ircd/runmalloc.c deleted file mode 100644 index 5c4d76d..0000000 --- a/ircd/runmalloc.c +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Run's malloc/realloc/calloc/free DEBUG tools v2.0 - * - * (c) Copyright 1996, 1997 - * - * Author: - * - * 1024/624ACAD5 1997/01/26 Carlo Wood, Run on IRC - * Key fingerprint = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 - * Get key from pgp-public-keys server or - * finger carlo@runaway.xs4all.nl for public key (dialin, try at 21-22h GMT). - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ - */ -#include "runmalloc.h" -#include "client.h" -#include "ircd.h" -#include "numeric.h" -#include "numnicks.h" -#include "s_debug.h" -#include "send.h" -#include "struct.h" -#include "sys.h" - -#include -#include -#include - -#if defined(DEBUGMALLOC) - -#define MALLOC_HASHTABLE_SIZE 16384 -#define MallocHash(x) \ - ((unsigned int)(((((long int)(x) >> 4) * 0xDEECE66D) >> 16) & (long int)0x3fff)) -#define MAGIC_PREFIX 0xe4c483a1 -#define MAGIC_POSTFIX 0x435bd0fa - -#ifdef MEMLEAKSTATS -typedef struct { - const char *filename; - int line; - int number_of_allocations; -#ifdef MEMSIZESTATS - size_t size; -#endif -} location_st; - -#define LOCSIZE 1024 /* Maximum of 256 different locations */ -static location_st location[LOCSIZE]; -static unsigned int locations; /* Counter */ - -static unsigned int find_location(const char *filename, int line) -{ - unsigned int hash; - hash = line & 0xff; - while (location[hash].filename && (location[hash].line != line || - location[hash].filename != filename)) - if (++hash == LOCSIZE) - hash = 0; - if (!location[hash].filename) - { - /* New location */ - ++locations; - location[hash].filename = filename; - location[hash].line = line; - } - return hash; -} -#endif /* MEMLEAKSTATS */ - -#ifdef MEMMAGICNUMS -/* The size of this struct should be a multiple of 4 bytes, just in case... */ -typedef struct { - unsigned int prefix_magicnumber; -} prefix_blk_st; - -typedef struct { - unsigned int postfix_magicnumber; -} postfix_blk_st; - -#define SIZEOF_POSTFIX sizeof(postfix_blk_st) -#define SIZEOF_PREFIX sizeof(prefix_blk_st) -#define HAS_POSTFIX - -#else /* !MEMMAGICNUMS */ -typedef void prefix_blk_st; -#define SIZEOF_PREFIX 0 -#define SIZEOF_POSTFIX 0 -#endif /* MEMMAGICNUMS */ - -typedef struct hash_entry_st { - struct hash_entry_st *next; - prefix_blk_st *ptr; -#ifdef MEMSIZESTATS - size_t size; -#endif -#ifdef MEMLEAKSTATS - unsigned int location; -#ifdef MEMTIMESTATS - time_t when; -#endif /* MEMTIMESTATS */ -#endif /* MEMLEAKSTATS */ -} hash_entry_st; - -#define memblkp(prefix_ptr) \ - ((void *)((size_t)prefix_ptr + SIZEOF_PREFIX)) -#define prefixp(memblk_ptr) \ - ((prefix_blk_st *)((size_t)memblk_ptr - SIZEOF_PREFIX)) -#define postfixp(memblk_ptr, size) \ - ((postfix_blk_st *)((size_t)memblk_ptr + size)) - -static hash_entry_st *hashtable[MALLOC_HASHTABLE_SIZE]; -#ifdef MEMSIZESTATS -static size_t mem_size = 0; /* Number of allocated bytes */ -static unsigned int alloc_cnt = 0; /* Number of allocated blocks */ -#endif - -#ifdef MEMLEAKSTATS -void report_memleak_stats(struct Client *sptr, int parc, char *parv[]) -{ - unsigned int hash; - location_st *loc = location; - -#ifdef MEMTIMESTATS - time_t till = CurrentTime; - time_t from = me.since; - if (parc > 3) - { - location_st tmp_loc[LOCSIZE]; - hash_entry_st **start; - memset(tmp_loc, 0, sizeof(tmp_loc)); - if (parc > 3) - till -= atoi(parv[3]); - if (parc > 4) - from += atoi(parv[4]); - for (start = &hashtable[0]; - start < &hashtable[MALLOC_HASHTABLE_SIZE]; ++start) - { - hash_entry_st *hash_entry; - for (hash_entry = *start; hash_entry; hash_entry = hash_entry->next) - if (hash_entry->when >= from && hash_entry->when <= till) - { -#ifdef MEMSIZESTATS - tmp_loc[hash_entry->location].size += hash_entry->size; -#endif - tmp_loc[hash_entry->location].number_of_allocations++; - } - } - loc = tmp_loc; - if (MyUser(sptr) || Protocol(sptr->from) < 10) - sendto_one(sptr, ":%s NOTICE %s :Memory allocated between " TIME_T_FMT - " (server start + %s s) and " TIME_T_FMT " (CurrentTime - %s s):", - me.name, parv[0], from, parc > 4 ? parv[4] : "0", till, - parc > 3 ? parv[3] : "0"); - else - sendto_one(sptr, "%s NOTICE %s%s :Memory allocated between " TIME_T_FMT - " (server start + %s s) and " TIME_T_FMT " (CurrentTime - %s s):", - NumServ(&me), NumNick(sptr), from, parc > 4 ? parv[4] : "0", till, - parc > 3 ? parv[3] : "0"); - } -#endif /* MEMTIMESTATS */ - for (hash = 0; hash < LOCSIZE; ++hash) - if (loc[hash].number_of_allocations > 0) - sendto_one(sptr, rpl_str(RPL_STATMEM), me.name, parv[0], - loc[hash].number_of_allocations, - location[hash].line, location[hash].filename -#ifdef MEMSIZESTATS - , loc[hash].size -#endif - ); -} - -void *RunMalloc_memleak(size_t size, int line, const char *filename) -#else /* !MEMLEAKSTATS */ -void *MyMalloc(size_t size) -#endif /* MEMLEAKSTATS */ -{ - prefix_blk_st *ptr; - hash_entry_st *hash_entry; - hash_entry_st **hashtablep; - -#ifdef HAS_POSTFIX - size += 3; - size &= ~3; -#endif - - if (!((ptr = (prefix_blk_st *) - malloc(SIZEOF_PREFIX + size + SIZEOF_POSTFIX)) && - (hash_entry = (hash_entry_st *) malloc(sizeof(hash_entry_st))))) - { - if (ptr) - free(ptr); - (*noMemHandler)(); - return 0; - } - - hashtablep = &hashtable[MallocHash(ptr)]; - hash_entry->next = *hashtablep; - *hashtablep = hash_entry; - hash_entry->ptr = ptr; -#ifdef MEMLEAKSTATS -#ifdef MEMTIMESTATS - hash_entry->when = CurrentTime; -#endif - location[(hash_entry->location = - find_location(filename, line))].number_of_allocations++; -#endif /* MEMLEAKSTATS */ -#ifdef MEMSIZESTATS - hash_entry->size = size; -#ifdef MEMLEAKSTATS - location[hash_entry->location].size += size; -#endif - mem_size += size; - ++alloc_cnt; -#endif /* MEMSIZESTATS */ -#ifdef MEMMAGICNUMS - ptr->prefix_magicnumber = MAGIC_PREFIX; - postfixp(memblkp(ptr), size)->postfix_magicnumber = MAGIC_POSTFIX; -#endif - - Debug((DEBUG_MALLOC, "MyMalloc(%u) = %p", size, memblkp(ptr))); - - return memblkp(ptr); -} - -#ifdef MEMLEAKSTATS -void *RunCalloc_memleak(size_t nmemb, size_t size, - int line, const char *filename) -#else -void *MyCalloc(size_t nmemb, size_t size) -#endif /* MEMLEAKSTATS */ -{ - void *ptr; - size *= nmemb; -#ifdef MEMLEAKSTATS - if ((ptr = RunMalloc_memleak(size, line, filename))) -#else - if ((ptr = MyMalloc(size))) -#endif /* MEMLEAKSTATS */ - memset(ptr, 0, size); - return ptr; -} - -int MyFree_test(void *memblk_ptr) -{ - prefix_blk_st* prefix_ptr = prefixp(memblk_ptr); - hash_entry_st* hash_entry; - for (hash_entry = hashtable[MallocHash(prefix_ptr)]; - hash_entry && hash_entry->ptr != prefix_ptr; - hash_entry = hash_entry->next); - return hash_entry ? 1 : 0; -} - -void MyFree(void* memblk_ptr) -{ - prefix_blk_st* prefix_ptr = prefixp(memblk_ptr); - hash_entry_st* hash_entry; - hash_entry_st* prev_hash_entry = NULL; - unsigned int hash = MallocHash(prefix_ptr); - - Debug((DEBUG_MALLOC, "MyFree(%p)", memblk_ptr)); - - if (!memblk_ptr) - return; - - for (hash_entry = hashtable[hash]; - hash_entry && hash_entry->ptr != prefix_ptr; - prev_hash_entry = hash_entry, hash_entry = hash_entry->next); - if (!hash_entry) - { - Debug((DEBUG_FATAL, "FREEING NON MALLOC PTR !!!")); - assert(0 != hash_entry); - } -#ifdef MEMMAGICNUMS - if (prefix_ptr->prefix_magicnumber != MAGIC_PREFIX) - { - Debug((DEBUG_FATAL, "MAGIC_PREFIX CORRUPT !")); - assert(MAGIC_PREFIX == prefix_ptr->prefix_magicnumber); - } - prefix_ptr->prefix_magicnumber = 12345678; - if (postfixp(memblk_ptr, hash_entry->size)->postfix_magicnumber - != MAGIC_POSTFIX) - { - Debug((DEBUG_FATAL, "MAGIC_POSTFIX CORRUPT !")); - assert(MAGIC_POSTFIX == - postfixp(memblk_ptr, hash_entry->size)->postfix_magicnumber); - } - postfixp(memblk_ptr, hash_entry->size)->postfix_magicnumber = 87654321; -#endif /* MEMMAGICNUMS */ - - if (prev_hash_entry) - prev_hash_entry->next = hash_entry->next; - else - hashtable[hash] = hash_entry->next; - -#ifdef MEMLEAKSTATS - location[hash_entry->location].number_of_allocations--; -#endif - -#ifdef MEMSIZESTATS - mem_size -= hash_entry->size; - --alloc_cnt; -#ifdef MEMLEAKSTATS - location[hash_entry->location].size -= hash_entry->size; -#endif -#ifdef DEBUGMODE - /* Put 0xfefefefe.. in freed memory */ - memset(prefix_ptr, 0xfe, hash_entry->size + SIZEOF_PREFIX); -#endif /* DEBUGMODE */ -#endif /* MEMSIZESTATS */ - - free(hash_entry); - free(prefix_ptr); -} - -#ifdef MEMLEAKSTATS -void *RunRealloc_memleak(void *memblk_ptr, size_t size, - int line, const char *filename) -#else -void *MyRealloc(void *memblk_ptr, size_t size) -#endif /* MEMLEAKSTATS */ -{ - prefix_blk_st *ptr; - prefix_blk_st *prefix_ptr = prefixp(memblk_ptr); - hash_entry_st *hash_entry, *prev_hash_entry = NULL; - hash_entry_st **hashtablep; - unsigned int hash; - - if (!memblk_ptr) -#ifdef MEMLEAKSTATS - return RunMalloc_memleak(size, line, filename); -#else - return MyMalloc(size); -#endif /* MEMLEAKSTATS */ - if (!size) - { - MyFree(memblk_ptr); - return NULL; - } - - for (hash_entry = hashtable[(hash = MallocHash(prefix_ptr))]; - hash_entry && hash_entry->ptr != prefix_ptr; - prev_hash_entry = hash_entry, hash_entry = hash_entry->next); - if (!hash_entry) - { - Debug((DEBUG_FATAL, "REALLOCATING NON MALLOC PTR !!!")); - assert(0 != hash_entry); - } - -#ifdef MEMMAGICNUMS - if (prefix_ptr->prefix_magicnumber != MAGIC_PREFIX) - { - Debug((DEBUG_FATAL, "MAGIC_PREFIX CORRUPT !")); - assert(MAGIC_PREFIX == prefix_ptr->prefix_magicnumber); - } - if (postfixp(memblk_ptr, hash_entry->size)->postfix_magicnumber - != MAGIC_POSTFIX) - { - Debug((DEBUG_FATAL, "MAGIC_POSTFIX CORRUPT !")); - assert(MAGIC_POSTFIX == - postfixp(memblk_ptr, hash_entry->size)->postfix_magicnumber); - } -#endif /* MEMMAGICNUMS */ - -#ifdef HAS_POSTFIX - size += 3; - size &= ~3; -#endif - -#ifdef MEMMAGICNUMS - postfixp(memblkp(prefix_ptr), hash_entry->size)->postfix_magicnumber = 123456; -#endif -#ifdef MEMLEAKSTATS - location[hash_entry->location].number_of_allocations--; -#ifdef MEMSIZESTATS - location[hash_entry->location].size -= hash_entry->size; -#endif /* MEMSIZESTATS */ -#endif /* MEMLEAKSTATS */ - - if (!(ptr = - (prefix_blk_st *) realloc(prefix_ptr, - SIZEOF_PREFIX + size + SIZEOF_POSTFIX))) - { - (*noMemHandler)(); - return 0; - } - - if (prev_hash_entry) - prev_hash_entry->next = hash_entry->next; - else - hashtable[hash] = hash_entry->next; - - hashtablep = &hashtable[MallocHash(ptr)]; - hash_entry->next = *hashtablep; - *hashtablep = hash_entry; - hash_entry->ptr = ptr; -#ifdef MEMLEAKSTATS -#ifdef MEMTIMESTATS - hash_entry->when = CurrentTime; -#endif - location[(hash_entry->location = - find_location(filename, line))].number_of_allocations++; -#endif /* MEMLEAKSTATS */ -#ifdef MEMSIZESTATS - mem_size += size - hash_entry->size; - hash_entry->size = size; -#ifdef MEMLEAKSTATS - location[hash_entry->location].size += size; -#endif -#endif /* MEMSIZESTATS */ -#ifdef MEMMAGICNUMS - postfixp(memblkp(ptr), size)->postfix_magicnumber = MAGIC_POSTFIX; -#endif - - Debug((DEBUG_MALLOC, ": MyRealloc(%p, %u) = %p", - memblk_ptr, size, memblkp(ptr))); - - return memblkp(ptr); -} - -#ifdef MEMSIZESTATS -unsigned int get_alloc_cnt(void) -{ - return alloc_cnt; -} - -size_t get_mem_size(void) -{ - return mem_size; -} -#endif /* MEMSIZESTATS */ - -#endif /* !defined(DEBUGMALLOC) */ diff --git a/ircd/s_auth.c b/ircd/s_auth.c index 28158f7..01c207a 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -27,6 +27,8 @@ * any messages from it. * --Bleep Thomas Helvey */ +#include "config.h" + #include "s_auth.h" #include "client.h" #include "IPcheck.h" diff --git a/ircd/s_bsd.c b/ircd/s_bsd.c index 752d125..020336e 100644 --- a/ircd/s_bsd.c +++ b/ircd/s_bsd.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "s_bsd.h" #include "client.h" #include "IPcheck.h" diff --git a/ircd/s_conf.c b/ircd/s_conf.c index fe056e5..865270d 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -19,8 +19,9 @@ * * $Id$ */ -#include "s_conf.h" +#include "config.h" +#include "s_conf.h" #include "IPcheck.h" #include "class.h" #include "client.h" @@ -832,8 +833,8 @@ void conf_add_server(const char* const* fields, int count) server->next = serverConfList; serverConfList = server; - // if (INADDR_NONE == server->address.s_addr) - // lookup_confhost(server); + /* if (INADDR_NONE == server->address.s_addr) */ + /* lookup_confhost(server); */ } void conf_add_deny(const char* const* fields, int count, int ip_kill) diff --git a/ircd/s_debug.c b/ircd/s_debug.c index 5b54dd5..8e3728a 100644 --- a/ircd/s_debug.c +++ b/ircd/s_debug.c @@ -20,6 +20,8 @@ * $Id$ * */ +#include "config.h" + #include "s_debug.h" #include "channel.h" #include "class.h" diff --git a/ircd/s_err.c b/ircd/s_err.c index e887eb3..002a948 100644 --- a/ircd/s_err.c +++ b/ircd/s_err.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "numeric.h" #include "s_debug.h" #include "sprintf_irc.h" diff --git a/ircd/s_misc.c b/ircd/s_misc.c index 1314b66..a217075 100644 --- a/ircd/s_misc.c +++ b/ircd/s_misc.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "s_misc.h" #include "IPcheck.h" #include "channel.h" diff --git a/ircd/s_numeric.c b/ircd/s_numeric.c index 5451ad1..2fb84f4 100644 --- a/ircd/s_numeric.c +++ b/ircd/s_numeric.c @@ -20,6 +20,8 @@ * * $Id$ */ +#include "config.h" + #include "s_numeric.h" #include "channel.h" #include "client.h" diff --git a/ircd/s_serv.c b/ircd/s_serv.c index 8e0524c..4777df1 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "s_serv.h" #include "IPcheck.h" #include "channel.h" diff --git a/ircd/s_stats.c b/ircd/s_stats.c index 38ea8f7..38ecc7c 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -21,6 +21,7 @@ * * $Id$ */ +#include "config.h" #include "s_stats.h" #include "class.h" diff --git a/ircd/s_user.c b/ircd/s_user.c index bd73290..0a71c4a 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "s_user.h" #include "IPcheck.h" #include "channel.h" diff --git a/ircd/send.c b/ircd/send.c index 04401f3..89ee2b9 100644 --- a/ircd/send.c +++ b/ircd/send.c @@ -19,6 +19,8 @@ * * $Id$ */ +#include "config.h" + #include "send.h" #include "channel.h" #include "class.h" diff --git a/ircd/sprintf_irc.c b/ircd/sprintf_irc.c index 6fce6c8..a9dc53b 100644 --- a/ircd/sprintf_irc.c +++ b/ircd/sprintf_irc.c @@ -26,6 +26,8 @@ * * $Id$ */ +#include "config.h" + #include "sprintf_irc.h" #include "sys.h" #include diff --git a/ircd/support.c b/ircd/support.c index 93a94e3..d05395f 100644 --- a/ircd/support.c +++ b/ircd/support.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "support.h" #include "fileio.h" #include "ircd.h" diff --git a/ircd/table_gen.c b/ircd/table_gen.c index e5554f9..3ba8da4 100644 --- a/ircd/table_gen.c +++ b/ircd/table_gen.c @@ -41,6 +41,7 @@ * both admins and coders. * */ +#include "config.h" #include "ircd_chattr.h" #include diff --git a/ircd/uping.c b/ircd/uping.c index 3db630d..1c35a7f 100644 --- a/ircd/uping.c +++ b/ircd/uping.c @@ -18,6 +18,8 @@ * * $Id$ */ +#include "config.h" + #include "uping.h" #include "client.h" #include "ircd.h" diff --git a/ircd/userload.c b/ircd/userload.c index b51d2f9..84d6a9c 100644 --- a/ircd/userload.c +++ b/ircd/userload.c @@ -25,6 +25,8 @@ * * $Id$ */ +#include "config.h" + #include "userload.h" #include "client.h" #include "ircd.h" diff --git a/ircd/whocmds.c b/ircd/whocmds.c index f1b2d50..69829a8 100644 --- a/ircd/whocmds.c +++ b/ircd/whocmds.c @@ -22,6 +22,8 @@ * * $Id$ */ +#include "config.h" + #include "whocmds.h" #include "channel.h" #include "client.h" diff --git a/ircd/whowas.c b/ircd/whowas.c index d8c0db2..48ab103 100644 --- a/ircd/whowas.c +++ b/ircd/whowas.c @@ -34,6 +34,8 @@ * * $Id$ */ +#include "config.h" + #include "whowas.h" #include "client.h" #include "ircd.h"