From 103138cf4b5e5fc5676a541b399ecbf6f0e698ab Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Sat, 1 Dec 2007 18:04:43 -0800 Subject: [PATCH] Fix compile time warnings These warnings actually look a lot like errors. --- vpi/sys_random.c | 1 + vvp/vpi_priv.cc | 4 ++-- vvp/words.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vpi/sys_random.c b/vpi/sys_random.c index 5f4b55a10..e12352e04 100644 --- a/vpi/sys_random.c +++ b/vpi/sys_random.c @@ -643,6 +643,7 @@ static PLI_INT32 sys_urandom_range_calltf(PLI_BYTE8 *name) /* Calculate and return the result. */ val.value.integer = urandom(0, i_maxval, i_minval); vpi_put_value(callh, &val, 0, vpiNoDelay); + return 0; } static PLI_INT32 sys_dist_uniform_calltf(PLI_BYTE8 *name) diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index 75a82e1eb..2fcd7d1c1 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -918,7 +918,7 @@ void vpi_get_delays(vpiHandle expr, p_vpi_delay delays) if (vpi_trace) { fprintf(vpi_trace, - "vpi_get_delays(%s, %p) -->\n", expr, delays); + "vpi_get_delays(%p, %p) -->\n", expr, delays); } } } @@ -936,7 +936,7 @@ void vpi_put_delays(vpiHandle expr, p_vpi_delay delays) if (vpi_trace) { fprintf(vpi_trace, - "vpi_put_delays(%s, %p) -->\n", expr, delays); + "vpi_put_delays(%p, %p) -->\n", expr, delays); } } } diff --git a/vvp/words.cc b/vvp/words.cc index 8de251d27..7acb7bfd6 100644 --- a/vvp/words.cc +++ b/vvp/words.cc @@ -199,7 +199,7 @@ void compile_netw(char*label, char*array_label, unsigned long array_addr, const char *name = get_array_name(array_label); unsigned len = strlen(name) + 32; char *nbuf = (char *)malloc(len); - snprintf(nbuf, len, "%s[%d]", name, array_addr + + snprintf(nbuf, len, "%s[%lu]", name, array_addr + get_array_base(array_label)); __compile_net(label, strdup(nbuf), array_label, array_addr, msb, lsb, signed_flag, net8_flag,