From 5ee9e0a0e34da622e525a58b4cfa8ebab3a0b1a1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 12 Nov 2019 15:40:30 -0800 Subject: Cast to bool after bitwise operations, to avoid an MSVC warning (#2431) Fixes #2430 --- src/wasm-features.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/wasm-features.h b/src/wasm-features.h index a645c93a8..77759f9e8 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -67,16 +67,18 @@ struct FeatureSet { bool isMVP() const { return features == MVP; } bool has(Feature f) { return (features & f) == f; } - bool hasAtomics() const { return features & Atomics; } - bool hasMutableGlobals() const { return features & MutableGlobals; } - bool hasTruncSat() const { return features & TruncSat; } - bool hasSIMD() const { return features & SIMD; } - bool hasBulkMemory() const { return features & BulkMemory; } - bool hasSignExt() const { return features & SignExt; } - bool hasExceptionHandling() const { return features & ExceptionHandling; } - bool hasTailCall() const { return features & TailCall; } - bool hasReferenceTypes() const { return features & ReferenceTypes; } - bool hasAll() const { return features & All; } + bool hasAtomics() const { return bool(features & Atomics); } + bool hasMutableGlobals() const { return bool(features & MutableGlobals); } + bool hasTruncSat() const { return bool(features & TruncSat); } + bool hasSIMD() const { return bool(features & SIMD); } + bool hasBulkMemory() const { return bool(features & BulkMemory); } + bool hasSignExt() const { return bool(features & SignExt); } + bool hasExceptionHandling() const { + return bool(features & ExceptionHandling); + } + bool hasTailCall() const { return bool(features & TailCall); } + bool hasReferenceTypes() const { return bool(features & ReferenceTypes); } + bool hasAll() const { return bool(features & All); } void makeMVP() { features = MVP; } void set(Feature f, bool v = true) { -- cgit v1.2.3