From 5f8a67250f96f11ab23538db43036cf4213e9f61 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sun, 4 Oct 2015 01:10:11 +1300 Subject: [PATCH] Bitset: Make bool() operator explicit. --- Source/Core/Common/BitSet.h | 3 +-- Source/Core/Common/Logging/LogManager.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/BitSet.h b/Source/Core/Common/BitSet.h index 6abae8bf22..25d3e8ba2d 100644 --- a/Source/Core/Common/BitSet.h +++ b/Source/Core/Common/BitSet.h @@ -164,8 +164,7 @@ public: BitSet& operator|=(BitSet other) { return *this = *this | other; } BitSet& operator&=(BitSet other) { return *this = *this & other; } BitSet& operator^=(BitSet other) { return *this = *this ^ other; } - operator u32() const = delete; - operator bool() const { return m_val != 0; } + explicit operator bool() const { return m_val != 0; } // Warning: Even though on modern CPUs this is a single fast instruction, // Dolphin's official builds do not currently assume POPCNT support on x86, diff --git a/Source/Core/Common/Logging/LogManager.h b/Source/Core/Common/Logging/LogManager.h index 6a03ec45fe..5f806b2ad5 100644 --- a/Source/Core/Common/Logging/LogManager.h +++ b/Source/Core/Common/Logging/LogManager.h @@ -75,7 +75,7 @@ public: void SetLevel(LogTypes::LOG_LEVELS level) { m_level = level; } - bool HasListeners() const { return m_listener_ids; } + bool HasListeners() const { return bool(m_listener_ids); } typedef class BitSet32::Iterator iterator; iterator begin() const { return m_listener_ids.begin(); }