From 0e339e2ef5138f93480a5cc60add1c8a26858907 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 5 Oct 2011 11:58:34 +0200 Subject: [PATCH] Fix boolean logic issues in qcoreapplication_win Task-number: QTBUG-20482 Change-Id: Iadbde59953a86d5f74d68c7cdc36b7706525612c Reviewed-on: http://codereview.qt-project.org/6046 Reviewed-by: Qt Sanity Bot Reviewed-by: Bradley T. Hughes --- src/corelib/kernel/qcoreapplication_win.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index cb6d39a481..1b51e6f568 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -867,9 +867,9 @@ QString decodeMSG(const MSG& msg) long lKeyData = (long)lParam; int repCount = (lKeyData & 0xffff); // Bit 0-15 int scanCode = (lKeyData & 0xf0000) >> 16; // Bit 16-23 - bool contextCode = (lKeyData && 0x20000000); // Bit 29 - bool prevState = (lKeyData && 0x40000000); // Bit 30 - bool transState = (lKeyData && 0x80000000); // Bit 31 + bool contextCode = !!(lKeyData & 0x20000000); // Bit 29 + bool prevState = !!(lKeyData & 0x40000000); // Bit 30 + bool transState = !!(lKeyData & 0x80000000); // Bit 31 parameters.sprintf("Virual-key(0x%x) Scancode(%d) Rep(%d) Contextcode(%d), Prev state(%d), Trans state(%d)", nVirtKey, scanCode, repCount, contextCode, prevState, transState); }