1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Bring that Whole New World to the Old Continent too

Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
Rémi Verschelde
2017-03-19 00:36:26 +01:00
parent 1d418afe86
commit f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions

View File

@@ -31,76 +31,68 @@
#ifdef WINDOWS_ENABLED
void MutexWindows::lock() {
#ifdef WINDOWS_USE_MUTEX
WaitForSingleObject(mutex,INFINITE);
WaitForSingleObject(mutex, INFINITE);
#else
EnterCriticalSection( &mutex );
EnterCriticalSection(&mutex);
#endif
}
void MutexWindows::unlock() {
#ifdef WINDOWS_USE_MUTEX
ReleaseMutex(mutex);
#else
LeaveCriticalSection( &mutex );
LeaveCriticalSection(&mutex);
#endif
}
Error MutexWindows::try_lock() {
#ifdef WINDOWS_USE_MUTEX
return (WaitForSingleObject(mutex,0)==WAIT_TIMEOUT)?ERR_BUSY:OK;
return (WaitForSingleObject(mutex, 0) == WAIT_TIMEOUT) ? ERR_BUSY : OK;
#else
if (TryEnterCriticalSection( &mutex ))
return OK;
else
return ERR_BUSY;
if (TryEnterCriticalSection(&mutex))
return OK;
else
return ERR_BUSY;
#endif
}
Mutex *MutexWindows::create_func_windows(bool p_recursive) {
return memnew( MutexWindows );
return memnew(MutexWindows);
}
void MutexWindows::make_default() {
create_func=create_func_windows;
create_func = create_func_windows;
}
MutexWindows::MutexWindows() {
#ifdef WINDOWS_USE_MUTEX
mutex = CreateMutex( NULL, FALSE, NULL );
mutex = CreateMutex(NULL, FALSE, NULL);
#else
#ifdef WINRT_ENABLED
InitializeCriticalSectionEx( &mutex, 0, 0 );
#else
InitializeCriticalSection( &mutex );
#endif
#ifdef WINRT_ENABLED
InitializeCriticalSectionEx(&mutex, 0, 0);
#else
InitializeCriticalSection(&mutex);
#endif
#endif
}
MutexWindows::~MutexWindows() {
#ifdef WINDOWS_USE_MUTEX
CloseHandle(mutex);
CloseHandle(mutex);
#else
DeleteCriticalSection(&mutex);
DeleteCriticalSection(&mutex);
#endif
}
#endif