From 807294294849e4589526619e98bcc150adc9ac66 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Sun, 10 Oct 2010 21:00:27 +0200 Subject: [PATCH] Centralized assert.h include to make use of assertions more convenient. --- .gitattributes | 11 ----------- src/builtin.cmod | 3 +-- src/dlopen.c | 3 +-- src/gc.c | 3 +-- src/global.h | 2 ++ src/interpret.c | 3 +-- src/multiset.c | 4 +--- src/pike_search.c | 4 +--- src/post_modules/GSSAPI/gssapi.cmod | 4 +--- src/post_modules/Nettle/cipher.cmod | 3 +-- src/post_modules/Nettle/hash.cmod | 3 +-- src/post_modules/Nettle/nettle.cmod | 3 +-- src/rbtree.c | 3 +-- src/threads.c | 1 - 14 files changed, 13 insertions(+), 37 deletions(-) diff --git a/.gitattributes b/.gitattributes index 6d5fc39814..19660e0907 100644 --- a/.gitattributes +++ b/.gitattributes @@ -345,7 +345,6 @@ testfont binary /src/bignum.h foreign_ident /src/block_alloc.h foreign_ident /src/block_alloc_h.h foreign_ident -/src/builtin.cmod foreign_ident /src/builtin_functions.c foreign_ident /src/builtin_functions.h foreign_ident /src/callback.c foreign_ident @@ -372,7 +371,6 @@ testfont binary /src/crypt.c foreign_ident /src/cyclic.c foreign_ident /src/cyclic.h foreign_ident -/src/dlopen.c foreign_ident /src/dmalloc.h foreign_ident /src/docode.h foreign_ident /src/dumpmaster.pike foreign_ident @@ -393,12 +391,10 @@ testfont binary /src/fsort.c foreign_ident /src/fsort.h foreign_ident /src/fsort_template.h foreign_ident -/src/gc.c foreign_ident /src/gc.h foreign_ident /src/hashtable.c foreign_ident /src/hashtable.h foreign_ident /src/install-sh foreign_ident -/src/interpret.c foreign_ident /src/interpret.h foreign_ident /src/interpreter.h foreign_ident /src/iterators.cmod foreign_ident @@ -768,7 +764,6 @@ testfont binary /src/modules/system/system.c foreign_ident /src/modules/system/system.h foreign_ident /src/modules/system/testsuite.in foreign_ident -/src/multiset.c foreign_ident /src/multiset.h foreign_ident /src/object.c foreign_ident /src/object.h foreign_ident @@ -793,7 +788,6 @@ testfont binary /src/pike_memory.h foreign_ident /src/pike_netlib.h foreign_ident /src/pike_rusage.h foreign_ident -/src/pike_search.c foreign_ident /src/pike_search.h foreign_ident /src/pike_search_engine.c foreign_ident /src/pike_search_engine2.c foreign_ident @@ -825,7 +819,6 @@ testfont binary /src/post_modules/GSSAPI/Makefile.in foreign_ident /src/post_modules/GSSAPI/acconfig.h foreign_ident /src/post_modules/GSSAPI/configure.in foreign_ident -/src/post_modules/GSSAPI/gssapi.cmod foreign_ident /src/post_modules/GTK/acconfig.h foreign_ident /src/post_modules/GTK/dummy.c foreign_ident /src/post_modules/GTK/gdkeventstrings.h foreign_ident @@ -842,13 +835,10 @@ testfont binary /src/post_modules/GTK2/source/support.c foreign_ident /src/post_modules/Makefile.in foreign_ident /src/post_modules/Nettle/Makefile.in foreign_ident -/src/post_modules/Nettle/cipher.cmod foreign_ident /src/post_modules/Nettle/configure.in foreign_ident /src/post_modules/Nettle/crypt_md5.c foreign_ident -/src/post_modules/Nettle/hash.cmod foreign_ident /src/post_modules/Nettle/idea.c foreign_ident /src/post_modules/Nettle/idea.h foreign_ident -/src/post_modules/Nettle/nettle.cmod foreign_ident /src/post_modules/Nettle/nt.cmod foreign_ident /src/post_modules/Nettle/rijndaeltest.pike foreign_ident /src/post_modules/SDL/Makefile.in foreign_ident @@ -900,7 +890,6 @@ testfont binary /src/program_id.h foreign_ident /src/queue.c foreign_ident /src/queue.h foreign_ident -/src/rbtree.c foreign_ident /src/rbtree.h foreign_ident /src/rbtree_low.h foreign_ident /src/run_autoconfig foreign_ident diff --git a/src/builtin.cmod b/src/builtin.cmod index b9f779e10f..66aa993d34 100644 --- a/src/builtin.cmod +++ b/src/builtin.cmod @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: builtin.cmod,v 1.259 2010/06/22 09:24:35 mast Exp $ +|| $Id$ */ #include "global.h" @@ -32,7 +32,6 @@ #include "block_alloc.h" #include "pikecode.h" -#include <assert.h> #include <ctype.h> #include <errno.h> #include <math.h> diff --git a/src/dlopen.c b/src/dlopen.c index 9561c925bf..cce4b5f992 100644 --- a/src/dlopen.c +++ b/src/dlopen.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: dlopen.c,v 1.76 2006/07/05 19:06:46 mast Exp $ +|| $Id$ */ /* Note: This is not used if --enable-dll is. */ @@ -25,7 +25,6 @@ #include <windows.h> #include <memory.h> #include <sys/stat.h> -#include <assert.h> #include <math.h> #include <tchar.h> #include <interpret.h> diff --git a/src/gc.c b/src/gc.c index 471488366e..774a810788 100644 --- a/src/gc.c +++ b/src/gc.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: gc.c,v 1.351 2010/07/15 22:31:18 mast Exp $ +|| $Id$ */ #include "global.h" @@ -30,7 +30,6 @@ struct callback *gc_evaluator_callback=0; #include "main.h" #include <math.h> -#include <assert.h> #include "block_alloc.h" diff --git a/src/global.h b/src/global.h index 7b7dbcf429..5bf8caf719 100644 --- a/src/global.h +++ b/src/global.h @@ -540,6 +540,8 @@ typedef struct p_wchar_p #endif /* !PIKE_DEBUG */ +#include <assert.h> + #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP) #define DO_IF_DEBUG_OR_CLEANUP(X) X #else diff --git a/src/interpret.c b/src/interpret.c index 15a14e0d6e..c785cb0dbe 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: interpret.c,v 1.414 2010/01/21 15:39:58 grubba Exp $ +|| $Id$ */ #include "global.h" @@ -38,7 +38,6 @@ #include <fcntl.h> #include <errno.h> #include <ctype.h> -#include <assert.h> #ifdef HAVE_MMAP #ifdef HAVE_SYS_TYPES_H diff --git a/src/multiset.c b/src/multiset.c index 6d28e68d93..2ebd755d6f 100644 --- a/src/multiset.c +++ b/src/multiset.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: multiset.c,v 1.122 2010/07/19 15:49:25 mast Exp $ +|| $Id$ */ #include "global.h" @@ -36,8 +36,6 @@ * objects are involved!) Well.. Although cheap I suspect it pays off * so extremely seldom that it isn't worth it. /mast */ -#include <assert.h> - #define sp Pike_sp /* The following defines the allocation policy. It's almost the same diff --git a/src/pike_search.c b/src/pike_search.c index 41627ef3b3..2a2c1f9d57 100644 --- a/src/pike_search.c +++ b/src/pike_search.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: pike_search.c,v 1.31 2008/06/29 12:37:10 nilsson Exp $ +|| $Id$ */ /* New memory searcher functions */ @@ -20,8 +20,6 @@ #include "pike_search.h" #include "bignum.h" -#include <assert.h> - ptrdiff_t pike_search_struct_offset; #define OB2MSEARCH(O) ((struct pike_mem_searcher *)((O)->storage+pike_search_struct_offset)) #define THIS_MSEARCH ((struct pike_mem_searcher *)(Pike_fp->current_storage)) diff --git a/src/post_modules/GSSAPI/gssapi.cmod b/src/post_modules/GSSAPI/gssapi.cmod index 02b87f98fa..f6346c0fcb 100644 --- a/src/post_modules/GSSAPI/gssapi.cmod +++ b/src/post_modules/GSSAPI/gssapi.cmod @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: gssapi.cmod,v 1.12 2008/08/11 17:37:34 mast Exp $ +|| $Id$ */ /* @@ -36,8 +36,6 @@ #include "global.h" #include "gssapi_config.h" -#include <assert.h> - #include "bignum.h" #include "builtin_functions.h" #include "dmalloc.h" diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod index 52eeda6f42..7e099d1368 100644 --- a/src/post_modules/Nettle/cipher.cmod +++ b/src/post_modules/Nettle/cipher.cmod @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: cipher.cmod,v 1.41 2009/07/02 16:35:38 grubba Exp $ +|| $Id$ */ #include "global.h" @@ -38,7 +38,6 @@ DECLARATIONS #include "idea.h" #include <nettle/nettle-meta.h> -#include <assert.h> #include <stdio.h> #include <stdarg.h> diff --git a/src/post_modules/Nettle/hash.cmod b/src/post_modules/Nettle/hash.cmod index 1e59e2c755..7b5e0d4deb 100644 --- a/src/post_modules/Nettle/hash.cmod +++ b/src/post_modules/Nettle/hash.cmod @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: hash.cmod,v 1.35 2010/06/21 12:35:35 mast Exp $ +|| $Id$ */ #include "global.h" @@ -30,7 +30,6 @@ DECLARATIONS #include <nettle/sha.h> #include <nettle/nettle-meta.h> -#include <assert.h> #include <stdio.h> #include <stdarg.h> #include "fdlib.h" diff --git a/src/post_modules/Nettle/nettle.cmod b/src/post_modules/Nettle/nettle.cmod index b71225564b..0dab1cbfb2 100644 --- a/src/post_modules/Nettle/nettle.cmod +++ b/src/post_modules/Nettle/nettle.cmod @@ -1,5 +1,5 @@ /* nettle.cmod -*- c -*- */ -/* $Id: nettle.cmod,v 1.58 2010/06/22 14:30:13 grubba Exp $ */ +/* $Id$ */ #include "global.h" #include "interpret.h" @@ -19,7 +19,6 @@ #include <nettle/yarrow.h> #include <nettle/knuth-lfib.h> -#include <assert.h> #include <stdio.h> #include <stdarg.h> diff --git a/src/rbtree.c b/src/rbtree.c index 8bdf97389c..404e7d9c6c 100644 --- a/src/rbtree.c +++ b/src/rbtree.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: rbtree.c,v 1.26 2009/04/06 00:34:16 mast Exp $ +|| $Id$ */ /* An implementation of a threaded red/black balanced binary tree. @@ -16,7 +16,6 @@ #include "pike_error.h" #include "rbtree_low.h" -#include <assert.h> #include <stdlib.h> #if defined (PIKE_DEBUG) || defined (TEST_MULTISET) diff --git a/src/threads.c b/src/threads.c index 5766dcae3d..aa8267d968 100644 --- a/src/threads.c +++ b/src/threads.c @@ -38,7 +38,6 @@ #include "backend.h" #include "pike_rusage.h" -#include <assert.h> #include <errno.h> #ifdef HAVE_SYS_PRCTL_H -- GitLab