summaryrefslogtreecommitdiff
path: root/wasm2c/examples
diff options
context:
space:
mode:
Diffstat (limited to 'wasm2c/examples')
-rw-r--r--wasm2c/examples/fac/fac.c4
-rw-r--r--wasm2c/examples/fac/fac.h2
-rw-r--r--wasm2c/examples/fac/main.c4
-rw-r--r--wasm2c/examples/rot13/main.c14
4 files changed, 12 insertions, 12 deletions
diff --git a/wasm2c/examples/fac/fac.c b/wasm2c/examples/fac/fac.c
index 945c9967..b307d089 100644
--- a/wasm2c/examples/fac/fac.c
+++ b/wasm2c/examples/fac/fac.c
@@ -332,11 +332,11 @@ static void init_table(void) {
}
/* export: 'fac' */
-u32 (*WASM_RT_ADD_PREFIX(Z_facZ_ii))(u32);
+u32 (*WASM_RT_ADD_PREFIX(Z_fac))(u32);
static void init_exports(void) {
/* export: 'fac' */
- WASM_RT_ADD_PREFIX(Z_facZ_ii) = (&w2c_fac);
+ WASM_RT_ADD_PREFIX(Z_fac) = (&w2c_fac);
}
void WASM_RT_ADD_PREFIX(init)(void) {
diff --git a/wasm2c/examples/fac/fac.h b/wasm2c/examples/fac/fac.h
index 41c50d4d..9a6a9aba 100644
--- a/wasm2c/examples/fac/fac.h
+++ b/wasm2c/examples/fac/fac.h
@@ -35,7 +35,7 @@ typedef double f64;
extern void WASM_RT_ADD_PREFIX(init)(void);
/* export: 'fac' */
-extern u32 (*WASM_RT_ADD_PREFIX(Z_facZ_ii))(u32);
+extern u32 (*WASM_RT_ADD_PREFIX(Z_fac))(u32);
#ifdef __cplusplus
}
#endif
diff --git a/wasm2c/examples/fac/main.c b/wasm2c/examples/fac/main.c
index 55255b5d..fe79aa94 100644
--- a/wasm2c/examples/fac/main.c
+++ b/wasm2c/examples/fac/main.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
-/* Uncomment this to define fac_init and fac_Z_facZ_ii instead. */
+/* Uncomment this to define fac_init and fac_Z_fac instead. */
/* #define WASM_RT_MODULE_PREFIX fac_ */
#include "fac.h"
@@ -22,7 +22,7 @@ int main(int argc, char** argv) {
init();
/* Call `fac`, using the mangled name. */
- u32 result = Z_facZ_ii(x);
+ u32 result = Z_fac(x);
/* Print the result. */
printf("fac(%u) -> %u\n", x, result);
diff --git a/wasm2c/examples/rot13/main.c b/wasm2c/examples/rot13/main.c
index 19ec799e..c5ba0e9d 100644
--- a/wasm2c/examples/rot13/main.c
+++ b/wasm2c/examples/rot13/main.c
@@ -17,15 +17,15 @@
#include <stdio.h>
#include <stdlib.h>
-/* Uncomment this to define rot13_init rot13_Z_rot13Z_vv instead. */
+/* Uncomment this to define rot13_init rot13_Z_rot13 instead. */
/* #define WASM_RT_MODULE_PREFIX rot13_ */
#include "rot13.h"
/* Define the imports as declared in rot13.h. */
wasm_rt_memory_t (*Z_hostZ_mem);
-u32 (*Z_hostZ_fill_bufZ_iii)(u32, u32);
-void (*Z_hostZ_buf_doneZ_vii)(u32, u32);
+u32 (*Z_hostZ_fill_buf)(u32, u32);
+void (*Z_hostZ_buf_done)(u32, u32);
/* Define the implementations of the imports. */
static wasm_rt_memory_t s_memory;
@@ -49,10 +49,10 @@ int main(int argc, char** argv) {
/* Provide the imports expected by the module: "host.mem", "host.fill_buf"
* and "host.buf_done". Their mangled names are `Z_hostZ_mem`,
- * `Z_hostZ_fill_bufZ_iii` and `Z_hostZ_buf_doneZ_vii`. */
+ * `Z_hostZ_fill_buf` and `Z_hostZ_buf_done`. */
Z_hostZ_mem = &s_memory;
- Z_hostZ_fill_bufZ_iii = &fill_buf;
- Z_hostZ_buf_doneZ_vii = &buf_done;
+ Z_hostZ_fill_buf = &fill_buf;
+ Z_hostZ_buf_done = &buf_done;
/* Call `rot13` on each argument, using the mangled name. */
while (argc > 1) {
@@ -60,7 +60,7 @@ int main(int argc, char** argv) {
argc--; argv++;
s_input = argv[0];
- Z_rot13Z_vv();
+ Z_rot13();
}
/* Free the Wasm runtime state. */