From b20025479124b041c94f9bf6f8053eaa95e46c0c Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Tue, 2 Feb 2016 06:14:34 -0800 Subject: Make Literal's ctors explicit This tends to avoid silly mistakes, which I'm worried about after adding an explicit ctor with the enum WasmType parameter. See 'C++ Coding Standards: 101 Rules, Guidelines, and Best Practices' rule #40 'avoid providing implicit conversion'. --- src/asm2wasm.h | 4 ++-- src/binaryen-shell.cpp | 18 +++++++++--------- src/wasm.h | 12 ++++++------ src/wasm2asm.h | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index d29c36a6e..473384f2e 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1104,13 +1104,13 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { auto isNegative = allocator.alloc(); isNegative->op = LtS; isNegative->left = get(); - isNegative->right = allocator.alloc()->set(0); + isNegative->right = allocator.alloc()->set(Literal(0)); isNegative->finalize(); auto block = allocator.alloc(); block->list.push_back(set); auto flip = allocator.alloc(); flip->op = Sub; - flip->left = allocator.alloc()->set(0); + flip->left = allocator.alloc()->set(Literal(0)); flip->right = get(); flip->type = i32; auto select = allocator.alloc