Skip to content

Commit 7bba345

Browse files
committed
Remove unused test struct
1 parent c3ab660 commit 7bba345

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

Assets/Tests/InputSystem/Plugins/HIDTests.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ public void Devices_GenericHIDConvertsXAndYUsagesToStickControl()
11221122
}
11231123

11241124
[StructLayout(LayoutKind.Explicit)]
1125-
struct SimpleJoystickLayoutWithStickUshort : IInputStateTypeInfo
1125+
struct SimpleJoystickLayoutWithStick : IInputStateTypeInfo
11261126
{
11271127
[FieldOffset(0)] public byte reportId;
11281128
[FieldOffset(1)] public ushort x;
@@ -1131,16 +1131,6 @@ struct SimpleJoystickLayoutWithStickUshort : IInputStateTypeInfo
11311131
public FourCC format => new FourCC('H', 'I', 'D');
11321132
}
11331133

1134-
[StructLayout(LayoutKind.Explicit)]
1135-
struct SimpleJoystickLayoutWithStickByte : IInputStateTypeInfo
1136-
{
1137-
[FieldOffset(0)] public byte reportId;
1138-
[FieldOffset(1)] public sbyte x;
1139-
[FieldOffset(2)] public sbyte y;
1140-
1141-
public FourCC format => new FourCC('H', 'I', 'D');
1142-
}
1143-
11441134
[Test]
11451135
[Category("Devices")]
11461136
public void Devices_GenericHIDXAndYDrivesStickControl()
@@ -1175,7 +1165,7 @@ public void Devices_GenericHIDXAndYDrivesStickControl()
11751165
Assert.That(device, Is.TypeOf<Joystick>());
11761166
Assert.That(device["Stick"], Is.TypeOf<StickControl>());
11771167

1178-
InputSystem.QueueStateEvent(device, new SimpleJoystickLayoutWithStickUshort { reportId = 1, x = ushort.MaxValue, y = ushort.MinValue });
1168+
InputSystem.QueueStateEvent(device, new SimpleJoystickLayoutWithStick { reportId = 1, x = ushort.MaxValue, y = ushort.MinValue });
11791169
InputSystem.Update();
11801170

11811171
Assert.That(device["stick"].ReadValueAsObject(),

Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private unsafe static int ReadData(int itemSize, byte* currentPtr, byte* endPtr)
277277
return 0;
278278
var data1 = *currentPtr;
279279
var data2 = *(currentPtr + 1);
280-
return (short)(data2 << 8) | data1;
280+
return (short)((data2 << 8) | data1);
281281
}
282282

283283
// Read int.

0 commit comments

Comments
 (0)