diff options
author | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
---|---|---|
committer | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
commit | a9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch) | |
tree | 2dab453d94d5e003379a6cc895eceb84c80e23ec /src/filters/BaseClasses/wxutil.cpp | |
parent | aafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff) |
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren
http://astyle.sourceforge.net/
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/BaseClasses/wxutil.cpp')
-rw-r--r-- | src/filters/BaseClasses/wxutil.cpp | 401 |
1 files changed, 237 insertions, 164 deletions
diff --git a/src/filters/BaseClasses/wxutil.cpp b/src/filters/BaseClasses/wxutil.cpp index 271f68da0..65e3c904a 100644 --- a/src/filters/BaseClasses/wxutil.cpp +++ b/src/filters/BaseClasses/wxutil.cpp @@ -17,8 +17,10 @@ CAMEvent::CAMEvent(BOOL fManualReset, __inout_opt HRESULT *phr)
{
m_hEvent = CreateEvent(NULL, fManualReset, FALSE, NULL);
- if (NULL == m_hEvent) {
- if (NULL != phr && SUCCEEDED(*phr)) {
+ if(NULL == m_hEvent)
+ {
+ if(NULL != phr && SUCCEEDED(*phr))
+ {
*phr = E_OUTOFMEMORY;
}
}
@@ -27,8 +29,10 @@ CAMEvent::CAMEvent(BOOL fManualReset, __inout_opt HRESULT *phr) CAMEvent::CAMEvent(__inout_opt HRESULT *phr)
{
m_hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (NULL == m_hEvent) {
- if (NULL != phr && SUCCEEDED(*phr)) {
+ if(NULL == m_hEvent)
+ {
+ if(NULL != phr && SUCCEEDED(*phr))
+ {
*phr = E_OUTOFMEMORY;
}
}
@@ -36,8 +40,9 @@ CAMEvent::CAMEvent(__inout_opt HRESULT *phr) CAMEvent::~CAMEvent()
{
- if (m_hEvent) {
- EXECUTE_ASSERT(CloseHandle(m_hEvent));
+ if(m_hEvent)
+ {
+ EXECUTE_ASSERT(CloseHandle(m_hEvent));
}
}
@@ -63,30 +68,35 @@ BOOL CAMMsgEvent::WaitMsg(DWORD dwTimeout) // the timeout will eventually run down as we iterate
// processing messages. grab the start time so that
// we can calculate elapsed times.
- if (dwWaitTime != INFINITE) {
+ if(dwWaitTime != INFINITE)
+ {
dwStartTime = timeGetTime();
}
- do {
- dwWait = MsgWaitForMultipleObjects(1,&m_hEvent,FALSE, dwWaitTime, QS_SENDMESSAGE);
- if (dwWait == WAIT_OBJECT_0 + 1) {
- MSG Message;
- PeekMessage(&Message,NULL,0,0,PM_NOREMOVE);
+ do
+ {
+ dwWait = MsgWaitForMultipleObjects(1, &m_hEvent, FALSE, dwWaitTime, QS_SENDMESSAGE);
+ if(dwWait == WAIT_OBJECT_0 + 1)
+ {
+ MSG Message;
+ PeekMessage(&Message, NULL, 0, 0, PM_NOREMOVE);
- // If we have an explicit length of time to wait calculate
- // the next wake up point - which might be now.
- // If dwTimeout is INFINITE, it stays INFINITE
- if (dwWaitTime != INFINITE) {
+ // If we have an explicit length of time to wait calculate
+ // the next wake up point - which might be now.
+ // If dwTimeout is INFINITE, it stays INFINITE
+ if(dwWaitTime != INFINITE)
+ {
- DWORD dwElapsed = timeGetTime()-dwStartTime;
+ DWORD dwElapsed = timeGetTime() - dwStartTime;
- dwWaitTime =
- (dwElapsed >= dwTimeout)
- ? 0 // wake up with WAIT_TIMEOUT
- : dwTimeout-dwElapsed;
- }
+ dwWaitTime =
+ (dwElapsed >= dwTimeout)
+ ? 0 // wake up with WAIT_TIMEOUT
+ : dwTimeout - dwElapsed;
+ }
}
- } while (dwWait == WAIT_OBJECT_0 + 1);
+ }
+ while(dwWait == WAIT_OBJECT_0 + 1);
// return TRUE if we woke on the event handle,
// FALSE if we timed out.
@@ -103,7 +113,8 @@ CAMThread::CAMThread(__inout_opt HRESULT *phr) m_hThread = NULL;
}
-CAMThread::~CAMThread() {
+CAMThread::~CAMThread()
+{
Close();
}
@@ -114,7 +125,8 @@ DWORD WINAPI CAMThread::InitialThreadProc(__inout LPVOID pv)
{
HRESULT hrCoInit = CAMThread::CoInitializeHelper();
- if(FAILED(hrCoInit)) {
+ if(FAILED(hrCoInit))
+ {
DbgLog((LOG_ERROR, 1, TEXT("CoInitializeEx failed.")));
}
@@ -122,7 +134,8 @@ CAMThread::InitialThreadProc(__inout LPVOID pv) HRESULT hr = pThread->ThreadProc();
- if(SUCCEEDED(hrCoInit)) {
+ if(SUCCEEDED(hrCoInit))
+ {
CoUninitialize();
}
@@ -136,20 +149,22 @@ CAMThread::Create() CAutoLock lock(&m_AccessLock);
- if (ThreadExists()) {
- return FALSE;
+ if(ThreadExists())
+ {
+ return FALSE;
}
m_hThread = CreateThread(
- NULL,
- 0,
- CAMThread::InitialThreadProc,
- this,
- 0,
- &threadid);
-
- if (!m_hThread) {
- return FALSE;
+ NULL,
+ 0,
+ CAMThread::InitialThreadProc,
+ this,
+ 0,
+ &threadid);
+
+ if(!m_hThread)
+ {
+ return FALSE;
}
return TRUE;
@@ -161,8 +176,9 @@ CAMThread::CallWorker(DWORD dwParam) // lock access to the worker thread for scope of this object
CAutoLock lock(&m_AccessLock);
- if (!ThreadExists()) {
- return (DWORD) E_FAIL;
+ if(!ThreadExists())
+ {
+ return (DWORD) E_FAIL;
}
// set the parameter
@@ -190,13 +206,17 @@ CAMThread::GetRequest() BOOL
CAMThread::CheckRequest(__out_opt DWORD * pParam)
{
- if (!m_EventSend.Check()) {
- return FALSE;
- } else {
- if (pParam) {
- *pParam = m_dwParam;
- }
- return TRUE;
+ if(!m_EventSend.Check())
+ {
+ return FALSE;
+ }
+ else
+ {
+ if(pParam)
+ {
+ *pParam = m_dwParam;
+ }
+ return TRUE;
}
}
@@ -238,13 +258,13 @@ HRESULT CAMThread::CoInitializeHelper() HINSTANCE hOle = GetModuleHandle(TEXT("ole32.dll"));
if(hOle)
{
- typedef HRESULT (STDAPICALLTYPE *PCoInitializeEx)(
+ typedef HRESULT(STDAPICALLTYPE * PCoInitializeEx)(
LPVOID pvReserved, DWORD dwCoInit);
PCoInitializeEx pCoInitializeEx =
(PCoInitializeEx)(GetProcAddress(hOle, "CoInitializeEx"));
if(pCoInitializeEx)
{
- hr = (*pCoInitializeEx)(0, COINIT_DISABLE_OLE1DDE );
+ hr = (*pCoInitializeEx)(0, COINIT_DISABLE_OLE1DDE);
}
}
else
@@ -261,34 +281,38 @@ HRESULT CAMThread::CoInitializeHelper() // queue when the thread exited
CMsgThread::~CMsgThread()
{
- if (m_hThread != NULL) {
+ if(m_hThread != NULL)
+ {
WaitForSingleObject(m_hThread, INFINITE);
EXECUTE_ASSERT(CloseHandle(m_hThread));
}
POSITION pos = m_ThreadQueue.GetHeadPosition();
- while (pos) {
+ while(pos)
+ {
CMsg * pMsg = m_ThreadQueue.GetNext(pos);
delete pMsg;
}
m_ThreadQueue.RemoveAll();
- if (m_hSem != NULL) {
+ if(m_hSem != NULL)
+ {
EXECUTE_ASSERT(CloseHandle(m_hSem));
}
}
BOOL
CMsgThread::CreateThread(
- )
+)
{
m_hSem = CreateSemaphore(NULL, 0, 0x7FFFFFFF, NULL);
- if (m_hSem == NULL) {
+ if(m_hSem == NULL)
+ {
return FALSE;
}
m_hThread = ::CreateThread(NULL, 0, DefaultThreadProc,
- (LPVOID)this, 0, &m_ThreadId);
+ (LPVOID)this, 0, &m_ThreadId);
return m_hThread != NULL;
}
@@ -301,7 +325,7 @@ CMsgThread::CreateThread( DWORD WINAPI
CMsgThread::DefaultThreadProc(
__inout LPVOID lpParam
- )
+)
{
CMsgThread *lpThis = (CMsgThread *)lpParam;
CMsg msg;
@@ -313,11 +337,13 @@ CMsgThread::DefaultThreadProc( // allow a derived class to handle thread startup
lpThis->OnThreadInit();
- do {
- lpThis->GetThreadMsg(&msg);
- lResult = lpThis->ThreadMessageProc(msg.uMsg,msg.dwFlags,
- msg.lpParam, msg.pEvent);
- } while (lResult == 0L);
+ do
+ {
+ lpThis->GetThreadMsg(&msg);
+ lResult = lpThis->ThreadMessageProc(msg.uMsg, msg.dwFlags,
+ msg.lpParam, msg.pEvent);
+ }
+ while(lResult == 0L);
// !!!
CoUninitialize();
@@ -334,13 +360,17 @@ CMsgThread::GetThreadMsg(__out CMsg *msg) CMsg * pmsg = NULL;
// keep trying until a message appears
- while (TRUE) {
+ while(TRUE)
+ {
{
CAutoLock lck(&m_Lock);
pmsg = m_ThreadQueue.RemoveHead();
- if (pmsg == NULL) {
+ if(pmsg == NULL)
+ {
m_lWaiting++;
- } else {
+ }
+ else
+ {
break;
}
}
@@ -359,14 +389,18 @@ CMsgThread::GetThreadMsg(__out CMsg *msg) void WINAPI IntToWstr(int i, __out_ecount(12) LPWSTR wstr)
{
#ifdef UNICODE
- if (FAILED(StringCchPrintf(wstr, 12, L"%d", i))) {
+ if(FAILED(StringCchPrintf(wstr, 12, L"%d", i)))
+ {
wstr[0] = 0;
}
#else
TCHAR temp[12];
- if (FAILED(StringCchPrintf(temp, NUMELMS(temp), "%d", i))) {
+ if(FAILED(StringCchPrintf(temp, NUMELMS(temp), "%d", i)))
+ {
wstr[0] = 0;
- } else {
+ }
+ else
+ {
MultiByteToWideChar(CP_ACP, 0, temp, -1, wstr, 12);
}
#endif
@@ -382,40 +416,44 @@ void * __stdcall memmoveInternal(void * dst, const void * src, size_t count) void * ret = dst;
#ifdef _X86_
- if (dst <= src || (char *)dst >= ((char *)src + count)) {
+ if(dst <= src || (char *)dst >= ((char *)src + count))
+ {
/*
* Non-Overlapping Buffers
* copy from lower addresses to higher addresses
*/
- _asm {
- mov esi,src
- mov edi,dst
- mov ecx,count
+ _asm
+ {
+ mov esi, src
+ mov edi, dst
+ mov ecx, count
cld
- mov edx,ecx
- and edx,MEMORY_ALIGNMENT_MASK
- shr ecx,MEMORY_ALIGNMENT_LOG2
+ mov edx, ecx
+ and edx, MEMORY_ALIGNMENT_MASK
+ shr ecx, MEMORY_ALIGNMENT_LOG2
rep movsd
- or ecx,edx
+ or ecx, edx
jz memmove_done
rep movsb
-memmove_done:
+ memmove_done:
}
}
- else {
+ else
+ {
/*
* Overlapping Buffers
* copy from higher addresses to lower addresses
*/
- _asm {
- mov esi,src
- mov edi,dst
- mov ecx,count
+ _asm
+ {
+ mov esi, src
+ mov edi, dst
+ mov ecx, count
std
- add esi,ecx
- add edi,ecx
+ add esi, ecx
+ add edi, ecx
dec esi
dec edi
rep movsb
@@ -439,20 +477,20 @@ HRESULT AMSafeMemMoveOffset( __in size_t count)
{
// prevent read overruns
- if( count + cb_src_offset < count || // prevent integer overflow
- count + cb_src_offset > src_size) // prevent read overrun
+ if(count + cb_src_offset < count || // prevent integer overflow
+ count + cb_src_offset > src_size) // prevent read overrun
{
return E_INVALIDARG;
}
// prevent write overruns
- if( count + cb_dst_offset < count || // prevent integer overflow
- count + cb_dst_offset > dst_size) // prevent write overrun
+ if(count + cb_dst_offset < count || // prevent integer overflow
+ count + cb_dst_offset > dst_size) // prevent write overrun
{
return E_INVALIDARG;
}
- memmoveInternal( (BYTE *)dst+cb_dst_offset, (BYTE *)src+cb_src_offset, count);
+ memmoveInternal((BYTE *)dst + cb_dst_offset, (BYTE *)src + cb_src_offset, count);
return S_OK;
}
@@ -483,26 +521,30 @@ CCritSec::~CCritSec() void CCritSec::Lock()
{
- UINT tracelevel=3;
+ UINT tracelevel = 3;
DWORD us = GetCurrentThreadId();
DWORD currentOwner = m_currentOwner;
- if (currentOwner && (currentOwner != us)) {
+ if(currentOwner && (currentOwner != us))
+ {
// already owned, but not by us
- if (m_fTrace) {
+ if(m_fTrace)
+ {
DbgLog((LOG_LOCKING, 2, TEXT("Thread %d about to wait for lock %x owned by %d"),
- GetCurrentThreadId(), &m_CritSec, currentOwner));
- tracelevel=2;
- // if we saw the message about waiting for the critical
- // section we ensure we see the message when we get the
- // critical section
+ GetCurrentThreadId(), &m_CritSec, currentOwner));
+ tracelevel = 2;
+ // if we saw the message about waiting for the critical
+ // section we ensure we see the message when we get the
+ // critical section
}
}
EnterCriticalSection(&m_CritSec);
- if (0 == m_lockCount++) {
+ if(0 == m_lockCount++)
+ {
// we now own it for the first time. Set owner information
m_currentOwner = us;
- if (m_fTrace) {
+ if(m_fTrace)
+ {
DbgLog((LOG_LOCKING, tracelevel, TEXT("Thread %d now owns lock %x"), m_currentOwner, &m_CritSec));
}
}
@@ -510,28 +552,33 @@ void CCritSec::Lock() bool CCritSec::TryLock()
{
- UINT tracelevel=3;
+ UINT tracelevel = 3;
DWORD us = GetCurrentThreadId();
DWORD currentOwner = m_currentOwner;
BOOL bSuccess = TryEnterCriticalSection(&m_CritSec);
- if (bSuccess)
- {
- if (0 == m_lockCount++) {
- // we now own it for the first time. Set owner information
- m_currentOwner = us;
-
- if (m_fTrace) {
- DbgLog((LOG_LOCKING, tracelevel, TEXT("Thread %d now owns lock %x"), m_currentOwner, &m_CritSec));
- }
- }
- }
- return bSuccess != 0;
-}
-
-void CCritSec::Unlock() {
- if (0 == --m_lockCount) {
+ if(bSuccess)
+ {
+ if(0 == m_lockCount++)
+ {
+ // we now own it for the first time. Set owner information
+ m_currentOwner = us;
+
+ if(m_fTrace)
+ {
+ DbgLog((LOG_LOCKING, tracelevel, TEXT("Thread %d now owns lock %x"), m_currentOwner, &m_CritSec));
+ }
+ }
+ }
+ return bSuccess != 0;
+}
+
+void CCritSec::Unlock()
+{
+ if(0 == --m_lockCount)
+ {
// about to be unowned
- if (m_fTrace) {
+ if(m_fTrace)
+ {
DbgLog((LOG_LOCKING, 3, TEXT("Thread %d releasing lock %x"), m_currentOwner, &m_CritSec));
}
@@ -569,16 +616,16 @@ BOOL WINAPI CritCheckOut(const CCritSec * pcCrit) STDAPI WriteBSTR(__deref_out BSTR *pstrDest, LPCWSTR szSrc)
{
- *pstrDest = SysAllocString( szSrc );
- if( !(*pstrDest) ) return E_OUTOFMEMORY;
+ *pstrDest = SysAllocString(szSrc);
+ if(!(*pstrDest)) return E_OUTOFMEMORY;
return NOERROR;
}
STDAPI FreeBSTR(__deref_in BSTR* pstr)
{
- if( (PVOID)*pstr == NULL ) return S_FALSE;
- SysFreeString( *pstr );
+ if((PVOID)*pstr == NULL) return S_FALSE;
+ SysFreeString(*pstr);
return NOERROR;
}
@@ -595,12 +642,14 @@ STDAPI AMGetWideString(LPCWSTR psz, __deref_out LPWSTR *ppszReturn) *ppszReturn = NULL;
size_t nameLen;
HRESULT hr = StringCbLengthW(psz, 100000, &nameLen);
- if (FAILED(hr)) {
+ if(FAILED(hr))
+ {
return hr;
}
*ppszReturn = (LPWSTR)CoTaskMemAlloc(nameLen + sizeof(WCHAR));
- if (*ppszReturn == NULL) {
- return E_OUTOFMEMORY;
+ if(*ppszReturn == NULL)
+ {
+ return E_OUTOFMEMORY;
}
CopyMemory(*ppszReturn, psz, nameLen + sizeof(WCHAR));
return NOERROR;
@@ -626,35 +675,42 @@ DWORD WINAPI WaitDispatchingMessages( static UINT uMsgId = 0;
HANDLE hObjects[2] = { hObject, hEvent };
- if (dwWait != INFINITE && dwWait != 0) {
+ if(dwWait != INFINITE && dwWait != 0)
+ {
dwStart = GetTickCount();
}
- for (; ; ) {
+ for(; ;)
+ {
DWORD nCount = NULL != hEvent ? 2 : 1;
// Minimize the chance of actually dispatching any messages
// by seeing if we can lock immediately.
dwResult = WaitForMultipleObjects(nCount, hObjects, FALSE, 0);
- if (dwResult < WAIT_OBJECT_0 + nCount) {
+ if(dwResult < WAIT_OBJECT_0 + nCount)
+ {
break;
}
DWORD dwTimeOut = dwWait;
- if (dwTimeOut > 10) {
+ if(dwTimeOut > 10)
+ {
dwTimeOut = 10;
}
dwResult = MsgWaitForMultipleObjects(
- nCount,
- hObjects,
- FALSE,
- dwTimeOut,
- hwnd == NULL ? QS_SENDMESSAGE :
- QS_SENDMESSAGE + QS_POSTMESSAGE);
- if (dwResult == WAIT_OBJECT_0 + nCount ||
- dwResult == WAIT_TIMEOUT && dwTimeOut != dwWait) {
+ nCount,
+ hObjects,
+ FALSE,
+ dwTimeOut,
+ hwnd == NULL ? QS_SENDMESSAGE :
+ QS_SENDMESSAGE + QS_POSTMESSAGE);
+ if(dwResult == WAIT_OBJECT_0 + nCount ||
+ dwResult == WAIT_TIMEOUT && dwTimeOut != dwWait)
+ {
MSG msg;
- if (hwnd != NULL) {
- while (PeekMessage(&msg, hwnd, uMsg, uMsg, PM_REMOVE)) {
+ if(hwnd != NULL)
+ {
+ while(PeekMessage(&msg, hwnd, uMsg, uMsg, PM_REMOVE))
+ {
DispatchMessage(&msg);
}
}
@@ -662,41 +718,54 @@ DWORD WINAPI WaitDispatchingMessages( // messages
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
- if (dwWait != INFINITE && dwWait != 0) {
+ if(dwWait != INFINITE && dwWait != 0)
+ {
DWORD dwNow = GetTickCount();
// Working with differences handles wrap-around
DWORD dwDiff = dwNow - dwStart;
- if (dwDiff > dwWait) {
+ if(dwDiff > dwWait)
+ {
dwWait = 0;
- } else {
+ }
+ else
+ {
dwWait -= dwDiff;
}
dwStart = dwNow;
}
- if (!bPeeked) {
+ if(!bPeeked)
+ {
// Raise our priority to prevent our message queue
// building up
dwThreadPriority = GetThreadPriority(GetCurrentThread());
- if (dwThreadPriority < THREAD_PRIORITY_HIGHEST) {
+ if(dwThreadPriority < THREAD_PRIORITY_HIGHEST)
+ {
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
}
bPeeked = TRUE;
}
- } else {
+ }
+ else
+ {
break;
}
}
- if (bPeeked) {
+ if(bPeeked)
+ {
SetThreadPriority(GetCurrentThread(), dwThreadPriority);
- if (HIWORD(GetQueueStatus(QS_POSTMESSAGE)) & QS_POSTMESSAGE) {
- if (uMsgId == 0) {
+ if(HIWORD(GetQueueStatus(QS_POSTMESSAGE)) & QS_POSTMESSAGE)
+ {
+ if(uMsgId == 0)
+ {
uMsgId = RegisterWindowMessage(TEXT("AMUnblock"));
}
- if (uMsgId != 0) {
+ if(uMsgId != 0)
+ {
MSG msg;
// Remove old ones
- while (PeekMessage(&msg, (HWND)-1, uMsgId, uMsgId, PM_REMOVE)) {
+ while(PeekMessage(&msg, (HWND) - 1, uMsgId, uMsgId, PM_REMOVE))
+ {
}
}
PostThreadMessage(GetCurrentThreadId(), uMsgId, 0, 0);
@@ -720,9 +789,9 @@ HRESULT AmGetLastErrorToHResult() IUnknown* QzAtlComPtrAssign(__deref_inout_opt IUnknown** pp, __in_opt IUnknown* lp)
{
- if (lp != NULL)
+ if(lp != NULL)
lp->AddRef();
- if (*pp)
+ if(*pp)
(*pp)->Release();
*pp = lp;
return lp;
@@ -737,48 +806,52 @@ timeSetEvent() if the current operating system supports it. TIME_KILL_SYNCHRONO is supported on Windows XP and later operating systems.
Parameters:
-- The same parameters as timeSetEvent(). See timeSetEvent()'s documentation in
+- The same parameters as timeSetEvent(). See timeSetEvent()'s documentation in
the Platform SDK for more information.
Return Value:
-- The same return value as timeSetEvent(). See timeSetEvent()'s documentation in
+- The same return value as timeSetEvent(). See timeSetEvent()'s documentation in
the Platform SDK for more information.
******************************************************************************/
-MMRESULT CompatibleTimeSetEvent( UINT uDelay, UINT uResolution, __in LPTIMECALLBACK lpTimeProc, DWORD_PTR dwUser, UINT fuEvent )
+MMRESULT CompatibleTimeSetEvent(UINT uDelay, UINT uResolution, __in LPTIMECALLBACK lpTimeProc, DWORD_PTR dwUser, UINT fuEvent)
{
- #if WINVER >= 0x0501
+#if WINVER >= 0x0501
{
static bool fCheckedVersion = false;
- static bool fTimeKillSynchronousFlagAvailable = false;
+ static bool fTimeKillSynchronousFlagAvailable = false;
- if( !fCheckedVersion ) {
+ if(!fCheckedVersion)
+ {
fTimeKillSynchronousFlagAvailable = TimeKillSynchronousFlagAvailable();
fCheckedVersion = true;
}
- if( fTimeKillSynchronousFlagAvailable ) {
+ if(fTimeKillSynchronousFlagAvailable)
+ {
fuEvent = fuEvent | TIME_KILL_SYNCHRONOUS;
}
}
- #endif // WINVER >= 0x0501
+#endif // WINVER >= 0x0501
- return timeSetEvent( uDelay, uResolution, lpTimeProc, dwUser, fuEvent );
+ return timeSetEvent(uDelay, uResolution, lpTimeProc, dwUser, fuEvent);
}
-bool TimeKillSynchronousFlagAvailable( void )
+bool TimeKillSynchronousFlagAvailable(void)
{
OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(osverinfo);
- if( GetVersionEx( &osverinfo ) ) {
-
+ if(GetVersionEx(&osverinfo))
+ {
+
// Windows XP's major version is 5 and its' minor version is 1.
// timeSetEvent() started supporting the TIME_KILL_SYNCHRONOUS flag
// in Windows XP.
- if( (osverinfo.dwMajorVersion > 5) ||
- ( (osverinfo.dwMajorVersion == 5) && (osverinfo.dwMinorVersion >= 1) ) ) {
+ if((osverinfo.dwMajorVersion > 5) ||
+ ((osverinfo.dwMajorVersion == 5) && (osverinfo.dwMinorVersion >= 1)))
+ {
return true;
}
}
|