Author: tkreuzer
Date: Sat Nov 15 22:47:51 2014
New Revision: 65416

URL: http://svn.reactos.org/svn/reactos?rev=65416&view=rev
Log:
[NTOSKRNL]
Remove explicit comparisons with TRUE
Patch by Love Nystrom, adjusted by me
CORE-8799

Modified:
    trunk/reactos/ntoskrnl/cc/pin.c
    trunk/reactos/ntoskrnl/config/cmapi.c
    trunk/reactos/ntoskrnl/fsrtl/fastio.c
    trunk/reactos/ntoskrnl/fstub/disksup.c
    trunk/reactos/ntoskrnl/include/internal/ke_x.h
    trunk/reactos/ntoskrnl/io/iomgr/driver.c
    trunk/reactos/ntoskrnl/io/iomgr/file.c
    trunk/reactos/ntoskrnl/kd64/kdapi.c
    trunk/reactos/ntoskrnl/ke/amd64/except.c
    trunk/reactos/ntoskrnl/ke/arm/exp.c
    trunk/reactos/ntoskrnl/ke/bug.c
    trunk/reactos/ntoskrnl/ke/i386/exp.c
    trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
    trunk/reactos/ntoskrnl/mm/ARM3/session.c
    trunk/reactos/ntoskrnl/se/priv.c

Modified: trunk/reactos/ntoskrnl/cc/pin.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/pin.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/cc/pin.c     [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/pin.c     [iso-8859-1] Sat Nov 15 22:47:51 2014
@@ -165,7 +165,7 @@
     /*
      * FIXME: This is function is similar to CcPinRead, but doesn't
      * read the data if they're not present. Instead it should just
-     * prepare the VACBs and zero them out if Zero == TRUE.
+     * prepare the VACBs and zero them out if Zero != FALSE.
      *
      * For now calling CcPinRead is better than returning error or
      * just having UNIMPLEMENTED here.

Modified: trunk/reactos/ntoskrnl/config/cmapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmapi.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmapi.c       [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmapi.c       [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -2188,7 +2188,7 @@
                         /* Count the current hash entry if it is in use */
                         SubKeys++;
                     }
