Author: sginsberg
Date: Fri Aug 1 09:12:32 2008
New Revision: 35005
URL:
http://svn.reactos.org/svn/reactos?rev=35005&view=rev
Log:
- Minor coding style improvement
Modified:
trunk/reactos/dll/win32/kernel32/synch/event.c
Modified: trunk/reactos/dll/win32/kernel32/synch/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/e…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/event.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/synch/event.c [iso-8859-1] Fri Aug 1 09:12:32 2008
@@ -9,7 +9,6 @@
/* INCLUDES *****************************************************************/
#include <k32.h>
-
#define NDEBUG
#include <debug.h>
@@ -73,13 +72,16 @@
/* 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 @@
{
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 @@
{
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,