[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Fri Oct 12 10:51:02 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-12 15:50:36 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     acinclude.m4 src/Makefile.am src/botnet.c src/cmds.c src/dcc.c
     src/eggdrop.h src/irccmp.c src/main.c src/main.h src/modules.c
     src/net.c src/proto.h src/tcl.c src/tclhash.c src/mod/module.h
     src/mod/modvals.h

Added files:
     src/debug.h

Log message:

* DEBUG_ASSERT renamed to DEBUG
* Assert macro removed, replaced with ANSI assert support
* Removed more kludge code

---------------------- diff included ----------------------
Index: eggdrop1.7/acinclude.m4
diff -u eggdrop1.7/acinclude.m4:1.3 eggdrop1.7/acinclude.m4:1.4
--- eggdrop1.7/acinclude.m4:1.3	Wed Oct 10 09:50:01 2001
+++ eggdrop1.7/acinclude.m4	Fri Oct 12 10:50:25 2001
@@ -1,7 +1,7 @@
 dnl acinclude.m4
 dnl   macros autoconf uses when building configure from configure.in
 dnl
-dnl $Id: acinclude.m4,v 1.3 2001/10/10 14:50:01 tothwolf Exp $
+dnl $Id: acinclude.m4,v 1.4 2001/10/12 15:50:25 tothwolf Exp $
 dnl
 
 
@@ -1072,7 +1072,7 @@
 dnl EGG_DEBUG_OPTIONS
 dnl
 AC_DEFUN(EGG_DEBUG_OPTIONS, [dnl
-EGG_DEBUG="-DDEBUG_ASSERT"
+EGG_DEBUG="-DDEBUG"
 AC_SUBST(EGG_DEBUG)
 ])dnl
 
Index: eggdrop1.7/src/Makefile.am
diff -u eggdrop1.7/src/Makefile.am:1.4 eggdrop1.7/src/Makefile.am:1.5
--- eggdrop1.7/src/Makefile.am:1.4	Thu Oct 11 13:24:01 2001
+++ eggdrop1.7/src/Makefile.am	Fri Oct 12 10:50:25 2001
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.4 2001/10/11 18:24:01 tothwolf Exp $
+# $Id: Makefile.am,v 1.5 2001/10/12 15:50:25 tothwolf Exp $
 
 # FIXME: optionally allow a system wide install by ignoring the line below.
 bindir    = $(exec_prefix)
@@ -30,6 +30,7 @@
 		cmdt.h \
 		dcc.c \
 		dccutil.c \
+		debug.h \
 		dns.c \
 		dns.h \
 		eggdrop.h \
Index: eggdrop1.7/src/botnet.c
diff -u eggdrop1.7/src/botnet.c:1.43 eggdrop1.7/src/botnet.c:1.44
--- eggdrop1.7/src/botnet.c:1.43	Thu Oct 11 21:27:45 2001
+++ eggdrop1.7/src/botnet.c	Fri Oct 12 10:50:25 2001
@@ -7,7 +7,7 @@
  *   linking, unlinking, and relaying to another bot
  *   pinging the bots periodically and checking leaf status
  *
- * $Id: botnet.c,v 1.43 2001/10/12 02:27:45 stdarg Exp $
+ * $Id: botnet.c,v 1.44 2001/10/12 15:50:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -986,7 +986,7 @@
       rembot(tandbot->bot);
     while (parties) {
       parties--;
-      /* Assert? */
+      /* assert? */
       if (party[i].chan >= 0) {
         check_tcl_chpt(party[i].bot, party[i].nick, party[i].sock,
 		       party[i].chan);
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.71 eggdrop1.7/src/cmds.c:1.72
--- eggdrop1.7/src/cmds.c:1.71	Thu Oct 11 06:34:19 2001
+++ eggdrop1.7/src/cmds.c	Fri Oct 12 10:50:25 2001
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  *
- * $Id: cmds.c,v 1.71 2001/10/11 11:34:19 tothwolf Exp $
+ * $Id: cmds.c,v 1.72 2001/10/12 15:50:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1494,7 +1494,7 @@
    * chan: pointer to channel structure, NULL if none found or none specified
    * chg:  pointer to changes, NULL if none specified
    */
-  Assert(!(!arg && chan));
+  assert(!(!arg && chan));
   if (arg && !chan) {
     dprintf(idx, "No channel record for %s.\n", arg);
     return;
@@ -1684,7 +1684,7 @@
    * chan: pointer to channel structure, NULL if none found or none specified
    * chg:  pointer to changes, NULL if none specified
    */
-  Assert(!(!arg && chan));
+  assert(!(!arg && chan));
   if (arg && !chan) {
     dprintf(idx, "No channel record for %s.\n", arg);
     return;
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.58 eggdrop1.7/src/dcc.c:1.59
--- eggdrop1.7/src/dcc.c:1.58	Thu Oct 11 06:34:19 2001
+++ eggdrop1.7/src/dcc.c	Fri Oct 12 10:50:26 2001
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.58 2001/10/11 11:34:19 tothwolf Exp $
+ * $Id: dcc.c,v 1.59 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1233,7 +1233,7 @@
 {
   register int idx;
 
-  Assert(who);
+  assert(who);
   for (idx = 0; idx < dcc_total; idx++)
     if ((dcc[idx].type == &DCC_DUPWAIT) &&
 	!egg_strcasecmp(dcc[idx].nick, who)) {
Index: eggdrop1.7/src/debug.h
diff -u /dev/null eggdrop1.7/src/debug.h:1.1
--- /dev/null	Fri Oct 12 10:50:37 2001
+++ eggdrop1.7/src/debug.h	Fri Oct 12 10:50:26 2001
@@ -0,0 +1,38 @@
+/*
+ * debug.h
+ *   assert debugging
+ */
+/*
+ * Copyright (C) 2001 Eggheads Development Team
+ *
+ * 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
+ * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+#ifndef _EGG_DEBUG_H
+#define _EGG_DEBUG_H
+
+#ifdef DEBUG
+# undef NDEBUG
+/*
+ * Some pre-ANSI implementations (e.g. SunOS 4)
+ * need stderr defined if assertion checking is enabled.
+ */
+# include <stdio.h>		
+# include <assert.h>
+#else				/* !DEBUG */
+# undef assert
+# define assert(e)
+#endif				/* DEBUG */
+
+#endif				/* !_EGG_DEBUG_H */
Index: eggdrop1.7/src/eggdrop.h
diff -u eggdrop1.7/src/eggdrop.h:1.45 eggdrop1.7/src/eggdrop.h:1.46
--- eggdrop1.7/src/eggdrop.h:1.45	Thu Oct 11 08:01:35 2001
+++ eggdrop1.7/src/eggdrop.h	Fri Oct 12 10:50:26 2001
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.45 2001/10/11 13:01:35 tothwolf Exp $
+ * $Id: eggdrop.h,v 1.46 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -84,23 +84,12 @@
 #  include <libintl.h>
 #  define _(x) gettext(x)
 
-/* Have to use a weird way to make the compiler error out cos not all
- * compilers support #error or error
- */
-#if !HAVE_VSPRINTF
-#  include "error_you_need_vsprintf_to_compile_eggdrop"
-#endif
-
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
 
 #define ADDRLEN (ADDRMAX + 1)
 
-#if !defined(STDC_HEADERS)
-#  include "you_need_to_upgrade_your_compiler_to_a_standard_c_one_mate!"
-#endif
-
 #if (NICKMAX < 9) || (NICKMAX > 32)
 #  include "invalid NICKMAX value"
 #endif
@@ -136,15 +125,15 @@
 #  endif
 #endif
 
-#if !HAVE_SRANDOM
+#ifndef HAVE_SRANDOM
 #  define srandom(x) srand(x)
 #endif
 
-#if !HAVE_RANDOM
+#ifndef HAVE_RANDOM
 #  define random() (rand()/16)
 #endif
 
-#if !HAVE_SIGACTION		/* old "weird signals" */
+#ifndef HAVE_SIGACTION		/* old "weird signals" */
 #  define sigaction sigvec
 #  ifndef sa_handler
 #    define sa_handler sv_handler
@@ -153,7 +142,7 @@
 #  endif
 #endif
 
-#if !HAVE_SIGEMPTYSET
+#ifndef HAVE_SIGEMPTYSET
 /* and they probably won't have sigemptyset, dammit */
 #  define sigemptyset(x) ((*(int *)(x))=0)
 #endif
@@ -193,15 +182,6 @@
 #else
 #  define Context		{}
 #  define ContextNote(note)	{}
-#endif
-
-#ifdef DEBUG_ASSERT
-#  define Assert(expr)	do {						\
-	if (!(expr))							\
-		eggAssert(__FILE__, __LINE__, NULL);			\
-} while (0)
-#else
-#  define Assert(expr)	do {	} while (0)
 #endif
 
 /* 32 bit type */
Index: eggdrop1.7/src/irccmp.c
diff -u eggdrop1.7/src/irccmp.c:1.1 eggdrop1.7/src/irccmp.c:1.2
--- eggdrop1.7/src/irccmp.c:1.1	Thu Oct 11 13:24:01 2001
+++ eggdrop1.7/src/irccmp.c	Fri Oct 12 10:50:26 2001
@@ -2,7 +2,7 @@
  * irccmp.c
  *   heavily based on code from src/match.c in ircd-hybrid
  *
- * $Id: irccmp.c,v 1.1 2001/10/11 18:24:01 tothwolf Exp $
+ * $Id: irccmp.c,v 1.2 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1990 Jarkko Oikarinen
@@ -57,8 +57,8 @@
   const unsigned char* str1 = (const unsigned char*) s1;
   const unsigned char* str2 = (const unsigned char*) s2;
   int   res;
-/*  assert(0 != s1); */
-/*  assert(0 != s2); */
+  assert(0 != s1);
+  assert(0 != s2);
 
   while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0) {
     if (*str1 == '\0')
@@ -74,8 +74,8 @@
   const unsigned char* str1 = (const unsigned char*) s1;
   const unsigned char* str2 = (const unsigned char*) s2;
   int res;
-/*  assert(0 != s1); */
-/*  assert(0 != s2); */
+  assert(0 != s1);
+  assert(0 != s2);
 
   while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0) {
     str1++;
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.80 eggdrop1.7/src/main.c:1.81
--- eggdrop1.7/src/main.c:1.80	Thu Oct 11 21:27:45 2001
+++ eggdrop1.7/src/main.c	Fri Oct 12 10:50:26 2001
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.80 2001/10/12 02:27:45 stdarg Exp $
+ * $Id: main.c,v 1.81 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -412,22 +412,6 @@
 }
 #endif
 
-#ifdef DEBUG_ASSERT
-/* Called from the Assert macro.
- */
-void eggAssert(const char *file, int line, const char *module)
-{
-#ifdef DEBUG_CONTEXT
-  write_debug();
-#endif
-  if (!module)
-    putlog(LOG_MISC, "*", "* In file %s, line %u", file, line);
-  else
-    putlog(LOG_MISC, "*", "* In file %s:%s, line %u", module, file, line);
-  fatal("ASSERT FAILED -- CRASHING!", 1);
-}
-#endif
-
 static void do_arg(char *s)
 {
   char x[1024], *z = x;
@@ -683,7 +667,7 @@
   struct sigaction sv;
   struct chanset_t *chan;
 
-#ifdef DEBUG_ASSERT
+#ifdef DEBUG
   /* Make sure it can write core, if you make debug. Else it's pretty
    * useless (dw)
    */
Index: eggdrop1.7/src/main.h
diff -u eggdrop1.7/src/main.h:1.20 eggdrop1.7/src/main.h:1.21
--- eggdrop1.7/src/main.h:1.20	Wed Oct 10 05:44:04 2001
+++ eggdrop1.7/src/main.h	Fri Oct 12 10:50:26 2001
@@ -2,7 +2,7 @@
  * main.h
  *   include file to include most other include files
  *
- * $Id: main.h,v 1.20 2001/10/10 10:44:04 tothwolf Exp $
+ * $Id: main.h,v 1.21 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -57,6 +57,7 @@
 #endif
 #include <sys/types.h>
 #include "lush.h"
+#include "debug.h"
 #include "eggdrop.h"
 #include "flags.h"
 #ifndef MAKING_MODS
Index: eggdrop1.7/src/mod/module.h
diff -u eggdrop1.7/src/mod/module.h:1.62 eggdrop1.7/src/mod/module.h:1.63
--- eggdrop1.7/src/mod/module.h:1.62	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/mod/module.h	Fri Oct 12 10:50:26 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.62 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: module.h,v 1.63 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -50,7 +50,6 @@
 #undef dprintf
 #undef Context
 #undef ContextNote
-#undef Assert
 
 /* Compability functions. */
 #ifdef egg_inet_aton
@@ -377,14 +376,7 @@
 #else
 #  define ContextNote(note)	do {	} while (0)
 #endif
-#ifdef DEBUG_ASSERT
-#  define Assert(expr)		do {					\
-	if (!(expr))							\
-		(global[233](__FILE__, __LINE__, MODULE_NAME));		\
-} while (0)
-#else
-#  define Assert(expr)	do {	} while (0)
-#endif
+/* 233: Assert -- UNUSED (Tothwolf) */
 #define allocsock ((int(*)(int sock,int options))global[234])
 #define call_hostbyip ((void(*)(char *, char *, int))global[235])
 /* 236 - 239 */
Index: eggdrop1.7/src/mod/modvals.h
diff -u eggdrop1.7/src/mod/modvals.h:1.24 eggdrop1.7/src/mod/modvals.h:1.25
--- eggdrop1.7/src/mod/modvals.h:1.24	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/mod/modvals.h	Fri Oct 12 10:50:26 2001
@@ -1,7 +1,7 @@
 /*
  * modvals.h
  *
- * $Id: modvals.h,v 1.24 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: modvals.h,v 1.25 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -95,9 +95,6 @@
   lt_dlhandle		hand;
 #endif		/* STATIC */
   Function		*funcs;
-#  ifdef DEBUG_MEM
-  int			 mem_work;
-#  endif	/* DEBUG_MEM */
 } module_entry;
 
 #endif		/* _EGG_MOD_MODVALS_H */
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.66 eggdrop1.7/src/modules.c:1.67
--- eggdrop1.7/src/modules.c:1.66	Fri Oct 12 02:45:48 2001
+++ eggdrop1.7/src/modules.c	Fri Oct 12 10:50:26 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.66 2001/10/12 07:45:48 tothwolf Exp $
+ * $Id: modules.c,v 1.67 2001/10/12 15:50:26 tothwolf Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -451,11 +451,7 @@
 #else
   (Function) 0,
 #endif
-#ifdef DEBUG_ASSERT
-  (Function) eggAssert,
-#else
   (Function) 0,
-#endif
   (Function) allocsock,
   (Function) call_hostbyip,
   /* 236 - 239 */
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.44 eggdrop1.7/src/net.c:1.45
--- eggdrop1.7/src/net.c:1.44	Thu Oct 11 21:27:45 2001
+++ eggdrop1.7/src/net.c	Fri Oct 12 10:50:26 2001
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.44 2001/10/12 02:27:45 stdarg Exp $
+ * $Id: net.c,v 1.45 2001/10/12 15:50:26 tothwolf Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -1337,7 +1337,7 @@
   int i, len;
   char *inbuf;
 
-  Assert((idx >= 0) && (idx < dcc_total));
+  assert((idx >= 0) && (idx < dcc_total));
   for (i = 0; i < MAXSOCKS; i++) {
     if ((dcc[idx].sock == socklist[i].sock)
         && !(socklist[i].flags & SOCK_UNUSED)) {
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.54 eggdrop1.7/src/proto.h:1.55
--- eggdrop1.7/src/proto.h:1.54	Fri Oct 12 02:45:48 2001
+++ eggdrop1.7/src/proto.h	Fri Oct 12 10:50:26 2001
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.54 2001/10/12 07:45:48 tothwolf Exp $
+ * $Id: proto.h,v 1.55 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -165,7 +165,6 @@
 void patch(const char *);
 void eggContext(const char *, int, const char *);
 void eggContextNote(const char *, int, const char *, const char *);
-void eggAssert(const char *, int, const char *);
 void backup_userfile(void);
 
 /* misc.c */
Index: eggdrop1.7/src/tcl.c
diff -u eggdrop1.7/src/tcl.c:1.44 eggdrop1.7/src/tcl.c:1.45
--- eggdrop1.7/src/tcl.c:1.44	Thu Oct 11 21:27:45 2001
+++ eggdrop1.7/src/tcl.c	Fri Oct 12 10:50:26 2001
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.44 2001/10/12 02:27:45 stdarg Exp $
+ * $Id: tcl.c,v 1.45 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -503,7 +503,7 @@
   /* Initialize the interpreter */
   interp = Tcl_CreateInterp();
 
-#ifdef DEBUG_TCL
+#ifdef DEBUG
   /* Initialize Tcl's memory debugging if we want it */
   Tcl_InitMemory(interp);
 #endif
Index: eggdrop1.7/src/tclhash.c
diff -u eggdrop1.7/src/tclhash.c:1.43 eggdrop1.7/src/tclhash.c:1.44
--- eggdrop1.7/src/tclhash.c:1.43	Thu Oct 11 21:27:45 2001
+++ eggdrop1.7/src/tclhash.c	Fri Oct 12 10:50:26 2001
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.43 2001/10/12 02:27:45 stdarg Exp $
+ * $Id: tclhash.c,v 1.44 2001/10/12 15:50:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -241,7 +241,7 @@
 
   /* Do not allow coders to use bind table names longer than
      4 characters. */
-  Assert(strlen(nme) <= 4);
+  assert(strlen(nme) <= 4);
 
   for (tl = bind_table_list, tl_prev = NULL; tl; tl_prev = tl, tl = tl->next) {
     if (tl->flags & HT_DELETED)
----------------------- End of diff -----------------------



More information about the Changes mailing list