Fix MSVC compiler warning:
"unsafe mix of type 'const bool' and type 'int' in operation"
(cherry picked from commit e3600594a5ede4f6af3ba3881a0a9c62d3cb0aec)