Description: testsuite/vpi: fix callback types (continue)
Author: Tristan Gingold <tgingold@free.fr>
Origin: upstream, https://github.com/ghdl/ghdl/commit/5c4d2509b47d416470cdac59bb81955f5aacfee3
Last-Update: 2024-07-29
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
diff --git a/testsuite/vpi/vpi002/vpi1.c b/testsuite/vpi/vpi002/vpi1.c
index d6f1b42fb..53d51250e 100644
--- a/testsuite/vpi/vpi002/vpi1.c
+++ b/testsuite/vpi/vpi002/vpi1.c
@@ -2,8 +2,8 @@
 #include <vpi_user.h>
 #define N_NAMES 12
 
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
 {
   vpiHandle net;
   s_vpi_value val;
@@ -54,12 +54,13 @@ vpi_proc (void)
     if (net == NULL)
         {
         printf ("Error: Failed to find the net %s\n", names[name_index]);
-        return;
+        return -1;
         }
     val.format = vpiBinStrVal;
     vpi_get_value (net, &val);
     printf ("value: %s\n", val.value.str);
   }
+  return 0;
 }
 
 void my_handle_register()
diff --git a/testsuite/vpi/vpi004/vpi1.c b/testsuite/vpi/vpi004/vpi1.c
index 25d426fe7..26ecf7c27 100644
--- a/testsuite/vpi/vpi004/vpi1.c
+++ b/testsuite/vpi/vpi004/vpi1.c
@@ -2,8 +2,8 @@
 #include <vpi_user.h>
 #define N_NAMES 12
 
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
 {
   s_vpi_vlog_info info;
   int i;
@@ -11,12 +11,12 @@ vpi_proc (void)
   int ret = vpi_get_vlog_info(&info);
   if (ret != 1) {
     printf ("Error: Failed to get vlog_info\n");
-    return;
+    return -1;
   }
 
   if (info.argc < 1) {
      printf ("Error: Argc was 0\n");
-     return;
+     return -1;
   }
   printf ("Argc: %d\n", info.argc);
 
@@ -26,15 +26,16 @@ vpi_proc (void)
 
   if (info.product == NULL) {
     printf ("Error: product is NULL\n");
-    return;
+    return -1;
   }
   printf ("Product: %s\n", info.product);
 
   if (info.version == NULL) {
     printf ("Error: version is NULL\n");
-    return;
+    return -1;
   }
   printf ("Version: %s\n", info.version);
+  return 0;
 }
 
 void my_handle_register()
