Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make ivl_alloc.h the last include so it doesn't effect any system inc…

…ludes.

In ivl_alloc.h we redefine malloc(), realloc() and calloc() to have
standard error checking. We don't want to do this for anything that
comes from the standard headers. This specifically doesn't work if
a C++ header files does std::malloc, etc.

Also change to -W instead of -Wextra since that is more portable. I
plan to add a check from -Wextra and use it when available since it
is more descriptive.
  • Loading branch information...
commit a4a7b0a09d2b91ab0f6dcdbe1354d87b748c9398 1 parent 225ca1e
@caryr caryr authored steveicarus committed
Showing with 88 additions and 79 deletions.
  1. +1 −1  StringHeap.cc
  2. +1 −1  cadpli/cadpli.c
  3. +1 −1  configure.in
  4. +5 −6 driver/main.c
  5. +1 −1  driver/substit.c
  6. +1 −1  ivlpp/lexor.lex
  7. +1 −1  ivlpp/main.c
  8. +1 −1  libveriuser/a_vcl.c
  9. +1 −1  libveriuser/veriusertfs.c
  10. +1 −1  libveriuser/workarea.c
  11. +1 −1  load_module.cc
  12. +2 −1  main.cc
  13. +1 −1  net_link.cc
  14. +1 −1  pform.cc
  15. +1 −1  t-dll-analog.cc
  16. +1 −1  t-dll-api.cc
  17. +1 −1  t-dll-expr.cc
  18. +1 −1  t-dll-proc.cc
  19. +1 −1  t-dll.cc
  20. +1 −1  tgt-fpga/d-generic-edif.c
  21. +1 −1  tgt-fpga/edif.c
  22. +1 −1  tgt-fpga/mangle.c
  23. +1 −1  tgt-fpga/xilinx.c
  24. +1 −1  tgt-pal/emit_jed.c
  25. +1 −1  tgt-pal/fit_log.c
  26. +1 −1  tgt-pal/imain.c
  27. +1 −1  tgt-stub/stub.c
  28. +1 −1  tgt-vvp/draw_net_input.c
  29. +1 −1  tgt-vvp/draw_vpi.c
  30. +1 −1  tgt-vvp/eval_expr.c
  31. +1 −1  tgt-vvp/modpath.c
  32. +1 −1  tgt-vvp/vvp_scope.c
  33. +1 −1  vpi/sdf_parse.y
  34. +1 −1  vpi/stringheap.c
  35. +1 −1  vpi/sys_display.c
  36. +1 −1  vpi/sys_fileio.c
  37. +1 −1  vpi/sys_fst.c
  38. +1 −1  vpi/sys_lxt.c
  39. +1 −1  vpi/sys_lxt2.c
  40. +1 −1  vpi/sys_priv.c
  41. +1 −1  vpi/sys_random_mti.c
  42. +1 −1  vpi/sys_readmem.c
  43. +1 −1  vpi/sys_scanf.c
  44. +1 −1  vpi/sys_vcd.c
  45. +1 −1  vpi/v2005_math.c
  46. +1 −1  vpi/va_math.c
  47. +1 −1  vvp/array.cc
  48. +3 −2 vvp/compile.cc
  49. +2 −2 vvp/delay.cc
  50. +1 −1  vvp/lexor.lex
  51. +1 −1  vvp/parse.y
  52. +1 −1  vvp/parse_misc.cc
  53. +1 −1  vvp/stop.cc
  54. +4 −4 vvp/udp.cc
  55. +1 −1  vvp/vpi_const.cc
  56. +1 −1  vvp/vpi_event.cc
  57. +1 −1  vvp/vpi_iter.cc
  58. +1 −1  vvp/vpi_mcd.cc
  59. +1 −1  vvp/vpi_modules.cc
  60. +1 −1  vvp/vpi_real.cc
  61. +1 −1  vvp/vpi_scope.cc
  62. +1 −1  vvp/vpi_signal.cc
  63. +1 −1  vvp/vpi_tasks.cc
  64. +1 −1  vvp/vpi_vthr_vector.cc
  65. +1 −1  vvp/vpip_to_dec.cc
  66. +1 −1  vvp/vvp_island.cc
  67. +11 −3 vvp/vvp_net.h
