Various lint fixes

This commit is contained in:
Syrus 2019-06-13 21:01:29 +02:00
parent 1560849e40
commit 675caf042c
3 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,6 @@ use ::libc::DIR as libcDIR;
#[cfg(not(unix))]
type libcDIR = u8;
#[macro_use]
mod macros;

View File

@ -52,12 +52,15 @@ pub fn killpg(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
#[cfg(unix)]
pub fn pathconf(ctx: &mut Ctx, path_ptr: i32, name: i32) -> i32 {
debug!("emscripten::pathconf");
let path = emscripten_memory_pointer!(ctx.memory(0), path_ptr) as *const i8;
unsafe { libc::pathconf(path, name).try_into().unwrap() }
}
#[cfg(not(unix))]
pub fn pathconf(ctx: &mut Ctx, path_ptr: i32, name: i32) -> i32 {
debug!("emscripten::pathconf");
0
}
pub fn setpwent(_ctx: &mut Ctx) {

View File

@ -894,7 +894,7 @@ pub fn ___syscall220(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
*(dirp.add(pos + 4) as *mut u32) = pos as u32;
*(dirp.add(pos + 8) as *mut u16) = offset as u16;
*(dirp.add(pos + 10) as *mut u8) = (*dirent).d_type;
let upper_bound = std::cmp::min((*dirent).d_reclen, 256) as usize;
let upper_bound = std::cmp::min((*dirent).d_reclen, 255) as usize;
let mut i = 0;
while i < upper_bound {
*(dirp.add(pos + 11 + i) as *mut i8) = (*dirent).d_name[i];