From e5832265105d04d48815e4c42f9d8a49b808663d Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Thu, 13 Dec 2018 19:58:08 -0600 Subject: [PATCH 1/3] Fix build warning unnecessary unsafe --- src/apis/emscripten/utils.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/apis/emscripten/utils.rs b/src/apis/emscripten/utils.rs index 1a748cc6b..5179b493d 100644 --- a/src/apis/emscripten/utils.rs +++ b/src/apis/emscripten/utils.rs @@ -20,10 +20,8 @@ pub fn is_emscripten_module(module: &Module) -> bool { pub unsafe fn write_to_buf(string: *const c_char, buf: u32, max: u32, instance: &Instance) -> u32 { let buf_addr = instance.memory_offset_addr(0, buf as _) as *mut c_char; - unsafe { - for i in 0..max { - *buf_addr.add(i as _) = *string.add(i as _); - } + for i in 0..max { + *buf_addr.add(i as _) = *string.add(i as _); } buf From 0b69d8465bec37e7a2ace329729a48bf1c7cb878 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Thu, 13 Dec 2018 19:58:31 -0600 Subject: [PATCH 2/3] Fix build warnings unused imports --- src/apis/emscripten/storage.rs | 2 +- src/apis/emscripten/time.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/apis/emscripten/storage.rs b/src/apis/emscripten/storage.rs index 16d4d6d0e..08099321b 100644 --- a/src/apis/emscripten/storage.rs +++ b/src/apis/emscripten/storage.rs @@ -1,4 +1,4 @@ -use crate::webassembly::LinearMemory; +// use crate::webassembly::LinearMemory; pub fn align_memory(ptr: u32) -> u32 { (ptr + 15) & !15 diff --git a/src/apis/emscripten/time.rs b/src/apis/emscripten/time.rs index 0395646a5..536b71ac3 100644 --- a/src/apis/emscripten/time.rs +++ b/src/apis/emscripten/time.rs @@ -1,7 +1,6 @@ use super::utils::{copy_cstr_into_wasm, write_to_buf}; use libc::{ c_int, - c_long, clock_gettime as libc_clock_gettime, localtime, localtime_r, From 5d9787ce440872a61ea67934d26f3bc913b7d19a Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Thu, 13 Dec 2018 20:00:11 -0600 Subject: [PATCH 3/3] Fix for warnings Pattern matching for Cargo's include changing warning: Pattern matching for Cargo's include/exclude fields is changing and file `emtests/README.md` WILL be included in a future Cargo version. See https://github.com/rust-lang/cargo/issues/4268 for more info warning: Pattern matching for Cargo's include/exclude fields is changing and file `spectests/README.md` WILL be included in a future Cargo version. See https://github.com/rust-lang/cargo/issues/4268 for more info --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 053f71d4f..26cfa1c67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ include = [ "Cargo.toml", "LICENSE", "Makefile", - "README.md", + "/README.md", "rustfmt.toml" ]