From 6938b46086a2e0db4aae72b6738be3a07a29fd60 Mon Sep 17 00:00:00 2001 From: PaulStoffregen Date: Thu, 24 Aug 2017 13:55:11 -0700 Subject: [PATCH] Fix compiler warnings --- mouse.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mouse.cpp b/mouse.cpp index 80a9278..b84c52a 100644 --- a/mouse.cpp +++ b/mouse.cpp @@ -134,13 +134,13 @@ void MouseController::new_data(const Transfer_t *transfer) if(packetSize == 20) { buttons = report[1]; - mouseX = ((report[4] & 0x0f) << 8 | (report[3] & 0xff)); - mouseY = ((report[5] & 0xff) << 4 | (report[4] >> 4) & 0x0f); + mouseX = ((report[4] & 0x0f) << 8) | ((report[3] & 0xff)); + mouseY = ((report[5] & 0xff) << 4) | ((report[4] >> 4) & 0x0f); wheel = report[6]; } else { buttons = report[0]; - mouseX = ((report[2] & 0x0f) << 8 | (report[1] & 0xff)); - mouseY = ((report[3] & 0xff) << 4 | (report[2] >> 4) & 0x0f); + mouseX = ((report[2] & 0x0f) << 8) | ((report[1] & 0xff)); + mouseY = ((report[3] & 0xff) << 4) | ((report[2] >> 4) & 0x0f); wheel = report[4]; } mouseEvent = true;