mirror of
https://github.com/reactos/reactos.git
synced 2026-06-09 17:33:50 +08:00
[USBPORT] Fix incorrect use of bitfields.
EndpointMoved == TRUE could never be true, because BOOL is a signed type, and the only two values in a signed one-bit type are 0 and -1. Courtesy of VS analysis warning C6299: Explicitly comparing a bit field to a Boolean type will yield unexpected results.
This commit is contained in:
@@ -644,7 +644,7 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
|
||||
TransferType = TtEndpoint->TtEndpointParams.TransferType;
|
||||
|
||||
if (Rebalance->RebalanceEndpoint[Num] &&
|
||||
TtEndpoint->TtEndpointParams.EndpointMoved == TRUE &&
|
||||
TtEndpoint->TtEndpointParams.EndpointMoved &&
|
||||
((TransferType != USBPORT_TRANSFER_TYPE_INTERRUPT) || BusTime >= 0))
|
||||
{
|
||||
DPRINT("USB2_MoveTtEndpoint: result - FALSE\n");
|
||||
@@ -668,7 +668,7 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
|
||||
*OutResult = FALSE;
|
||||
}
|
||||
|
||||
TtEndpoint->TtEndpointParams.EndpointMoved = TRUE;
|
||||
TtEndpoint->TtEndpointParams.EndpointMoved = 1;
|
||||
|
||||
if (Rebalance->RebalanceEndpoint[Num] == NULL)
|
||||
{
|
||||
|
||||
@@ -486,8 +486,8 @@ typedef union _USB2_TT_ENDPOINT_PARAMS {
|
||||
struct {
|
||||
ULONG TransferType : 4;
|
||||
ULONG Direction : 1;
|
||||
USB_DEVICE_SPEED DeviceSpeed : 2;
|
||||
BOOL EndpointMoved : 1;
|
||||
ULONG DeviceSpeed : 2;
|
||||
ULONG EndpointMoved : 1;
|
||||
ULONG Reserved : 24;
|
||||
};
|
||||
ULONG AsULONG;
|
||||
|
||||
Reference in New Issue
Block a user