diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-11-26 22:43:30 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-12-29 23:36:21 +0100 |
| commit | 52c18e60929b64285d4bb333f87482d954c9b2e0 (patch) | |
| tree | 836ab3a01d160f45cda4f5a28522fc0bf471011c /src/op/f32_const.c | |
First commitfirst-step
Diffstat (limited to 'src/op/f32_const.c')
| -rw-r--r-- | src/op/f32_const.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/op/f32_const.c b/src/op/f32_const.c new file mode 100644 index 0000000..e42f19f --- /dev/null +++ b/src/op/f32_const.c @@ -0,0 +1,29 @@ +#include <ops.h> +#include <interp.h> +#include <interp_private.h> +#include <wasm_types.h> +#include <stddef.h> +#include <stdio.h> + +static int op(FILE *const f, struct interp *const i) +{ + varuint32 value; + + if (varuint32_read(f, &value)) + { + fprintf(stderr, "%s: varuint32_read failed\n", __func__); + return -1; + } + + return 0; +} + +int op_f32_const(struct interp *const i) +{ + return op(i->cfg.f, i); +} + +int check_f32_const(FILE *const f) +{ + return op(f, NULL); +} |
