Zebediah Figura : hid: Don't sign-extend 16-bit values.
Alexandre Julliard
julliard at winehq.org
Wed Feb 6 15:32:29 CST 2019
Module: wine
Branch: master
Commit: b16fb11890b59a80816d6906e7b7b4ce52f88555
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b16fb11890b59a80816d6906e7b7b4ce52f88555
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Tue Feb 5 13:09:39 2019 -0600
hid: Don't sign-extend 16-bit values.
Some controllers (including, with the previous patch, any reported
through SDL) may report a logical range of [0,65535], which takes up
16 bits but should not be sign-extended.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/hid/hidp.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c
index f997803..15d827e 100644
--- a/dlls/hid/hidp.c
+++ b/dlls/hid/hidp.c
@@ -277,8 +277,6 @@ NTSTATUS WINAPI HidP_GetScaledUsageValue(HIDP_REPORT_TYPE ReportType, USAGE Usag
element->valueStartBit, element->bitCount, &rawValue);
if (rc != HIDP_STATUS_SUCCESS)
return rc;
- if (element->caps.value.BitSize == 16)
- rawValue = (short)rawValue;
*UsageValue = rawValue;
}
@@ -925,8 +923,6 @@ NTSTATUS WINAPI HidP_GetData(HIDP_REPORT_TYPE ReportType, HIDP_DATA *DataList, U
element->valueStartBit, element->bitCount, &v);
if (rc != HIDP_STATUS_SUCCESS)
return rc;
- if (element->caps.value.BitSize == 16)
- v = (short)v;
DataList[uCount].DataIndex = element->caps.value.u.NotRange.DataIndex;
DataList[uCount].u.RawValue = v;
}
More information about the wine-cvs
mailing list