Skip to content

Commit

Permalink
Update VPI example to not have warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
caryr committed Feb 13, 2025
1 parent 1b72983 commit 6088a26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Documentation/usage/vpi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module, is a null terminated table of function pointers. The simulator calls
each of the functions in the table in order. The following simple C definition
defines a sample table::

void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
hello_register,
0
};
Expand Down Expand Up @@ -89,16 +89,18 @@ file hello.c::

static int hello_compiletf(char*user_data)
{
(void)user_data; // Avoid a warning since user_data is not used.
return 0;
}

static int hello_calltf(char*user_data)
{
(void)user_data; // Avoid a warning since user_data is not used.
vpi_printf("Hello, World!\n");
return 0;
}

void hello_register()
void hello_register(void)
{
s_vpi_systf_data tf_data;

Expand All @@ -111,7 +113,7 @@ file hello.c::
vpi_register_systf(&tf_data);
}

void (*vlog_startup_routines[])() = {
void (*vlog_startup_routines[])(void) = {
hello_register,
0
};
Expand Down

0 comments on commit 6088a26

Please sign in to comment.