mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:16:07 +00: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:
parent
fd28a69de6
commit
f5c5426924
2 changed files with 4 additions and 4 deletions
|
@ -644,7 +644,7 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
|
||||||
TransferType = TtEndpoint->TtEndpointParams.TransferType;
|
TransferType = TtEndpoint->TtEndpointParams.TransferType;
|
||||||
|
|
||||||
if (Rebalance->RebalanceEndpoint[Num] &&
|
if (Rebalance->RebalanceEndpoint[Num] &&
|
||||||
TtEndpoint->TtEndpointParams.EndpointMoved == TRUE &&
|
TtEndpoint->TtEndpointParams.EndpointMoved &&
|
||||||
((TransferType != USBPORT_TRANSFER_TYPE_INTERRUPT) || BusTime >= 0))
|
((TransferType != USBPORT_TRANSFER_TYPE_INTERRUPT) || BusTime >= 0))
|
||||||
{
|
{
|
||||||
DPRINT("USB2_MoveTtEndpoint: result - FALSE\n");
|
DPRINT("USB2_MoveTtEndpoint: result - FALSE\n");
|
||||||
|
@ -668,7 +668,7 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
|
||||||
*OutResult = FALSE;
|
*OutResult = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TtEndpoint->TtEndpointParams.EndpointMoved = TRUE;
|
TtEndpoint->TtEndpointParams.EndpointMoved = 1;
|
||||||
|
|
||||||
if (Rebalance->RebalanceEndpoint[Num] == NULL)
|
if (Rebalance->RebalanceEndpoint[Num] == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -486,8 +486,8 @@ typedef union _USB2_TT_ENDPOINT_PARAMS {
|
||||||
struct {
|
struct {
|
||||||
ULONG TransferType : 4;
|
ULONG TransferType : 4;
|
||||||
ULONG Direction : 1;
|
ULONG Direction : 1;
|
||||||
USB_DEVICE_SPEED DeviceSpeed : 2;
|
ULONG DeviceSpeed : 2;
|
||||||
BOOL EndpointMoved : 1;
|
ULONG EndpointMoved : 1;
|
||||||
ULONG Reserved : 24;
|
ULONG Reserved : 24;
|
||||||
};
|
};
|
||||||
ULONG AsULONG;
|
ULONG AsULONG;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue