Skip to content

Commit 6088a26

Browse files
committed
Update VPI example to not have warnings
1 parent 1b72983 commit 6088a26

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Documentation/usage/vpi.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module, is a null terminated table of function pointers. The simulator calls
4242
each of the functions in the table in order. The following simple C definition
4343
defines a sample table::
4444

45-
void (*vlog_startup_routines[])() = {
45+
void (*vlog_startup_routines[])(void) = {
4646
hello_register,
4747
0
4848
};
@@ -89,16 +89,18 @@ file hello.c::
8989

9090
static int hello_compiletf(char*user_data)
9191
{
92+
(void)user_data; // Avoid a warning since user_data is not used.
9293
return 0;
9394
}
9495

9596
static int hello_calltf(char*user_data)
9697
{
98+
(void)user_data; // Avoid a warning since user_data is not used.
9799
vpi_printf("Hello, World!\n");
98100
return 0;
99101
}
100102

101-
void hello_register()
103+
void hello_register(void)
102104
{
103105
s_vpi_systf_data tf_data;
104106

@@ -111,7 +113,7 @@ file hello.c::
111113
vpi_register_systf(&tf_data);
112114
}
113115

114-
void (*vlog_startup_routines[])() = {
116+
void (*vlog_startup_routines[])(void) = {
115117
hello_register,
116118
0
117119
};

0 commit comments

Comments
 (0)