Author: tkreuzer
Date: Sun Nov 16 14:07:37 2014
New Revision: 65419
URL:
http://svn.reactos.org/svn/reactos?rev=65419&view=rev
Log:
[LIBS]
Remove some explicit comparisons with TRUE and make desired explicit comparison more
obvious.
Patch by Love Nystrom, modified by me. Fixes a bug in RtlUpcaseUnicodeString. Not
committed: modifications to freetype, since this is 3rd party code.
CORE-8799
Modified:
trunk/reactos/lib/cmlib/cmtools.c
trunk/reactos/lib/drivers/hidparser/api.c
trunk/reactos/lib/drivers/hidparser/hidparser.c
trunk/reactos/lib/drivers/hidparser/parser.c
trunk/reactos/lib/drivers/ip/network/routines.c
trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c
trunk/reactos/lib/drivers/sound/mmixer/controls.c
trunk/reactos/lib/rtl/debug.c
trunk/reactos/lib/rtl/env.c
trunk/reactos/lib/rtl/resource.c
trunk/reactos/lib/rtl/time.c
trunk/reactos/lib/rtl/unicode.c
trunk/reactos/lib/sdk/crt/misc/lock.c
Modified: trunk/reactos/lib/cmlib/cmtools.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmtools.c?rev=65…
==============================================================================
--- trunk/reactos/lib/cmlib/cmtools.c [iso-8859-1] (original)
+++ trunk/reactos/lib/cmlib/cmtools.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -44,7 +44,7 @@
{
ULONG i;
- if (NamePacked == TRUE)
+ if (NamePacked)
{
PUCHAR PackedName = (PUCHAR)Name;
@@ -153,7 +153,7 @@
ASSERT(Name != 0);
ASSERT(NameLength != 0);
- if (NamePacked == TRUE)
+ if (NamePacked)
{
NameLength *= sizeof(WCHAR);
CharCount = min(BufferLength, NameLength) / sizeof(WCHAR);
Modified: trunk/reactos/lib/drivers/hidparser/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/api.…
==============================================================================
--- trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -184,7 +184,7 @@
//
// check item type
//
- if (Report->Items[Index].HasData && bData == TRUE)
+ if (Report->Items[Index].HasData && bData)
{
//
// found data item
Modified: trunk/reactos/lib/drivers/hidparser/hidparser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/hidp…
==============================================================================
--- trunk/reactos/lib/drivers/hidparser/hidparser.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/hidparser/hidparser.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -139,9 +139,9 @@
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);
//
Modified: trunk/reactos/lib/drivers/hidparser/parser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/pars…
==============================================================================
--- trunk/reactos/lib/drivers/hidparser/parser.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/hidparser/parser.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -570,7 +570,7 @@
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;
Modified: trunk/reactos/lib/drivers/ip/network/routines.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/rou…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/routines.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/routines.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -63,8 +63,9 @@
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;
}
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] Sun Nov 16 14:07:37
2014
@@ -57,7 +57,7 @@
/* Store audio stream pause state */
SoundDeviceInstance->bPaused = !bStart;
- if (SoundDeviceInstance->bPaused == FALSE && OldState == TRUE)
+ if (SoundDeviceInstance->bPaused == FALSE && OldState)
{
InitiateSoundStreaming(SoundDeviceInstance);
}
Modified: trunk/reactos/lib/drivers/sound/mmixer/controls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/c…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] Sun Nov 16 14:07:37
2014
@@ -1586,7 +1586,7 @@
MMixerIsTopologyPinReserved(Topology, Index, &Reserved);
/* check if it has already been reserved */
- if (Reserved == TRUE)
+ if (Reserved)
{
/* pin has already been reserved */
continue;
Modified: trunk/reactos/lib/rtl/debug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/debug.c?rev=65419&…
==============================================================================
--- trunk/reactos/lib/rtl/debug.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/debug.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -64,7 +64,7 @@
/* 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;
Modified: trunk/reactos/lib/rtl/env.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/env.c?rev=65419&am…
==============================================================================
--- trunk/reactos/lib/rtl/env.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/env.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -535,7 +535,7 @@
}
Value->Length = 0;
- if (SysEnvUsed == TRUE)
+ if (SysEnvUsed)
RtlAcquirePebLock();
wcs = Environment;
@@ -573,7 +573,7 @@
Status = STATUS_BUFFER_TOO_SMALL;
}
- if (SysEnvUsed == TRUE)
+ if (SysEnvUsed)
RtlReleasePebLock();
return(Status);
@@ -582,7 +582,7 @@
wcs++;
}
- if (SysEnvUsed == TRUE)
+ if (SysEnvUsed)
RtlReleasePebLock();
DPRINT("Return STATUS_VARIABLE_NOT_FOUND: %wZ\n", Name);
Modified: trunk/reactos/lib/rtl/resource.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/resource.c?rev=654…
==============================================================================
--- trunk/reactos/lib/rtl/resource.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/resource.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -105,7 +105,7 @@
goto done;
}
wait:
- if (Wait == TRUE)
+ if (Wait)
{
Resource->ExclusiveWaiters++;
@@ -120,10 +120,10 @@
}
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 @@
goto done;
}
- if (Wait == TRUE)
+ if (Wait)
{
Resource->SharedWaiters++;
RtlLeaveCriticalSection(&Resource->Lock);
Modified: trunk/reactos/lib/rtl/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/time.c?rev=65419&a…
==============================================================================
--- trunk/reactos/lib/rtl/time.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/time.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -106,7 +106,7 @@
{
/* 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 @@
if (!RtlTimeFieldsToTime(&AdjustedTimeFields, &CutoverSystemTime))
return FALSE;
- if (ThisYearsCutoverOnly == TRUE ||
- NextYearsCutover == TRUE ||
+ if (ThisYearsCutoverOnly ||
+ NextYearsCutover ||
CutoverSystemTime.QuadPart >= CurrentTime->QuadPart)
{
break;
Modified: trunk/reactos/lib/rtl/unicode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicode.c?rev=6541…
==============================================================================
--- trunk/reactos/lib/rtl/unicode.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/unicode.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -1809,7 +1809,7 @@
PAGED_CODE_RTL();
- if (AllocateDestinationString == TRUE)
+ if (AllocateDestinationString)
{
UniDest->MaximumLength = UniSource->Length;
UniDest->Buffer = RtlpAllocateStringMemory(UniDest->MaximumLength,
TAG_USTR);
@@ -2620,7 +2620,7 @@
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,
Modified: trunk/reactos/lib/sdk/crt/misc/lock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/misc/lock.c?re…
==============================================================================
--- trunk/reactos/lib/sdk/crt/misc/lock.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/misc/lock.c [iso-8859-1] Sun Nov 16 14:07:37 2014
@@ -83,7 +83,7 @@
/* 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 );
}