Remove fresh const lint

It looks pretty stupid and non-c++-y, but it does remove two compiler warnings
vvp/stop.cc: In function 'void stop_handler(int)':
vvp/stop.cc:492: warning: deprecated conversion from string constant to 'char*'
vvp/stop.cc:493: warning: deprecated conversion from string constant to 'char*'
This commit is contained in:
Larry Doolittle 2009-05-19 16:41:22 -07:00 committed by Stephen Williams
parent 90d9debe81
commit 9619eb3a0d
1 changed files with 9 additions and 2 deletions

View File

@ -478,6 +478,13 @@ static void invoke_command(char*txt)
delete[]argv; delete[]argv;
} }
static void invoke_command_const(const char*txt)
{
char *vtxt = strdup(txt);
invoke_command(vtxt);
free(vtxt);
}
void stop_handler(int rc) void stop_handler(int rc)
{ {
/* The user may be running in a non-interactive environment, so /* The user may be running in a non-interactive environment, so
@ -489,8 +496,8 @@ void stop_handler(int rc)
vpi_mcd_printf(1,"** VVP Stop(%d) **\n", rc); vpi_mcd_printf(1,"** VVP Stop(%d) **\n", rc);
vpi_mcd_printf(1,"** Flushing output streams.\n"); vpi_mcd_printf(1,"** Flushing output streams.\n");
invoke_command("$fflush"); invoke_command_const("$fflush");
invoke_command("$dumpflush"); invoke_command_const("$dumpflush");
vpi_mcd_printf(1,"** Current simulation time is %" TIME_FMT_U " ticks.\n", vpi_mcd_printf(1,"** Current simulation time is %" TIME_FMT_U " ticks.\n",
schedule_simtime()); schedule_simtime());