Fixed last linting issues

(hopefully)
This commit is contained in:
Syrus
2019-06-14 09:53:07 +02:00
parent b9fa698a73
commit 95f39cedec
2 changed files with 7 additions and 3 deletions

View File

@ -41,13 +41,17 @@ pub fn getpwuid(ctx: &mut Ctx, uid: i32) -> i32 {
pw_dir: u32,
pw_shell: u32,
}
unsafe {
let passwd = &*_getpwuid(uid as _);
let passwd_struct_offset = call_malloc(ctx, mem::size_of::<GuestPasswd>() as _);
let passwd_struct_ptr =
emscripten_memory_pointer!(ctx.memory(0), passwd_struct_offset) as *mut GuestPasswd;
assert_eq!(passwd_struct_ptr as usize % std::cmp::min(std::mem::size_of::<usize>(), std::mem::align_of::<usize>()), 0);
assert_eq!(
passwd_struct_ptr as usize
% std::cmp::min(std::mem::size_of::<usize>(), std::mem::align_of::<usize>()),
0
);
(*passwd_struct_ptr).pw_name = copy_cstr_into_wasm(ctx, passwd.pw_name);
(*passwd_struct_ptr).pw_passwd = copy_cstr_into_wasm(ctx, passwd.pw_passwd);
(*passwd_struct_ptr).pw_gecos = copy_cstr_into_wasm(ctx, passwd.pw_gecos);

View File

@ -58,7 +58,7 @@ pub fn pathconf(ctx: &mut Ctx, path_ptr: i32, name: i32) -> i32 {
}
#[cfg(not(unix))]
pub fn pathconf(ctx: &mut Ctx, path_ptr: i32, name: i32) -> i32 {
pub fn pathconf(_ctx: &mut Ctx, _path_ptr: i32, _name: i32) -> i32 {
debug!("emscripten::pathconf");
0
}