1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +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

@@ -28,28 +28,26 @@
/*************************************************************************/
#include "safe_refcount.h"
#ifdef _MSC_VER
// don't pollute my namespace!
#include <windows.h>
long atomic_conditional_increment( register long * pw ) {
long atomic_conditional_increment(register long *pw) {
/* try to increment until it actually works */
// taken from boost
while (true) {
long tmp = static_cast< long const volatile& >( *pw );
if( tmp == 0 )
return 0; // if zero, can't add to it anymore
if( InterlockedCompareExchange( pw, tmp + 1, tmp ) == tmp )
return tmp+1;
long tmp = static_cast<long const volatile &>(*pw);
if (tmp == 0)
return 0; // if zero, can't add to it anymore
if (InterlockedCompareExchange(pw, tmp + 1, tmp) == tmp)
return tmp + 1;
}
}
long atomic_decrement( register long * pw ) {
return InterlockedDecrement( pw );
long atomic_decrement(register long *pw) {
return InterlockedDecrement(pw);
}
#endif