ソースを参照

* Removed all Assert()/DEBUG_ASSERT code

svn: 1916
Bryan Drewery 21 年 前
コミット
cfc68ced0b
8 ファイル変更1 行追加33 行削除
  1. 1 1
      Makefile.in
  2. 0 1
      src/botnet.c
  3. 0 1
      src/cmds.c
  4. 0 1
      src/dcc.c
  5. 0 13
      src/debug.c
  6. 0 10
      src/debug.h
  7. 0 1
      src/tclhash.c
  8. 0 5
      src/userent.c

+ 1 - 1
Makefile.in

@@ -32,7 +32,7 @@ DIFF = @DIFF@
 #LIBS = @LIBS@ @ZLIB@ @SSL@ 
 LIBS = @LIBS@ @ZLIB@ 
 
-DEBCXXFLAGS = -DDEBUG_ASSERT -DDEBUG -Dinline= -fno-inline -g3 -ggdb3
+DEBCXXFLAGS = -DDEBUG -Dinline= -fno-inline -g3 -ggdb3
 CFLGS = @GCC3@
 _CFLGS = -fno-strict-aliasing -W -Wformat \
 #-Wshadow -Wnested-externs -Wno-format-y2k \

+ 0 - 1
src/botnet.c

@@ -933,7 +933,6 @@ int botunlink(int idx, char *nick, char *reason)
       rembot(tandbot->bot);
     while (parties) {
       parties--;
-      /* Assert? */
     }
   }
   return 0;

+ 0 - 1
src/cmds.c

@@ -2344,7 +2344,6 @@ static void cmd_chattr(int idx, char *par)
    * chan: pointer to channel structure, NULL if none found or none specified
    * chg:  pointer to changes, NULL if none specified
    */
-  Assert(!(!arg && chan));
   if (arg && !chan) {
     dprintf(idx, "No channel record for %s.\n", arg);
     return;

+ 0 - 1
src/dcc.c

@@ -1477,7 +1477,6 @@ struct dcc_table DCC_DUPWAIT = {
 void
 dupwait_notify(const char *who)
 {
-  Assert(who);
   for (register int idx = 0; idx < dcc_total; idx++)
     if (dcc[idx].type && (dcc[idx].type == &DCC_DUPWAIT) && !egg_strcasecmp(dcc[idx].nick, who)) {
       dcc_telnet_pass(idx, dcc[idx].u.dupwait->atr);

+ 0 - 13
src/debug.c

@@ -333,16 +333,3 @@ void eggContextNote(const char *file, int line, const char *note)
 }
 #endif
 
-#ifdef DEBUG_ASSERT
-/* Called from the Assert macro.
- */
-void eggAssert(const char *file, int line)
-{
-  putlog(LOG_MISC, "*", "* In file %s, line %u", file, line);
-
-#ifdef DEBUG_CONTEXT
-  write_debug();
-#endif /* DEBUG_CONTEXT */
-  fatal("ASSERT FAILED -- CRASHING!", 1);
-}
-#endif /* DEBUG_ASSERT */

+ 0 - 10
src/debug.h

@@ -23,15 +23,6 @@
 #  define ContextNote(note)     {}
 #endif
 
-#ifdef DEBUG_ASSERT
-#  define Assert(expr)  do {                                            \
-        if (!(expr))                                                    \
-                eggAssert(__FILE__, __LINE__);                          \
-} while (0)
-#else
-#  define Assert(expr)  do {    } while (0)
-#endif
-
 #define debug0(x)               putlog(LOG_DEBUG,"*",x)
 #define debug1(x,a1)            putlog(LOG_DEBUG,"*",x,a1)
 #define debug2(x,a1,a2)         putlog(LOG_DEBUG,"*",x,a1,a2)
@@ -48,6 +39,5 @@ void init_signals();
 void init_debug();
 void eggContext(const char *, int);
 void eggContextNote(const char *, int, const char *);
-void eggAssert(const char *, int);
 
 #endif /* !_DEBUG_H */

+ 0 - 1
src/tclhash.c

@@ -374,7 +374,6 @@ static int bind_vcheck_hits (bind_table_t *table, const char *match, struct flag
 	int cmp, retval, tie = 0;
         size_t matchlen = 0;
 
-	Assert(table);
 	check_bind_executing++;
 
 	for (int i = 1; i <= table->nargs; i++) {

+ 0 - 5
src/userent.c

@@ -702,8 +702,6 @@ static bool botaddr_unpack(struct userrec *u, struct user_entry *e)
 
   /* address:port/port:hublevel:uplink */
   Context;
-  Assert(e);
-  Assert(e->name);
 
   strcpy(p, e->u.list->extra);
   q1 = strchr(p, ':');
@@ -770,9 +768,7 @@ static bool botaddr_set(struct userrec *u, struct user_entry *e, void *buf)
     return 1;
   if (bi != buf) {
     if (bi) {
-      Assert(bi->address);
       free(bi->address);
-      Assert(bi->uplink);
       free(bi->uplink);
       free(bi);
     }
@@ -780,7 +776,6 @@ static bool botaddr_set(struct userrec *u, struct user_entry *e, void *buf)
     bi = (struct bot_addr *) buf;
     e->u.extra = (struct bot_addr *) buf;
   }
-  Assert(u);
   if (bi && !noshare) {
     shareout("c BOTADDR %s %s %d %d %d %s\n",u->handle, 
             (bi->address && bi->address[0]) ? bi->address : "127.0.0.1",