Skip to content

Commit

Permalink
hid: Don't sign-extend 16-bit values.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Aric Stewart <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
Zebediah Figura authored and julliard committed Feb 6, 2019
1 parent bd9e130 commit b16fb11
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions dlls/hid/hidp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b16fb11

Please sign in to comment.