From d9db39b7c82420470c1a1acae176545514837b8c Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 5 Jan 2018 19:44:04 +0000 Subject: [PATCH] Add explicit param onto operator bool() to not accidentally cast to int --- renderdoc/driver/shaders/spirv/spirv_editor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renderdoc/driver/shaders/spirv/spirv_editor.h b/renderdoc/driver/shaders/spirv/spirv_editor.h index 4c602f6f9..2377858c2 100644 --- a/renderdoc/driver/shaders/spirv/spirv_editor.h +++ b/renderdoc/driver/shaders/spirv/spirv_editor.h @@ -60,7 +60,7 @@ public: return *this; } // utility functions - operator bool() const { return words != NULL && offset < words->size(); } + explicit operator bool() const { return words != NULL && offset < words->size(); } uint32_t &operator*() { return cur(); } const uint32_t &operator*() const { return cur(); } spv::Op opcode() { return spv::Op(cur() & spv::OpCodeMask); }