diff --git a/reactos/lib/cmlib/cmtools.c b/reactos/lib/cmlib/cmtools.c index 41a28e8bdd1..9ea7a55d08e 100644 --- a/reactos/lib/cmlib/cmtools.c +++ b/reactos/lib/cmlib/cmtools.c @@ -44,7 +44,7 @@ CmComparePackedNames( { ULONG i; - if (NamePacked == TRUE) + if (NamePacked) { PUCHAR PackedName = (PUCHAR)Name; @@ -153,7 +153,7 @@ CmCopyPackedName( ASSERT(Name != 0); ASSERT(NameLength != 0); - if (NamePacked == TRUE) + if (NamePacked) { NameLength *= sizeof(WCHAR); CharCount = min(BufferLength, NameLength) / sizeof(WCHAR); diff --git a/reactos/lib/drivers/hidparser/api.c b/reactos/lib/drivers/hidparser/api.c index fc73ecf71f3..d4eb327a9a4 100644 --- a/reactos/lib/drivers/hidparser/api.c +++ b/reactos/lib/drivers/hidparser/api.c @@ -184,7 +184,7 @@ HidParser_GetReportItemTypeCountFromReportType( // // check item type // - if (Report->Items[Index].HasData && bData == TRUE) + if (Report->Items[Index].HasData && bData) { // // found data item diff --git a/reactos/lib/drivers/hidparser/hidparser.c b/reactos/lib/drivers/hidparser/hidparser.c index 25a04c19c9a..ca6be3c94c2 100644 --- a/reactos/lib/drivers/hidparser/hidparser.c +++ b/reactos/lib/drivers/hidparser/hidparser.c @@ -139,9 +139,9 @@ HidParser_GetCollectionDescription( DeviceDescription->ReportIDs[Index].FeatureLength = HidParser_GetReportLength((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_FEATURE); - DeviceDescription->ReportIDs[Index].InputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_INPUT) == TRUE ? 1 : 0); - DeviceDescription->ReportIDs[Index].OutputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_OUTPUT) == TRUE ? 1 : 0); - DeviceDescription->ReportIDs[Index].FeatureLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_FEATURE) == TRUE ? 1 : 0); + DeviceDescription->ReportIDs[Index].InputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_INPUT) ? 1 : 0); + DeviceDescription->ReportIDs[Index].OutputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_OUTPUT) ? 1 : 0); + DeviceDescription->ReportIDs[Index].FeatureLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_FEATURE) ? 1 : 0); // diff --git a/reactos/lib/drivers/hidparser/parser.c b/reactos/lib/drivers/hidparser/parser.c index 5912843442c..c314a96fe9b 100644 --- a/reactos/lib/drivers/hidparser/parser.c +++ b/reactos/lib/drivers/hidparser/parser.c @@ -570,7 +570,7 @@ HidParser_InitReportItem( ReportItem->BitCount = GlobalItemState->ReportSize; ReportItem->HasData = (ItemData->DataConstant == FALSE); ReportItem->Array = (ItemData->ArrayVariable == 0); - ReportItem->Relative = (ItemData->Relative == TRUE); + ReportItem->Relative = (ItemData->Relative != FALSE); ReportItem->Minimum = LogicalMinimum; ReportItem->Maximum = LogicalMaximum; ReportItem->UsageMinimum = UsageMinimum; diff --git a/reactos/lib/drivers/ip/network/routines.c b/reactos/lib/drivers/ip/network/routines.c index 48af20b210d..ac7fce520aa 100644 --- a/reactos/lib/drivers/ip/network/routines.c +++ b/reactos/lib/drivers/ip/network/routines.c @@ -63,8 +63,9 @@ VOID DisplayIPPacket( UINT Length; PCHAR CharBuffer; - if ((DbgQueryDebugFilterState(DPFLTR_TCPIP_ID, DEBUG_PBUFFER | DPFLTR_MASK) != TRUE) || - (DbgQueryDebugFilterState(DPFLTR_TCPIP_ID, DEBUG_IP | DPFLTR_MASK) != TRUE)) { + /* DbgQueryDebugFilterState returns (NTSTATUS)TRUE, (NTSTATUS)FALSE or a failure status code */ + if ((DbgQueryDebugFilterState(DPFLTR_TCPIP_ID, DEBUG_PBUFFER | DPFLTR_MASK) != (NTSTATUS)TRUE) || + (DbgQueryDebugFilterState(DPFLTR_TCPIP_ID, DEBUG_IP | DPFLTR_MASK) != (NTSTATUS)TRUE)) { return; } diff --git a/reactos/lib/drivers/sound/mmebuddy/mmewrap.c b/reactos/lib/drivers/sound/mmebuddy/mmewrap.c index bf850d24257..186b69a0c5e 100644 --- a/reactos/lib/drivers/sound/mmebuddy/mmewrap.c +++ b/reactos/lib/drivers/sound/mmebuddy/mmewrap.c @@ -57,7 +57,7 @@ MmeSetState( /* Store audio stream pause state */ SoundDeviceInstance->bPaused = !bStart; - if (SoundDeviceInstance->bPaused == FALSE && OldState == TRUE) + if (SoundDeviceInstance->bPaused == FALSE && OldState) { InitiateSoundStreaming(SoundDeviceInstance); } diff --git a/reactos/lib/drivers/sound/mmixer/controls.c b/reactos/lib/drivers/sound/mmixer/controls.c index e00fca399cd..04fe001dc0e 100644 --- a/reactos/lib/drivers/sound/mmixer/controls.c +++ b/reactos/lib/drivers/sound/mmixer/controls.c @@ -1586,7 +1586,7 @@ MMixerHandleAlternativeMixers( MMixerIsTopologyPinReserved(Topology, Index, &Reserved); /* check if it has already been reserved */ - if (Reserved == TRUE) + if (Reserved) { /* pin has already been reserved */ continue; diff --git a/reactos/lib/rtl/debug.c b/reactos/lib/rtl/debug.c index 25ccbcfb718..88a143a13c4 100644 --- a/reactos/lib/rtl/debug.c +++ b/reactos/lib/rtl/debug.c @@ -64,7 +64,7 @@ vDbgPrintExWithPrefixInternal(IN PCCH Prefix, /* Check if we should print it or not */ if ((ComponentId != MAXULONG) && - (NtQueryDebugFilterState(ComponentId, Level)) != TRUE) + (NtQueryDebugFilterState(ComponentId, Level)) != (NTSTATUS)TRUE) { /* This message is masked */ return STATUS_SUCCESS; diff --git a/reactos/lib/rtl/env.c b/reactos/lib/rtl/env.c index 71e8efb89f1..2135c5a6fd3 100644 --- a/reactos/lib/rtl/env.c +++ b/reactos/lib/rtl/env.c @@ -535,7 +535,7 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment, } Value->Length = 0; - if (SysEnvUsed == TRUE) + if (SysEnvUsed) RtlAcquirePebLock(); wcs = Environment; @@ -573,7 +573,7 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment, Status = STATUS_BUFFER_TOO_SMALL; } - if (SysEnvUsed == TRUE) + if (SysEnvUsed) RtlReleasePebLock(); return(Status); @@ -582,7 +582,7 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment, wcs++; } - if (SysEnvUsed == TRUE) + if (SysEnvUsed) RtlReleasePebLock(); DPRINT("Return STATUS_VARIABLE_NOT_FOUND: %wZ\n", Name); diff --git a/reactos/lib/rtl/resource.c b/reactos/lib/rtl/resource.c index 40f6970ea79..e60e57a1d04 100644 --- a/reactos/lib/rtl/resource.c +++ b/reactos/lib/rtl/resource.c @@ -105,7 +105,7 @@ start: goto done; } wait: - if (Wait == TRUE) + if (Wait) { Resource->ExclusiveWaiters++; @@ -120,10 +120,10 @@ wait: } else /* one or more shared locks are in progress */ { - if (Wait == TRUE) + if (Wait) goto wait; } - if (retVal == TRUE) + if (retVal) Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; done: RtlLeaveCriticalSection(&Resource->Lock); @@ -154,7 +154,7 @@ start: goto done; } - if (Wait == TRUE) + if (Wait) { Resource->SharedWaiters++; RtlLeaveCriticalSection(&Resource->Lock); diff --git a/reactos/lib/rtl/time.c b/reactos/lib/rtl/time.c index fc587ed28a8..e37dd13c7c6 100644 --- a/reactos/lib/rtl/time.c +++ b/reactos/lib/rtl/time.c @@ -106,7 +106,7 @@ RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields, { /* Compute the cutover time of the first day of the current month */ AdjustedTimeFields.Year = CurrentTimeFields.Year; - if (NextYearsCutover == TRUE) + if (NextYearsCutover) AdjustedTimeFields.Year++; AdjustedTimeFields.Month = CutoverTimeFields->Month; @@ -146,8 +146,8 @@ RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields, if (!RtlTimeFieldsToTime(&AdjustedTimeFields, &CutoverSystemTime)) return FALSE; - if (ThisYearsCutoverOnly == TRUE || - NextYearsCutover == TRUE || + if (ThisYearsCutoverOnly || + NextYearsCutover || CutoverSystemTime.QuadPart >= CurrentTime->QuadPart) { break; diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index 3d0efaff55c..321bb417d01 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -1809,7 +1809,7 @@ RtlUpcaseUnicodeString( PAGED_CODE_RTL(); - if (AllocateDestinationString == TRUE) + if (AllocateDestinationString) { UniDest->MaximumLength = UniSource->Length; UniDest->Buffer = RtlpAllocateStringMemory(UniDest->MaximumLength, TAG_USTR); @@ -2620,7 +2620,7 @@ RtlDnsHostNameToComputerName(PUNICODE_STRING ComputerName, PUNICODE_STRING DnsHo ComputerNameOem.Length = (USHORT)ComputerNameOemNLength; ComputerNameOem.MaximumLength = (USHORT)(MAX_COMPUTERNAME_LENGTH + 1); - if (RtlpDidUnicodeToOemWork(DnsHostName, &ComputerNameOem) == TRUE) + if (RtlpDidUnicodeToOemWork(DnsHostName, &ComputerNameOem)) { /* no unmapped character so convert it back to an unicode string */ Status = RtlOemStringToUnicodeString(ComputerName, diff --git a/reactos/lib/sdk/crt/misc/lock.c b/reactos/lib/sdk/crt/misc/lock.c index 4351b07be6a..b15ef47ac7a 100644 --- a/reactos/lib/sdk/crt/misc/lock.c +++ b/reactos/lib/sdk/crt/misc/lock.c @@ -83,7 +83,7 @@ void msvcrt_free_mt_locks(void) /* Uninitialize the table */ for( i=0; i < _TOTAL_LOCKS; i++ ) { - if( lock_table[ i ].bInit == TRUE ) + if( lock_table[ i ].bInit ) { msvcrt_uninitialize_mlock( i ); }