Skip to content

Commit

Permalink
Brainless start to const-correct changes
Browse files Browse the repository at this point in the history
Results of running
cd vpi
for f in *.c *.h; do sed -i \
  -e "s/_calltf(PLI_BYTE8/_calltf(ICARUS_VPI_CONST PLI_BYTE8/" \
  -e "s/_compiletf(PLI_BYTE8/_compiletf(ICARUS_VPI_CONST PLI_BYTE8/" $f; done
and a trivial patch to vpi_user.h to, among other things, make
ICARUS_VPI_CONST blank.

Thus, this patch does absolutely nothing.  Will be followed by a
(much shorter) patch that makes it do something.  :-)
  • Loading branch information
ldoolitt authored and steveicarus committed Oct 6, 2010
1 parent 3141ef7 commit 5d977ca
Show file tree
Hide file tree
Showing 28 changed files with 138 additions and 137 deletions.
4 changes: 2 additions & 2 deletions vpi/sys_clog2.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static unsigned is_numeric_obj(vpiHandle obj)
/*
* Check that the function is called with the correct argument.
*/
static PLI_INT32 sys_clog2_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_clog2_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv, arg;
Expand Down Expand Up @@ -106,7 +106,7 @@ static PLI_INT32 sys_clog2_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_clog2_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_clog2_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down
10 changes: 5 additions & 5 deletions vpi/sys_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void error_message(vpiHandle callh, const char* msg)
static PLI_INT32 sizetf_32 (PLI_BYTE8*x) { return 32; }
static PLI_INT32 sizetf_64 (PLI_BYTE8*x) { return 64; }

static PLI_INT32 sys_convert_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_convert_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -123,7 +123,7 @@ static PLI_INT32 sys_convert_compiletf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_bitstoreal_calltf(PLI_BYTE8*user)
static PLI_INT32 sys_bitstoreal_calltf(ICARUS_VPI_CONST PLI_BYTE8*user)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle arg = (vpiHandle) vpi_get_userdata(callh);
Expand All @@ -147,7 +147,7 @@ static PLI_INT32 sys_bitstoreal_calltf(PLI_BYTE8*user)
return 0;
}

static PLI_INT32 sys_itor_calltf(PLI_BYTE8*user)
static PLI_INT32 sys_itor_calltf(ICARUS_VPI_CONST PLI_BYTE8*user)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle arg = (vpiHandle) vpi_get_userdata(callh);
Expand All @@ -167,7 +167,7 @@ static PLI_INT32 sys_itor_calltf(PLI_BYTE8*user)
return 0;
}

static PLI_INT32 sys_realtobits_calltf(PLI_BYTE8*user)
static PLI_INT32 sys_realtobits_calltf(ICARUS_VPI_CONST PLI_BYTE8*user)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle arg = (vpiHandle) vpi_get_userdata(callh);
Expand Down Expand Up @@ -197,7 +197,7 @@ static PLI_INT32 sys_realtobits_calltf(PLI_BYTE8*user)
return 0;
}

static PLI_INT32 sys_rtoi_calltf(PLI_BYTE8*user)
static PLI_INT32 sys_rtoi_calltf(ICARUS_VPI_CONST PLI_BYTE8*user)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle arg = (vpiHandle) vpi_get_userdata(callh);
Expand Down
4 changes: 2 additions & 2 deletions vpi/sys_deposit.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# include <assert.h>
# include <string.h>

static PLI_INT32 sys_deposit_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_deposit_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -69,7 +69,7 @@ static PLI_INT32 sys_deposit_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_deposit_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_deposit_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh, argv, target, value;
s_vpi_value val;
Expand Down
38 changes: 19 additions & 19 deletions vpi/sys_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ static int sys_check_args(vpiHandle callh, vpiHandle argv, PLI_BYTE8*name,
}

/* Common compiletf routine. */
static PLI_INT32 sys_common_compiletf(PLI_BYTE8*name, int no_auto,
static PLI_INT32 sys_common_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name, int no_auto,
int is_monitor)
{
vpiHandle callh, argv;
Expand Down Expand Up @@ -1101,14 +1101,14 @@ static PLI_INT32 sys_common_compiletf(PLI_BYTE8*name, int no_auto,
}

/* Check the $display, $write, $fdisplay and $fwrite based tasks. */
static PLI_INT32 sys_display_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_display_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
/* These tasks can have automatic variables and are not monitor. */
return sys_common_compiletf(name, 0, 0);
}

/* This implements the $display/$fdisplay and the $write/$fwrite based tasks. */
static PLI_INT32 sys_display_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_display_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh, argv, scope;
struct strobe_cb_info info;
Expand Down Expand Up @@ -1221,14 +1221,14 @@ static PLI_INT32 strobe_cb(p_cb_data cb)
}

/* Check both the $strobe and $fstrobe based tasks. */
static PLI_INT32 sys_strobe_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_strobe_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
/* These tasks can not have automatic variables and are not monitor. */
return sys_common_compiletf(name, 1, 0);
}

/* This implements both the $strobe and $fstrobe based tasks. */
static PLI_INT32 sys_strobe_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_strobe_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh, argv, scope;
struct t_cb_data cb;
Expand Down Expand Up @@ -1364,7 +1364,7 @@ static PLI_INT32 monitor_cb_1(p_cb_data cause)
return 0;
}

static PLI_INT32 sys_monitor_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_monitor_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand All @@ -1373,7 +1373,7 @@ static PLI_INT32 sys_monitor_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_monitor_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_monitor_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh, argv, scope;
unsigned idx;
Expand Down Expand Up @@ -1452,20 +1452,20 @@ static PLI_INT32 sys_monitor_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_monitoron_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_monitoron_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
monitor_enabled = 1;
monitor_cb_1(0);
return 0;
}

static PLI_INT32 sys_monitoroff_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_monitoroff_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
monitor_enabled = 0;
return 0;
}

static PLI_INT32 sys_swrite_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_swrite_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -1494,7 +1494,7 @@ static PLI_INT32 sys_swrite_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_swrite_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_swrite_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh, argv, reg, scope;
struct strobe_cb_info info;
Expand Down Expand Up @@ -1532,7 +1532,7 @@ static PLI_INT32 sys_swrite_calltf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_sformat_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_sformat_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -1581,7 +1581,7 @@ static PLI_INT32 sys_sformat_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_sformat_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_sformat_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh, argv, reg, scope;
struct strobe_cb_info info;
Expand Down Expand Up @@ -1642,7 +1642,7 @@ static PLI_INT32 sys_end_of_compile(p_cb_data cb_data)
return 0;
}

static PLI_INT32 sys_timeformat_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_timeformat_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -1718,7 +1718,7 @@ static PLI_INT32 sys_timeformat_compiletf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_timeformat_calltf(PLI_BYTE8*xx)
static PLI_INT32 sys_timeformat_calltf(ICARUS_VPI_CONST PLI_BYTE8*xx)
{
s_vpi_value value;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
Expand Down Expand Up @@ -1781,7 +1781,7 @@ static const char *pts_convert(int value)
return string;
}

static PLI_INT32 sys_printtimescale_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_printtimescale_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -1824,7 +1824,7 @@ static PLI_INT32 sys_printtimescale_compiletf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_printtimescale_calltf(PLI_BYTE8*xx)
static PLI_INT32 sys_printtimescale_calltf(ICARUS_VPI_CONST PLI_BYTE8*xx)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand All @@ -1849,7 +1849,7 @@ static PLI_INT32 sys_printtimescale_calltf(PLI_BYTE8*xx)
return 0;
}

static PLI_INT32 sys_fatal_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_fatal_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand All @@ -1873,7 +1873,7 @@ static PLI_INT32 sys_fatal_compiletf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_severity_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_severity_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down
32 changes: 16 additions & 16 deletions vpi/sys_fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/*
* Implement the $fopen system function.
*/
static PLI_INT32 sys_fopen_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_fopen_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv;
Expand Down Expand Up @@ -71,7 +71,7 @@ static PLI_INT32 sys_fopen_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_fopen_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fopen_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -177,7 +177,7 @@ static PLI_INT32 sys_fopen_calltf(PLI_BYTE8*name)
* from Chris Spear's File I/O for Verilog.
*/

static PLI_INT32 sys_fopenrwa_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fopenrwa_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -205,7 +205,7 @@ static PLI_INT32 sys_fopenrwa_calltf(PLI_BYTE8*name)
/*
* Implement $fclose system function
*/
static PLI_INT32 sys_fclose_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fclose_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -243,7 +243,7 @@ static PLI_INT32 sys_fclose_calltf(PLI_BYTE8*name)
/*
* Implement $fflush system function
*/
static PLI_INT32 sys_fflush_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fflush_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -291,7 +291,7 @@ static PLI_INT32 sys_fflush_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_fputc_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fputc_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -335,7 +335,7 @@ static PLI_INT32 sys_fputc_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_fgets_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_fgets_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -382,7 +382,7 @@ static PLI_INT32 sys_fgets_compiletf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_fgets_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fgets_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -446,7 +446,7 @@ static PLI_INT32 sys_fgets_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_fread_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_fread_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -571,7 +571,7 @@ static unsigned fread_word(FILE *fp, vpiHandle word,
return rtn;
}

static PLI_INT32 sys_fread_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fread_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -705,7 +705,7 @@ static PLI_INT32 sys_fread_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_ungetc_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -752,7 +752,7 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_fseek_compiletf(PLI_BYTE8*name)
static PLI_INT32 sys_fseek_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -815,7 +815,7 @@ static PLI_INT32 sys_fseek_compiletf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_fseek_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_fseek_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -885,7 +885,7 @@ static PLI_INT32 sys_fseek_calltf(PLI_BYTE8*name)
return 0;
}

static PLI_INT32 sys_common_fd_calltf(PLI_BYTE8*name)
static PLI_INT32 sys_common_fd_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down Expand Up @@ -945,7 +945,7 @@ static PLI_INT32 sys_common_fd_calltf(PLI_BYTE8*name)
/*
* Implement the $ferror system function.
*/
static PLI_INT32 sys_ferror_compiletf(PLI_BYTE8 *name)
static PLI_INT32 sys_ferror_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv;
Expand Down Expand Up @@ -1000,7 +1000,7 @@ static PLI_INT32 sys_ferror_compiletf(PLI_BYTE8 *name)
return 0;
}

static PLI_INT32 sys_ferror_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_ferror_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
Expand Down
2 changes: 1 addition & 1 deletion vpi/sys_finish.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "sys_priv.h"
#include <string.h>

static PLI_INT32 sys_finish_calltf(PLI_BYTE8 *name)
static PLI_INT32 sys_finish_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
{
vpiHandle callh, argv;
s_vpi_value val;
Expand Down
Loading

0 comments on commit 5d977ca

Please sign in to comment.