Skip to content

Commit

Permalink
appease some clang-tidy complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 11, 2023
1 parent b163311 commit 7c95435
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cli/repl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int toywasm_repl_load(struct repl_state *state, const char *modname,
const char *filename);
int toywasm_repl_register(struct repl_state *state, const char *modname,
const char *register_name);
int toywasm_repl_invoke(struct repl_state *state, const char *moodname,
int toywasm_repl_invoke(struct repl_state *state, const char *modname,
const char *cmd, uint32_t *exitcodep,
bool print_result);
void toywasm_repl_print_version(void);
Expand Down
2 changes: 1 addition & 1 deletion lib/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct bitmap {
uint32_t *data;
};

int bitmap_alloc(struct bitmap *b, uint32_t sz);
int bitmap_alloc(struct bitmap *b, uint32_t n);
void bitmap_free(struct bitmap *b);
void bitmap_set(struct bitmap *b, uint32_t idx);
bool bitmap_test(struct bitmap *b, uint32_t idx);
Expand Down
5 changes: 2 additions & 3 deletions lib/exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct val;

int exec_expr(uint32_t funcidx, const struct expr *expr,
const struct localtype *localtype,
const struct resulttype *paramtype, uint32_t nresults,
const struct resulttype *parametertype, uint32_t nresults,
const struct cell *params, struct cell *results,
struct exec_context *ctx);
int exec_expr_continue(struct exec_context *ctx);
Expand All @@ -25,8 +25,7 @@ int exec_const_expr(const struct expr *expr, enum valtype type,

int memory_init(struct exec_context *ctx, uint32_t memidx, uint32_t dataidx,
uint32_t d, uint32_t s, uint32_t n);
uint32_t memory_grow(struct exec_context *ctx, uint32_t memidx,
uint32_t newsize);
uint32_t memory_grow(struct exec_context *ctx, uint32_t memidx, uint32_t sz);

int memory_notify(struct exec_context *ctx, uint32_t memidx, uint32_t addr,
uint32_t offset, uint32_t count, uint32_t *nwokenp);
Expand Down
4 changes: 2 additions & 2 deletions lib/host_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ struct host_module {
};

struct import_object;
int import_object_create_for_host_funcs(const struct host_module *hm, size_t n,
struct host_instance *hi,
int import_object_create_for_host_funcs(const struct host_module *modules,
size_t n, struct host_instance *hi,
struct import_object **impp);

void host_func_dump_params(const struct functype *ft,
Expand Down
2 changes: 1 addition & 1 deletion lib/instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int instance_execute_handle_restart(struct exec_context *ctx, int exec_ret);
int import_object_create_for_exports(struct instance *inst,
const struct name *module_name,
struct import_object **resultp);
void import_object_destroy(struct import_object *export);
void import_object_destroy(struct import_object *im);
int import_object_alloc(uint32_t nentries, struct import_object **resultp);

struct meminst;
Expand Down
2 changes: 1 addition & 1 deletion lib/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ int check_functype_with_string(struct module *m, uint32_t funcidx,
const char *sig);

void clear_functype(struct functype *ft);
void clear_resulttype(struct resulttype *ft);
void clear_resulttype(struct resulttype *rt);

void set_name_cstr(struct name *name, char *cstr);
void clear_name(struct name *name);
Expand Down
2 changes: 1 addition & 1 deletion lib/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

int __must_check _vec_resize(void *vec, size_t elem_size,
uint32_t new_elem_count);
int __must_check _vec_prealloc(void *vec, size_t elem_size, uint32_t tailroom);
int __must_check _vec_prealloc(void *vec, size_t elem_size, uint32_t count);
void _vec_free(void *vec);

#define VEC_RESIZE(v, sz) _vec_resize(&v, sizeof(*v.p), sz);
Expand Down
8 changes: 4 additions & 4 deletions libwasi/wasi.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct import_object;
* object. see wasi_threads.h.
*/

int wasi_instance_create(struct wasi_instance **resultp);
int wasi_instance_create(struct wasi_instance **instp);
void wasi_instance_set_args(struct wasi_instance *inst, int argc,
char *const *argv);
void wasi_instance_set_environ(struct wasi_instance *inst, int nenvs,
Expand All @@ -27,8 +27,8 @@ void wasi_instance_destroy(struct wasi_instance *inst);
* wasi_instance_prestat_add(i, "dir") is mostly an equivalent of
* wasi_instance_prestat_add_mapdir("i, "dir::dir").
*/
int wasi_instance_prestat_add(struct wasi_instance *inst, const char *path);
int wasi_instance_prestat_add_mapdir(struct wasi_instance *inst,
int wasi_instance_prestat_add(struct wasi_instance *wasi, const char *path);
int wasi_instance_prestat_add_mapdir(struct wasi_instance *wasi,
const char *path);

/*
Expand All @@ -53,7 +53,7 @@ int wasi_instance_populate_stdio_with_hostfd(struct wasi_instance *inst);
* it's available only when the execution of the module ended with
* ETOYWASMTRAP + TRAP_VOLUNTARY_EXIT.
*/
uint32_t wasi_instance_exit_code(struct wasi_instance *inst);
uint32_t wasi_instance_exit_code(struct wasi_instance *wasi);

/*
* import_object_create_for_wasi:
Expand Down
9 changes: 5 additions & 4 deletions libwasi/wasi_threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct wasi_threads_instance {
* wasi_threads_instance_join: wait for completion of all threads
* spawned by wasi:thread_spawn in the wasi-threads instance.
*/
static void wasi_threads_instance_join(struct wasi_threads_instance *inst);
static void wasi_threads_instance_join(struct wasi_threads_instance *wasi);

static const atomic_uint *
wasi_threads_interrupt_pointer(struct wasi_threads_instance *inst);
Expand Down Expand Up @@ -589,9 +589,10 @@ static const struct host_module module_wasi_threads = {
};

int
import_object_create_for_wasi_threads(struct wasi_threads_instance *th,
struct import_object **impp)
import_object_create_for_wasi_threads(
struct wasi_threads_instance *wasi_threads,
struct import_object **impp)
{
return import_object_create_for_host_funcs(&module_wasi_threads, 1,
&th->hi, impp);
&wasi_threads->hi, impp);
}
2 changes: 1 addition & 1 deletion libwasi/wasi_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct exec_context;
struct trap_info;

void wasi_threads_instance_destroy(struct wasi_threads_instance *inst);
int wasi_threads_instance_create(struct wasi_threads_instance **resultp);
int wasi_threads_instance_create(struct wasi_threads_instance **instp);

/*
* wasi_threads_instance_set_thread_spawn_args: set wasi-threads parameters
Expand Down

0 comments on commit 7c95435

Please sign in to comment.