View
2  StringHeap.cc
@@ -18,10 +18,10 @@
*/
# include "StringHeap.h"
-# include "ivl_alloc.h"
# include <cstdlib>
# include <cstring>
# include <cassert>
+# include "ivl_alloc.h"
#ifdef CHECK_WITH_VALGRIND
static char **string_pool = NULL;
View
2  cadpli/cadpli.c
@@ -17,7 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-# include "ivl_alloc.h"
# include <vpi_user.h>
# include <veriuser.h>
# include <stdlib.h>
@@ -25,6 +24,7 @@
# include <assert.h>
# include "config.h"
# include "ivl_dlfcn.h"
+# include "ivl_alloc.h"
typedef void* (*funcvp)(void);
View
2  configure.in
@@ -71,7 +71,7 @@ AC_SUBST(WARNING_FLAGS_CXX, [""])
else
AC_SUBST(DEPENDENCY_FLAG, [-MD])
AC_SUBST(WARNING_FLAGS, ["-Wall -Wshadow"])
-AC_SUBST(WARNING_FLAGS_CXX, ["-Wextra"])
+AC_SUBST(WARNING_FLAGS_CXX, ["-W"])
fi
AC_LANG(C++)
View
11 driver/main.c
@@ -50,7 +50,6 @@ const char HELP[] =
#define MAXSIZE 4096
-#include "ivl_alloc.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -64,11 +63,13 @@ const char HELP[] =
#endif
#ifdef __MINGW32__
-#include <windows.h>
+# include <windows.h>
+# include <io.h>
#ifdef HAVE_LIBIBERTY_H
-#include <libiberty.h>
+# include <libiberty.h>
#endif
#endif
+#include <fcntl.h>
#if HAVE_GETOPT_H
#include <getopt.h>
@@ -94,6 +95,7 @@ extern const char*optarg;
# include "globals.h"
#include "cfparse_misc.h" /* cfparse() */
+#include "ivl_alloc.h"
#ifdef __MINGW32__
const char sep = '\\';
@@ -211,8 +213,6 @@ char *get_cmd_file()
}
#ifdef __MINGW32__
-# include <io.h>
-# include <fcntl.h>
static FILE*fopen_safe(const char*path)
{
FILE*file = 0;
@@ -225,7 +225,6 @@ static FILE*fopen_safe(const char*path)
return file;
}
#else
-# include <fcntl.h>
static FILE*fopen_safe(const char*path)
{
FILE*file = 0;
View
2  driver/substit.c
@@ -17,10 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <stdio.h>
+# include "ivl_alloc.h"
char* substitutions(const char*str)
View
2  ivlpp/lexor.lex
@@ -20,7 +20,6 @@
# include "config.h"
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -28,6 +27,7 @@
# include <assert.h>
# include "globals.h"
+# include "ivl_alloc.h"
static void output_init();
#define YY_USER_INIT output_init()
View
2  ivlpp/main.c
@@ -37,7 +37,6 @@ const char NOTICE[] =
" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
;
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
@@ -47,6 +46,7 @@ const char NOTICE[] =
# include <getopt.h>
#endif
# include "globals.h"
+# include "ivl_alloc.h"
#if defined(__MINGW32__) && !defined(HAVE_GETOPT_H)
extern int getopt(int argc, char*argv[], const char*fmt);
View
2  libveriuser/a_vcl.c
@@ -17,12 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include "ivl_alloc.h"
#include <vpi_user.h>
#include <acc_user.h>
#include <stdlib.h>
#include "priv.h"
#include <assert.h>
+#include "ivl_alloc.h"
/*
* This is the structure of a record that I use locally to hold the
View
2  libveriuser/veriusertfs.c
@@ -23,7 +23,6 @@
* via VPI. This is extremely ugly, so don't look after eating dinner.
*/
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
@@ -32,6 +31,7 @@
# include "priv.h"
# include "vpi_user.h"
# include "veriuser.h"
+# include "ivl_alloc.h"
/*
* local structure used to hold the persistent veriusertfs data
View
2  libveriuser/workarea.c
@@ -17,10 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-# include "ivl_alloc.h"
# include <veriuser.h>
# include <vpi_user.h>
# include <stdlib.h>
+# include "ivl_alloc.h"
/*
* Keep a list of sys handle to work area bindings.
View
2  load_module.cc
@@ -21,7 +21,6 @@
# include "util.h"
# include "parse_api.h"
# include "compiler.h"
-# include "ivl_alloc.h"
# include <iostream>
# include <map>
# include <cstdlib>
@@ -31,6 +30,7 @@
# include <dirent.h>
# include <cctype>
# include <cassert>
+# include "ivl_alloc.h"
/*
* The module library items are maps of key names to file name within
View
3  main.cc
@@ -38,7 +38,6 @@ const char NOTICE[] =
" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
;
-# include "ivl_alloc.h"
# include <cstdio>
# include <iostream>
# include <fstream>
@@ -89,6 +88,8 @@ static void signals_handler(int sig)
}
#endif
+# include "ivl_alloc.h"
+
/* Count errors detected in flag processing. */
unsigned flag_errors = 0;
View
2  net_link.cc
@@ -22,12 +22,12 @@
# include <iostream>
# include "netlist.h"
-# include "ivl_alloc.h"
# include <sstream>
# include <cstring>
# include <string>
# include <typeinfo>
# include <cstdlib>
+# include "ivl_alloc.h"
void Nexus::connect(Link&r)
{
View
2  pform.cc
@@ -28,7 +28,6 @@
# include "PGenerate.h"
# include "PSpec.h"
# include "discipline.h"
-# include "ivl_alloc.h"
# include <list>
# include <map>
# include <cassert>
@@ -39,6 +38,7 @@
# include <cstdlib>
# include "ivl_assert.h"
+# include "ivl_alloc.h"
map<perm_string,Module*> pform_modules;
map<perm_string,PUdp*> pform_primitives;
View
2  t-dll-analog.cc
@@ -22,13 +22,13 @@
# include <iostream>
-# include "ivl_alloc.h"
# include <cstring>
# include "target.h"
# include "ivl_target.h"
# include "compiler.h"
# include "t-dll.h"
# include <cstdlib>
+# include "ivl_alloc.h"
bool dll_target::process(const NetAnalogTop*net)
{
View
2  t-dll-api.cc
@@ -21,10 +21,10 @@
# include "StringHeap.h"
# include "t-dll.h"
# include "discipline.h"
-# include "ivl_alloc.h"
# include <cstdlib>
# include <cstdio>
# include <cstring>
+# include "ivl_alloc.h"
static StringHeap api_strings;
View
2  t-dll-expr.cc
@@ -19,7 +19,6 @@
# include "config.h"
-# include "ivl_alloc.h"
# include <iostream>
# include <cstring>
@@ -27,6 +26,7 @@
# include "netlist.h"
# include <cassert>
# include <cstdlib>
+# include "ivl_alloc.h"
/*
* This is a little convenience function for converting a NetExpr
View
2  t-dll-proc.cc
@@ -22,13 +22,13 @@
# include <iostream>
-# include "ivl_alloc.h"
# include <cstring>
# include "target.h"
# include "ivl_target.h"
# include "compiler.h"
# include "t-dll.h"
# include <cstdlib>
+# include "ivl_alloc.h"
bool dll_target::process(const NetProcTop*net)
{
View
2  t-dll.cc
@@ -21,7 +21,6 @@
# include <iostream>
-# include "ivl_alloc.h"
# include <cstring>
# include <cstdio> // sprintf()
# include "compiler.h"
@@ -30,6 +29,7 @@
# include "discipline.h"
# include <cstdlib>
# include "ivl_assert.h"
+# include "ivl_alloc.h"
struct dll_target dll_target_obj;
View
2  tgt-fpga/d-generic-edif.c
@@ -19,10 +19,10 @@
# include "device.h"
# include "fpga_priv.h"
-# include "ivl_alloc.h"
# include <stdlib.h>
# include <string.h>
# include <assert.h>
+# include "ivl_alloc.h"
struct nexus_recall {
struct nexus_recall*next;
View
2  tgt-fpga/edif.c
@@ -18,10 +18,10 @@
*/
# include "edif.h"
-# include "ivl_alloc.h"
# include <stdlib.h>
# include <string.h>
# include <assert.h>
+# include "ivl_alloc.h"
typedef enum property_e {
PRP_NONE = 0,
View
2  tgt-fpga/mangle.c
@@ -18,9 +18,9 @@
*/
# include "fpga_priv.h"
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
+# include "ivl_alloc.h"
static size_t xnf_mangle_scope_name(ivl_scope_t net, char*buf, size_t nbuf)
{
View
2  tgt-fpga/xilinx.c
@@ -21,10 +21,10 @@
# include "generic.h"
# include "xilinx.h"
# include "fpga_priv.h"
-# include "ivl_alloc.h"
# include <stdlib.h>
# include <string.h>
# include <assert.h>
+# include "ivl_alloc.h"
edif_cell_t xilinx_cell_buf(edif_xlibrary_t xlib)
{
View
2  tgt-pal/emit_jed.c
@@ -20,10 +20,10 @@
# include "config.h"
# include "priv.h"
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
+# include "ivl_alloc.h"
static void draw_macrocell_modes(FILE*jfd)
{
View
2  tgt-pal/fit_log.c
@@ -20,11 +20,11 @@
# include "config.h"
# include "ivl_target.h"
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
# include "priv.h"
+# include "ivl_alloc.h"
/*
* By the time we get here, all the flip-flops have been placed in
View
2  tgt-pal/imain.c
@@ -25,10 +25,10 @@
# include "priv.h"
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
+# include "ivl_alloc.h"
extern void dump_final_design(FILE*out);
View
2  tgt-stub/stub.c
@@ -28,11 +28,11 @@
# include "version_tag.h"
# include "config.h"
# include "priv.h"
-# include "ivl_alloc.h"
# include <stdlib.h>
# include <inttypes.h>
# include <string.h>
# include <assert.h>
+# include "ivl_alloc.h"
static const char*version_string =
"Icarus Verilog STUB Code Generator " VERSION " (" VERSION_TAG ")\n\n"
View
2  tgt-vvp/draw_net_input.c
@@ -18,12 +18,12 @@
*/
# include "vvp_priv.h"
-# include "ivl_alloc.h"
# include <stdlib.h>
# include <math.h>
# include <string.h>
# include <inttypes.h>
# include <assert.h>
+# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf
View
2  tgt-vvp/draw_vpi.c
@@ -18,10 +18,10 @@
*/
# include "vvp_priv.h"
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
+# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf
View
2  tgt-vvp/eval_expr.c
@@ -18,10 +18,10 @@
*/
# include "vvp_priv.h"
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
+# include "ivl_alloc.h"
static void draw_eval_expr_dest(ivl_expr_t expr, struct vector_info dest,
int ok_flags);
View
2  tgt-vvp/modpath.c
@@ -18,10 +18,10 @@
*/
# include "vvp_priv.h"
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
+# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf
View
2  tgt-vvp/vvp_scope.c
@@ -18,12 +18,12 @@
*/
# include "vvp_priv.h"
-# include "ivl_alloc.h"
# include <stdlib.h>
# include <math.h>
# include <string.h>
# include <inttypes.h>
# include <assert.h>
+# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf
View
2  vpi/sdf_parse.y
@@ -24,10 +24,10 @@ static void yyerror(const char*msg);
# include "vpi_user.h"
# include "sdf_parse_priv.h"
# include "sdf_priv.h"
-# include "ivl_alloc.h"
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
+# include "ivl_alloc.h"
/* This is the hierarchy separator to use. */
char sdf_use_hchar = '.';
View
2  vpi/stringheap.c
@@ -19,10 +19,10 @@
# include "sys_priv.h"
# include "stringheap.h"
-# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
+# include "ivl_alloc.h"
struct stringheap_cell {
struct stringheap_cell*next;
View
2  vpi/sys_display.c
@@ -18,7 +18,6 @@
*/
# include "sys_priv.h"
-# include "ivl_alloc.h"
# include <assert.h>
# include <string.h>
# include <errno.h>
@@ -26,6 +25,7 @@
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
+# include "ivl_alloc.h"
#define IS_MCD(mcd) !((mcd)>>31&1)
View
2  vpi/sys_fileio.c
@@ -18,13 +18,13 @@
*/
# include "sys_priv.h"
-# include "ivl_alloc.h"
# include <assert.h>
# include <ctype.h>
# include <errno.h>
# include <string.h>
# include <stdio.h>
# include <stdlib.h>
+# include "ivl_alloc.h"
#define IS_MCD(mcd) !((mcd)>>31&1)
View
2  vpi/sys_fst.c
@@ -25,12 +25,12 @@
* This file contains the implementations of the FST related functions.
*/
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
+# include "ivl_alloc.h"
static char *dump_path = NULL;
static struct fstContext *dump_file = NULL;
View
2  vpi/sys_lxt.c
@@ -26,13 +26,13 @@
* This file contains the implementations of the LXT related functions.
*/
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
# include "stringheap.h"
+# include "ivl_alloc.h"
static char *dump_path = NULL;
View
2  vpi/sys_lxt2.c
@@ -26,13 +26,13 @@
* This file contains the implementations of the LXT2 related functions.
*/
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <time.h>
# include "stringheap.h"
# include <assert.h>
+# include "ivl_alloc.h"
static char *dump_path = NULL;
View
2  vpi/sys_priv.c
@@ -18,11 +18,11 @@
*/
#include "sys_priv.h"
-#include "ivl_alloc.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
+#include "ivl_alloc.h"
PLI_UINT64 timerec_to_time64(const struct t_vpi_time*timerec)
{
View
2  vpi/sys_random_mti.c
@@ -20,11 +20,11 @@
# include "sys_priv.h"
# include "sys_random.h"
-# include "ivl_alloc.h"
# include <assert.h>
# include <stdlib.h>
# include <math.h>
# include <limits.h>
+# include "ivl_alloc.h"
/*
* Implement the $random system function using the ``Mersenne
View
2  vpi/sys_readmem.c
@@ -18,7 +18,6 @@
*/
# include "sys_priv.h"
-# include "ivl_alloc.h"
# include <ctype.h>
# include <string.h>
# include <stdlib.h>
@@ -26,6 +25,7 @@
# include <assert.h>
# include "sys_readmem_lex.h"
# include <sys/stat.h>
+# include "ivl_alloc.h"
char **search_list = NULL;
unsigned sl_count = 0;
View
2  vpi/sys_scanf.c
@@ -22,7 +22,6 @@
# define _SVID_SOURCE 1
# include "sys_priv.h"
-# include "ivl_alloc.h"
# include <ctype.h>
# include <errno.h>
# include <string.h>
@@ -30,6 +29,7 @@
# include <stdlib.h>
# include <math.h>
# include <assert.h>
+# include "ivl_alloc.h"
struct byte_source {
const char*str;
View
2  vpi/sys_vcd.c
@@ -24,12 +24,12 @@
* This file contains the implementations of the VCD related functions.
*/
-# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
+# include "ivl_alloc.h"
static char *dump_path = NULL;
static FILE *dump_file = NULL;
View
2  vpi/v2005_math.c
@@ -20,12 +20,12 @@
*/
#include "vpi_config.h"
-#include "ivl_alloc.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "vpi_user.h"
+#include "ivl_alloc.h"
/* Single argument functions. */
typedef struct s_single_data {
View
2  vpi/va_math.c
@@ -20,12 +20,12 @@
*/
#include "vpi_config.h"
-#include "ivl_alloc.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "vpi_user.h"
+#include "ivl_alloc.h"
/*
* Compile time options: (set in the Makefile.)
View
2  vvp/array.cc
@@ -26,13 +26,13 @@
#ifdef CHECK_WITH_VALGRIND
#include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cstdlib>
# include <cstring>
# include <climits>
# include <iostream>
# include "compile.h"
# include <cassert>
+# include "ivl_alloc.h"
unsigned long count_net_arrays = 0;
unsigned long count_net_array_words = 0;
View
5 vvp/compile.cc
@@ -28,7 +28,6 @@
# include "vpi_priv.h"
# include "parse_misc.h"
# include "statistics.h"
-# include "ivl_alloc.h"
# include <iostream>
# include <list>
# include <cstdlib>
@@ -39,6 +38,8 @@
#include <windows.h>
#endif
+# include "ivl_alloc.h"
+
unsigned compile_errors = 0;
/*
@@ -76,7 +77,7 @@ struct opcode_table_s {
enum operand_e argt[OPERAND_MAX];
};
-const static struct opcode_table_s opcode_table[] = {
+static const struct opcode_table_s opcode_table[] = {
{ "%abs/wr", of_ABS_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
{ "%add", of_ADD, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%add/wr", of_ADD_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
View
4 vvp/delay.cc
@@ -24,12 +24,12 @@
#ifdef CHECK_WITH_VALGRIND
#include "vvp_cleanup.h"
#endif
-#include "ivl_alloc.h"
#include <iostream>
#include <cstdlib>
#include <list>
#include <cassert>
#include <cmath>
+#include "ivl_alloc.h"
void vvp_delay_t::calculate_min_delay_()
{
@@ -526,7 +526,7 @@ static vvp_time64_t delay_from_edge(vvp_bit4_t a, vvp_bit4_t b,
vvp_time64_t array[12])
{
typedef delay_edge_t bit4_table4[4];
- const static bit4_table4 edge_table[4] = {
+ static const bit4_table4 edge_table[4] = {
{ DELAY_EDGE_01, DELAY_EDGE_01, DELAY_EDGE_0x, DELAY_EDGE_0z },
{ DELAY_EDGE_10, DELAY_EDGE_10, DELAY_EDGE_1x, DELAY_EDGE_1z },
{ DELAY_EDGE_x0, DELAY_EDGE_x1, DELAY_EDGE_x0, DELAY_EDGE_xz },
View
2  vvp/lexor.lex
@@ -25,9 +25,9 @@
# include "parse_misc.h"
# include "compile.h"
# include "parse.h"
-# include "ivl_alloc.h"
# include <cstring>
# include <cassert>
+# include "ivl_alloc.h"
static char* strdupnew(char const *str)
{
View
2  vvp/parse.y
@@ -22,10 +22,10 @@
# include "parse_misc.h"
# include "compile.h"
# include "delay.h"
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cassert>
+# include "ivl_alloc.h"
/*
* These are bits in the lexor.
View
2  vvp/parse_misc.cc
@@ -19,9 +19,9 @@
# include "parse_misc.h"
# include "compile.h"
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
+# include "ivl_alloc.h"
const char*yypath;
unsigned yyline;
View
2  vvp/stop.cc
@@ -28,7 +28,6 @@
# include "vpi_priv.h"
# include "vthread.h"
# include "schedule.h"
-# include "ivl_alloc.h"
# include <cstdio>
# include <cctype>
#ifdef USE_READLINE
@@ -39,6 +38,7 @@
#endif
# include <cstring>
# include <cstdlib>
+# include "ivl_alloc.h"
struct __vpiScope*stop_current_scope = 0;
bool stop_is_finish; /* When set, $stop acts like $finish (set in main.cc). */
View
8 vvp/udp.cc
@@ -25,15 +25,15 @@
#include "symbols.h"
#include "compile.h"
#include "config.h"
-#ifdef CHECK_WITH_VALGRIND
-#include "vvp_cleanup.h"
-#include "ivl_alloc.h"
-#endif
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <iostream>
+#ifdef CHECK_WITH_VALGRIND
+#include "vvp_cleanup.h"
+#include "ivl_alloc.h"
+#endif
// We may need these later when we build the VPI interface to
// UDP definitions.
View
2  vvp/vpi_const.cc
@@ -23,11 +23,11 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
+# include "ivl_alloc.h"
static int string_get(int code, vpiHandle ref)
{
View
2  vvp/vpi_event.cc
@@ -19,11 +19,11 @@
# include "compile.h"
# include "vpi_priv.h"
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
+# include "ivl_alloc.h"
static int named_event_get(int code, vpiHandle ref)
{
View
2  vvp/vpi_iter.cc
@@ -22,9 +22,9 @@
*/
# include "vpi_priv.h"
-# include "ivl_alloc.h"
# include <cstdlib>
# include <cassert>
+# include "ivl_alloc.h"
static int iterator_free_object(vpiHandle ref)
{
View
2  vvp/vpi_mcd.cc
@@ -22,12 +22,12 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cassert>
# include <cstdarg>
# include <cstdio>
# include <cstdlib>
# include <cstring>
+# include "ivl_alloc.h"
extern FILE* vpi_trace;
View
2  vvp/vpi_modules.cc
@@ -21,11 +21,11 @@
# include "vpi_priv.h"
# include "ivl_dlfcn.h"
# include "vvp_cleanup.h"
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstring>
# include <sys/types.h>
# include <sys/stat.h>
+# include "ivl_alloc.h"
static ivl_dll_t*dll_list = 0;
static unsigned dll_list_cnt = 0;
View
2  vvp/vpi_real.cc
@@ -24,11 +24,11 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
+# include "ivl_alloc.h"
struct __vpiRealVar* vpip_realvar_from_handle(vpiHandle obj)
{
View
2  vvp/vpi_scope.cc
@@ -25,10 +25,10 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cstring>
# include <cstdlib>
# include <cassert>
+# include "ivl_alloc.h"
static vpiHandle *vpip_root_table_ptr = 0;
static unsigned vpip_root_table_cnt = 0;
View
2  vvp/vpi_signal.cc
@@ -31,7 +31,6 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cmath>
# include <iostream>
# include <cstdio>
@@ -42,6 +41,7 @@
#ifdef CHECK_WITH_VALGRIND
# include <valgrind/memcheck.h>
#endif
+# include "ivl_alloc.h"
/*
* Hex digits that represent 4-value bits of Verilog are not as
View
2  vvp/vpi_tasks.cc
@@ -29,11 +29,11 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
+# include "ivl_alloc.h"
static const struct __vpirt vpip_systf_def_rt = {
vpiUserSystf,
View
2  vvp/vpi_vthr_vector.cc
@@ -30,10 +30,10 @@
# include "vvp_cleanup.h"
# include <map>
#endif
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cassert>
+# include "ivl_alloc.h"
struct __vpiVThrVec {
struct __vpiHandle base;
View
2  vvp/vpip_to_dec.cc
@@ -23,13 +23,13 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <cstdio>
# include <cstring>
# include <climits> /* for CHAR_BIT */
# include <cstdlib>
# include <cctype>
# include <cassert>
+# include "ivl_alloc.h"
/* If you are allergic to malloc, you can set a stack memory allocation
* here. Otherwise, malloc() is used for the temporary array, so the
View
2  vvp/vvp_island.cc
@@ -25,12 +25,12 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
-# include "ivl_alloc.h"
# include <iostream>
# include <list>
# include <cassert>
# include <cstdlib>
# include <cstring>
+# include "ivl_alloc.h"
static bool at_EOS = false;
View
14 vvp/vvp_net.h
@@ -23,7 +23,6 @@
# include "vpi_user.h"
# include "vvp_vpi_callback.h"
# include "permaheap.h"
-# include "ivl_alloc.h"
# include <cstddef>
# include <cstdlib>
# include <cstring>
@@ -36,6 +35,8 @@
class ostream;
#endif
+# include "ivl_alloc.h"
+
using namespace std;
@@ -334,12 +335,12 @@ inline vvp_vector4_t::vvp_vector4_t(unsigned size__, vvp_bit4_t val)
: size_(size__)
{
/* note: this relies on the bit encoding for the vvp_bit4_t. */
- const static unsigned long init_atable[4] = {
+ static const unsigned long init_atable[4] = {
WORD_0_ABITS,
WORD_1_ABITS,
WORD_Z_ABITS,
WORD_X_ABITS };
- const static unsigned long init_btable[4] = {
+ static const unsigned long init_btable[4] = {
WORD_0_BBITS,
WORD_1_BBITS,
WORD_Z_BBITS,
@@ -1646,4 +1647,11 @@ inline bool vvp_net_fil_t::test_force_mask_is_zero(void) const
return false;
}
+/*
+ * Undefine the ivl_alloc.h definitions so they don't leak out of this file.
+ */
+#undef malloc
+#undef realloc
+#undef calloc
+
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.