Fix errors from "make lint"

This commit is contained in:
Felix Schütt
2022-08-05 15:24:55 +02:00
parent ced8378f6e
commit 520314bbf0
19 changed files with 120 additions and 68 deletions

View File

@@ -562,7 +562,7 @@ pub fn emscripten_call_main(
.get::<Function>(function_name)
.map_err(|e| RuntimeError::new(e.to_string()))?;
let num_params = main_func.ty(&env).params().len();
let _result = match num_params {
match num_params {
2 => {
let mut new_args = vec![path];
new_args.extend(args);

View File

@@ -21,10 +21,7 @@ impl VarArgs {
// pub fn getStr<'a>(&mut self, ctx: &mut Ctx) -> &'a CStr {
pub fn get_str(&mut self, ctx: &FunctionEnvMut<EmEnv>) -> *const c_char {
let ptr_addr: u32 = self.get(ctx);
let ptr =
emscripten_memory_pointer!(ctx.data().memory_view(0, &ctx), ptr_addr) as *const c_char;
ptr
// unsafe { CStr::from_ptr(ptr) }
emscripten_memory_pointer!(ctx.data().memory_view(0, &ctx), ptr_addr) as *const c_char
}
}