-                    else if ((CachedKcb->RefCount == 0) && 
(RemoveEmptyCacheEntries == TRUE))
+                    else if ((CachedKcb->RefCount == 0) && 
(RemoveEmptyCacheEntries != FALSE))
                     {
                         /* Remove the current key from the delayed close list 
*/
                         CmpRemoveFromDelayedClose(CachedKcb);

Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/fastio.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/fsrtl/fastio.c       [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fsrtl/fastio.c       [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -218,7 +218,7 @@
             /* File was accessed */
             FileObject->Flags |= FO_FILE_FAST_IO_READ;
 
-            if (Result == TRUE)
+            if (Result != FALSE)
             {
                 ASSERT((IoStatus->Status == STATUS_END_OF_FILE) ||
                        (((ULONGLONG)FileOffset->QuadPart + 
IoStatus->Information) <=
@@ -227,7 +227,7 @@
         }
 
         /* Update the current file offset */
-        if (Result == TRUE)
+        if (Result != FALSE)
         {
             FileObject->CurrentByteOffset.QuadPart = FileOffset->QuadPart + 
IoStatus->Information;
         }
@@ -343,7 +343,7 @@
          * If we append, use the file size as offset.
          * Also, check that we aren't crossing the 4GB boundary.
          */
-        if (FileOffsetAppend == TRUE)
+        if (FileOffsetAppend != FALSE)
         {
             Offset.LowPart = FcbHeader->FileSize.LowPart;
             NewSize.LowPart = FcbHeader->FileSize.LowPart + Length;
@@ -381,7 +381,7 @@
                 /* Then we need to acquire the resource exclusive */
                 ExReleaseResourceLite(FcbHeader->Resource);
                 ExAcquireResourceExclusiveLite(FcbHeader->Resource, TRUE);
-                if (FileOffsetAppend == TRUE)
+                if (FileOffsetAppend != FALSE)
                 {
                     Offset.LowPart = FcbHeader->FileSize.LowPart; // ??
                     NewSize.LowPart = FcbHeader->FileSize.LowPart + Length;
@@ -483,7 +483,7 @@
         PsGetCurrentThread()->TopLevelIrp = 0;
 
         /* Did the operation succeed? */
-        if (Result == TRUE)
+        if (Result != FALSE)
         {
             /* Update the valid file size if necessary */
             if (NewSize.LowPart > FcbHeader->ValidDataLength.LowPart)
@@ -568,7 +568,7 @@
         }
 
         /* Check if we are appending */
-        if (FileOffsetAppend == TRUE)
+        if (FileOffsetAppend != FALSE)
         {
             Offset.QuadPart = FcbHeader->FileSize.QuadPart;
             NewSize.QuadPart = FcbHeader->FileSize.QuadPart + Length;
@@ -1338,7 +1338,7 @@
     }
 
     /* Check if we are appending */
-    if (FileOffsetAppend == TRUE)
+    if (FileOffsetAppend != FALSE)
     {
         Offset.QuadPart = FcbHeader->FileSize.QuadPart;
         NewSize.QuadPart = FcbHeader->FileSize.QuadPart + Length;

Modified: trunk/reactos/ntoskrnl/fstub/disksup.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/disksup.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/fstub/disksup.c      [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fstub/disksup.c      [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -672,7 +672,7 @@
             /* Search for bootable partition */
             for (j = 0; j < NUM_PARTITION_TABLE_ENTRIES && j < 
LayoutArray[DiskNumber]->PartitionCount; j++)
             {
-                if ((LayoutArray[DiskNumber]->PartitionEntry[j].BootIndicator 
== TRUE) &&
+                if ((LayoutArray[DiskNumber]->PartitionEntry[j].BootIndicator 
!= FALSE) &&
                     
IsRecognizedPartition(LayoutArray[DiskNumber]->PartitionEntry[j].PartitionType))
                 {
                     if 
(LayoutArray[DiskNumber]->PartitionEntry[j].RewritePartition == FALSE)

Modified: trunk/reactos/ntoskrnl/include/internal/ke_x.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/ke_x.h?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke_x.h      [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke_x.h      [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -514,7 +514,7 @@
     Value = InterlockedExchange((PLONG)&Thread->ThreadLock, Value);
 
     /* Return the lock state */
-    return (Value == TRUE);
+    return (Value == 1);
 }
 
 FORCEINLINE

Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c    [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -127,7 +127,7 @@
     DriverName.Length = 0;
     DriverName.MaximumLength = sizeof(NameBuffer);
 
-    if (FileSystem == TRUE)
+    if (FileSystem != FALSE)
         RtlAppendUnicodeToString(&DriverName, FILESYSTEM_ROOT_NAME);
     else
         RtlAppendUnicodeToString(&DriverName, DRIVER_ROOT_NAME);
@@ -494,7 +494,7 @@
     /* Create ModuleName string */
     if (ServiceName && ServiceName->Length > 0)
     {
-        if (FileSystemDriver == TRUE)
+        if (FileSystemDriver != FALSE)
             wcscpy(NameBuffer, FILESYSTEM_ROOT_NAME);
         else
             wcscpy(NameBuffer, DRIVER_ROOT_NAME);

Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c      [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c      [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -2104,7 +2104,7 @@
     }
 
     /* Check if we were 100% successful */
-    if ((OpenPacket->ParseCheck == TRUE) && (OpenPacket->FileObject))
+    if ((OpenPacket->ParseCheck != FALSE) && (OpenPacket->FileObject))
     {
         /* Dereference the File Object */
         ObDereferenceObject(OpenPacket->FileObject);
@@ -2375,7 +2375,7 @@
                                 DesiredAccess,
                                 &OpenPacket,
                                 &Handle);
-    if (OpenPacket.ParseCheck != TRUE)
+    if (OpenPacket.ParseCheck == FALSE)
     {
         /* Parse failed */
         IoStatus->Status = Status;
@@ -3188,7 +3188,7 @@
                                 DELETE,
                                 &OpenPacket,
                                 &Handle);
-    if (OpenPacket.ParseCheck != TRUE) return Status;
+    if (OpenPacket.ParseCheck == FALSE) return Status;
 
     /* Retrn the Io status */
     return OpenPacket.FinalStatus;

Modified: trunk/reactos/ntoskrnl/kd64/kdapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kdapi.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/kd64/kdapi.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kd64/kdapi.c [iso-8859-1] Sat Nov 15 22:47:51 2014
@@ -721,7 +721,7 @@
     ASSERT(Data->Length == sizeof(CONTEXT));
 
     /* Make sure that this is a valid request */
-    if ((State->Processor < KeNumberProcessors) && (KdpContextSent == TRUE))
+    if ((State->Processor < KeNumberProcessors) && (KdpContextSent != FALSE))
     {
         /* Check if the request is for this CPU */
         if (State->Processor == KeGetCurrentPrcb()->Number)

Modified: trunk/reactos/ntoskrnl/ke/amd64/except.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/except.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/amd64/except.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/amd64/except.c    [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -277,7 +277,7 @@
     if (PreviousMode == KernelMode)
     {
         /* Check if this is a first-chance exception */
-        if (FirstChance == TRUE)
+        if (FirstChance)
         {
             /* Break into the debugger for the first time */
             if (KiDebugRoutine(TrapFrame,

Modified: trunk/reactos/ntoskrnl/ke/arm/exp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/exp.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/arm/exp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/arm/exp.c [iso-8859-1] Sat Nov 15 22:47:51 2014
@@ -218,7 +218,7 @@
     if (PreviousMode == KernelMode)
     {
         /* Check if this is a first-chance exception */
-        if (FirstChance == TRUE)
+        if (FirstChance != FALSE)
         {
             /* Break into the debugger for the first time */
             if (KiDebugRoutine(TrapFrame,

Modified: trunk/reactos/ntoskrnl/ke/bug.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/bug.c     [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/bug.c     [iso-8859-1] Sat Nov 15 22:47:51 2014
@@ -67,7 +67,7 @@
             i++;
 
             /* Check if this is a kernel entry and we only want drivers */
-            if ((i <= 2) && (DriversOnly == TRUE))
+            if ((i <= 2) && (DriversOnly != FALSE))
             {
                 /* Skip it */
                 NextEntry = NextEntry->Flink;

Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/exp.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/exp.c        [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c        [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -898,7 +898,7 @@
     if (PreviousMode == KernelMode)
     {
         /* Check if this is a first-chance exception */
-        if (FirstChance == TRUE)
+        if (FirstChance != FALSE)
         {
             /* Break into the debugger for the first time */
             if (KiDebugRoutine(TrapFrame,

Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c    [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -1183,7 +1183,7 @@
         if (Pfn1->u3.e2.ReferenceCount == 1)
         {
             /* Is there still a PFN for this page? */
-            if (MI_IS_PFN_DELETED(Pfn1) == TRUE)
+            if (MI_IS_PFN_DELETED(Pfn1))
             {
                 /* Clear the last reference */
                 Pfn1->u3.e2.ReferenceCount = 0;

Modified: trunk/reactos/ntoskrnl/mm/ARM3/session.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/session.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/session.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/session.c    [iso-8859-1] Sat Nov 15 
22:47:51 2014
@@ -519,7 +519,7 @@
     OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
 
     /* Check if we need a page table */
-    if (AllocatedPageTable == TRUE)
+    if (AllocatedPageTable != FALSE)
     {
         /* Get a zeroed colored zero page */
         Color = MI_GET_NEXT_COLOR();

Modified: trunk/reactos/ntoskrnl/se/priv.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/priv.c?rev=65416&r1=65415&r2=65416&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/se/priv.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/se/priv.c    [iso-8859-1] Sat Nov 15 22:47:51 2014
@@ -446,7 +446,7 @@
         PrivilegeSet->PrivilegeCount += Privileges->PrivilegeCount;
 
         /* Free the old privilege set if it was allocated */
-        if (AccessState->PrivilegesAllocated == TRUE)
+        if (AccessState->PrivilegesAllocated != FALSE)
             ExFreePool(AuxData->PrivilegeSet);
 
         /* Now we are using an allocated privilege set */


Reply via email to