From c685cc43c8b8a3a36837b26a358408c5d8da68d0 Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Mon, 28 Mar 2016 16:06:28 +0300 Subject: Clean up truncating cast warnings: src\binaryen-shell.cpp(181): warning C4244: 'argument': conversion from 'int64_t' to 'int8_t', possible loss of data src\binaryen-shell.cpp(182): warning C4244: 'argument': conversion from 'int64_t' to 'int16_t', possible loss of data src\binaryen-shell.cpp(183): warning C4244: 'argument': conversion from 'int64_t' to 'int32_t', possible loss of data --- src/binaryen-shell.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/binaryen-shell.cpp') diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp index bfed8277e..985154ddd 100644 --- a/src/binaryen-shell.cpp +++ b/src/binaryen-shell.cpp @@ -178,9 +178,9 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { } case i64: { switch (store->bytes) { - case 1: memory.set(addr, value.geti64()); break; - case 2: memory.set(addr, value.geti64()); break; - case 4: memory.set(addr, value.geti64()); break; + case 1: memory.set(addr, (int8_t)value.geti64()); break; + case 2: memory.set(addr, (int16_t)value.geti64()); break; + case 4: memory.set(addr, (int32_t)value.geti64()); break; case 8: memory.set(addr, value.geti64()); break; default: abort(); } -- cgit v1.2.3 From 6f2d0dc9b17bfd7039418681bb34386c69aaed22 Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Mon, 28 Mar 2016 16:07:32 +0300 Subject: Cleanup redundant '> 0' check in src\binaryen-shell.cpp(251): warning C4804: '>': unsafe use of type 'bool' in operation --- src/binaryen-shell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/binaryen-shell.cpp') diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp index 985154ddd..182c0dfd6 100644 --- a/src/binaryen-shell.cpp +++ b/src/binaryen-shell.cpp @@ -248,7 +248,7 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm, if (wasm) { interface = new ShellExternalInterface(); instance = new ModuleInstance(*wasm, interface); - if (entry.is() > 0) { + if (entry.is()) { Function* function = wasm->functionsMap[entry]; if (!function) { std::cerr << "Unknown entry " << entry << std::endl; -- cgit v1.2.3 From 4b019795697ddd33bd66089881b351f9f0549c78 Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Mon, 28 Mar 2016 16:08:34 +0300 Subject: Clean up unused variables warnings: src\binaryen-shell.cpp(262): warning C4101: 'x': unreferenced local variable src\binaryen-shell.cpp(290): warning C4101: 'e': unreferenced local variable src\binaryen-shell.cpp(310): warning C4101: 'e': unreferenced local variable --- src/binaryen-shell.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/binaryen-shell.cpp') diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp index 182c0dfd6..78ff91150 100644 --- a/src/binaryen-shell.cpp +++ b/src/binaryen-shell.cpp @@ -259,7 +259,7 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm, } try { instance->callExport(entry, arguments); - } catch (ExitException& x) { + } catch (ExitException&) { } } } @@ -287,7 +287,7 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm, throw ParseException(); }) ); - } catch (const ParseException& e) { + } catch (const ParseException&) { invalid = true; } if (!invalid) { @@ -307,7 +307,7 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm, try { Invocation invocation(*curr[1], instance, *builder->get()); result = invocation.invoke(); - } catch (const TrapException& e) { + } catch (const TrapException&) { trapped = true; } if (id == ASSERT_RETURN) { -- cgit v1.2.3