- Minor coding style improvement
authorStefan Ginsberg <stefanginsberg@gmail.com>
Fri, 1 Aug 2008 14:12:32 +0000 (14:12 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Fri, 1 Aug 2008 14:12:32 +0000 (14:12 +0000)
svn path=/trunk/; revision=35005

reactos/dll/win32/kernel32/synch/event.c

index 6a02b46..0563d07 100644 (file)
@@ -9,7 +9,6 @@
 /* INCLUDES *****************************************************************/
 
 #include <k32.h>
-
 #define NDEBUG
 #include <debug.h>
 
@@ -73,13 +72,16 @@ CreateEventExW(IN LPSECURITY_ATTRIBUTES lpEventAttributes  OPTIONAL,
     /* Now check if we got a name */
     if (lpName) RtlInitUnicodeString(&ObjectName, lpName);
 
+       /* Check for invalid flags */
     if (dwFlags & ~(CREATE_EVENT_INITIAL_SET | CREATE_EVENT_MANUAL_RESET))
     {
+           /* Fail */
         SetLastError(ERROR_INVALID_PARAMETER);
         return NULL;
     }
 
-    InitialState = (dwFlags & CREATE_EVENT_INITIAL_SET) != 0;
+       /* Set initial state and event type */
+    InitialState = (dwFlags & CREATE_EVENT_INITIAL_SET) ? TRUE : FALSE;
     EventType = (dwFlags & CREATE_EVENT_MANUAL_RESET) ? NotificationEvent : SynchronizationEvent;
 
     /* Now convert the object attributes */
@@ -128,12 +130,11 @@ CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes  OPTIONAL,
 {
     DWORD dwFlags = 0;
 
-    if (bManualReset)
-        dwFlags |= CREATE_EVENT_MANUAL_RESET;
-
-    if (bInitialState)
-        dwFlags |= CREATE_EVENT_INITIAL_SET;
+       /* Set new flags */
+    if (bManualReset) dwFlags |= CREATE_EVENT_MANUAL_RESET;
+    if (bInitialState) dwFlags |= CREATE_EVENT_INITIAL_SET;
 
+       /* Call the newer API */
     return CreateEventExA(lpEventAttributes,
                           lpName,
                           dwFlags,
@@ -149,12 +150,11 @@ CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes  OPTIONAL,
 {
     DWORD dwFlags = 0;
 
-    if (bManualReset)
-        dwFlags |= CREATE_EVENT_MANUAL_RESET;
-
-    if (bInitialState)
-        dwFlags |= CREATE_EVENT_INITIAL_SET;
+    /* Set new flags */
+    if (bManualReset) dwFlags |= CREATE_EVENT_MANUAL_RESET;
+    if (bInitialState) dwFlags |= CREATE_EVENT_INITIAL_SET;
 
+    /* Call the newer API */
     return CreateEventExW(lpEventAttributes,
                           lpName,
                           dwFlags,