Skip to content

Commit 9dc6f7d

Browse files
committed
Re-Format code
Basically, apply PPD formatting
1 parent 10218d6 commit 9dc6f7d

File tree

2 files changed

+74
-74
lines changed

2 files changed

+74
-74
lines changed

include/ur_client_library/queue/atomicops.h

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@
1919

2020
// Platform detection
2121
#if defined(__INTEL_COMPILER)
22-
#define AE_ICC
22+
# define AE_ICC
2323
#elif defined(_MSC_VER)
24-
#define AE_VCPP
24+
# define AE_VCPP
2525
#elif defined(__GNUC__)
26-
#define AE_GCC
26+
# define AE_GCC
2727
#endif
2828

2929
#if defined(_M_IA64) || defined(__ia64__)
30-
#define AE_ARCH_IA64
30+
# define AE_ARCH_IA64
3131
#elif defined(_WIN64) || defined(__amd64__) || defined(_M_X64) || defined(__x86_64__)
32-
#define AE_ARCH_X64
32+
# define AE_ARCH_X64
3333
#elif defined(_M_IX86) || defined(__i386__)
34-
#define AE_ARCH_X86
34+
# define AE_ARCH_X86
3535
#elif defined(_M_PPC) || defined(__powerpc__)
36-
#define AE_ARCH_PPC
36+
# define AE_ARCH_PPC
3737
#else
38-
#define AE_ARCH_UNKNOWN
38+
# define AE_ARCH_UNKNOWN
3939
#endif
4040

4141
// AE_UNUSED
4242
#define AE_UNUSED(x) ((void)x)
4343

4444
// AE_FORCEINLINE
4545
#if defined(AE_VCPP) || defined(AE_ICC)
46-
#define AE_FORCEINLINE __forceinline
46+
# define AE_FORCEINLINE __forceinline
4747
#elif defined(AE_GCC)
4848
// #define AE_FORCEINLINE __attribute__((always_inline))
49-
#define AE_FORCEINLINE inline
49+
# define AE_FORCEINLINE inline
5050
#else
51-
#define AE_FORCEINLINE inline
51+
# define AE_FORCEINLINE inline
5252
#endif
5353

5454
// AE_ALIGN
5555
#if defined(AE_VCPP) || defined(AE_ICC)
56-
#define AE_ALIGN(x) __declspec(align(x))
56+
# define AE_ALIGN(x) __declspec(align(x))
5757
#elif defined(AE_GCC)
58-
#define AE_ALIGN(x) __attribute__((aligned(x)))
58+
# define AE_ALIGN(x) __attribute__((aligned(x)))
5959
#else
6060
// Assume GCC compliant syntax...
61-
#define AE_ALIGN(x) __attribute__((aligned(x)))
61+
# define AE_ALIGN(x) __attribute__((aligned(x)))
6262
#endif
6363

6464
// Portable atomic fences implemented below:
@@ -83,28 +83,28 @@ enum memory_order
8383
#if (defined(AE_VCPP) && (_MSC_VER < 1700 || defined(__cplusplus_cli))) || defined(AE_ICC)
8484
// VS2010 and ICC13 don't support std::atomic_*_fence, implement our own fences
8585

86-
#include <intrin.h>
87-
88-
#if defined(AE_ARCH_X64) || defined(AE_ARCH_X86)
89-
#define AeFullSync _mm_mfence
90-
#define AeLiteSync _mm_mfence
91-
#elif defined(AE_ARCH_IA64)
92-
#define AeFullSync __mf
93-
#define AeLiteSync __mf
94-
#elif defined(AE_ARCH_PPC)
95-
#include <ppcintrinsics.h>
96-
#define AeFullSync __sync
97-
#define AeLiteSync __lwsync
98-
#endif
99-
100-
#ifdef AE_VCPP
101-
#pragma warning(push)
102-
#pragma warning(disable : 4365) // Disable erroneous 'conversion from long to unsigned int, signed/unsigned mismatch'
103-
// error when using `assert`
104-
#ifdef __cplusplus_cli
105-
#pragma managed(push, off)
106-
#endif
107-
#endif
86+
# include <intrin.h>
87+
88+
# if defined(AE_ARCH_X64) || defined(AE_ARCH_X86)
89+
# define AeFullSync _mm_mfence
90+
# define AeLiteSync _mm_mfence
91+
# elif defined(AE_ARCH_IA64)
92+
# define AeFullSync __mf
93+
# define AeLiteSync __mf
94+
# elif defined(AE_ARCH_PPC)
95+
# include <ppcintrinsics.h>
96+
# define AeFullSync __sync
97+
# define AeLiteSync __lwsync
98+
# endif
99+
100+
# ifdef AE_VCPP
101+
# pragma warning(push)
102+
# pragma warning(disable : 4365) // Disable erroneous 'conversion from long to unsigned int, signed/unsigned
103+
// mismatch' error when using `assert`
104+
# ifdef __cplusplus_cli
105+
# pragma managed(push, off)
106+
# endif
107+
# endif
108108

109109
namespace moodycamel
110110
{
@@ -134,7 +134,7 @@ AE_FORCEINLINE void compilerFence(memory_order order)
134134
// x86/x64 have a strong memory model -- all loads and stores have
135135
// acquire and release semantics automatically (so only need compiler
136136
// barriers for those).
137-
#if defined(AE_ARCH_X86) || defined(AE_ARCH_X64)
137+
# if defined(AE_ARCH_X86) || defined(AE_ARCH_X64)
138138
AE_FORCEINLINE void fence(memory_order order)
139139
{
140140
switch (order)
@@ -159,7 +159,7 @@ AE_FORCEINLINE void fence(memory_order order)
159159
assert(false);
160160
}
161161
}
162-
#else
162+
# else
163163
AE_FORCEINLINE void fence(memory_order order)
164164
{
165165
// Non-specialized arch, use heavier memory barriers everywhere just in case :-(
@@ -191,11 +191,11 @@ AE_FORCEINLINE void fence(memory_order order)
191191
assert(false);
192192
}
193193
}
194-
#endif
194+
# endif
195195
} // end namespace moodycamel
196196
#else
197197
// Use standard library of atomics
198-
#include <atomic>
198+
# include <atomic>
199199

200200
namespace moodycamel
201201
{
@@ -250,11 +250,11 @@ AE_FORCEINLINE void fence(memory_order order)
250250
#endif
251251

252252
#if !defined(AE_VCPP) || (_MSC_VER >= 1700 && !defined(__cplusplus_cli))
253-
#define AE_USE_STD_ATOMIC_FOR_WEAK_ATOMIC
253+
# define AE_USE_STD_ATOMIC_FOR_WEAK_ATOMIC
254254
#endif
255255

256256
#ifdef AE_USE_STD_ATOMIC_FOR_WEAK_ATOMIC
257-
#include <atomic>
257+
# include <atomic>
258258
#endif
259259
#include <utility>
260260

@@ -272,7 +272,7 @@ class WeakAtomic
272272
{
273273
}
274274
#ifdef AE_VCPP
275-
#pragma warning(disable : 4100) // Get rid of (erroneous) 'unreferenced formal parameter' warning
275+
# pragma warning(disable : 4100) // Get rid of (erroneous) 'unreferenced formal parameter' warning
276276
#endif
277277
template <typename U>
278278
WeakAtomic(U&& x) : value_(std::forward<U>(x))
@@ -291,7 +291,7 @@ class WeakAtomic
291291
{
292292
}
293293
#ifdef AE_VCPP
294-
#pragma warning(default : 4100)
294+
# pragma warning(default : 4100)
295295
#endif
296296

297297
AE_FORCEINLINE operator T() const
@@ -319,32 +319,32 @@ class WeakAtomic
319319

320320
AE_FORCEINLINE T fetchAddAcquire(T increment)
321321
{
322-
#if defined(AE_ARCH_X64) || defined(AE_ARCH_X86)
322+
# if defined(AE_ARCH_X64) || defined(AE_ARCH_X86)
323323
if (sizeof(T) == 4)
324324
return _InterlockedExchangeAdd((long volatile*)&value_, (long)increment);
325-
#if defined(_M_AMD64)
325+
# if defined(_M_AMD64)
326326
else if (sizeof(T) == 8)
327327
return _InterlockedExchangeAdd64((long long volatile*)&value_, (long long)increment);
328-
#endif
329-
#else
330-
#error Unsupported platform
331-
#endif
328+
# endif
329+
# else
330+
# error Unsupported platform
331+
# endif
332332
assert(false && "T must be either a 32 or 64 bit type");
333333
return value_;
334334
}
335335

336336
AE_FORCEINLINE T fetchAddRelease(T increment)
337337
{
338-
#if defined(AE_ARCH_X64) || defined(AE_ARCH_X86)
338+
# if defined(AE_ARCH_X64) || defined(AE_ARCH_X86)
339339
if (sizeof(T) == 4)
340340
return _InterlockedExchangeAdd((long volatile*)&value_, (long)increment);
341-
#if defined(_M_AMD64)
341+
# if defined(_M_AMD64)
342342
else if (sizeof(T) == 8)
343343
return _InterlockedExchangeAdd64((long long volatile*)&value_, (long long)increment);
344-
#endif
345-
#else
346-
#error Unsupported platform
347-
#endif
344+
# endif
345+
# else
346+
# error Unsupported platform
347+
# endif
348348
assert(false && "T must be either a 32 or 64 bit type");
349349
return value_;
350350
}
@@ -407,9 +407,9 @@ __declspec(dllimport) unsigned long __stdcall WaitForSingleObject(void* hHandle,
407407
__declspec(dllimport) int __stdcall ReleaseSemaphore(void* hSemaphore, long lReleaseCount, long* lpPreviousCount);
408408
}
409409
#elif defined(__MACH__)
410-
#include <mach/mach.h>
410+
# include <mach/mach.h>
411411
#elif defined(__unix__)
412-
#include <semaphore.h>
412+
# include <semaphore.h>
413413
#endif
414414

415415
namespace moodycamel
@@ -625,7 +625,7 @@ class Semaphore
625625
}
626626
};
627627
#else
628-
#error Unsupported platform! (No semaphore wrapper available)
628+
# error Unsupported platform! (No semaphore wrapper available)
629629
#endif
630630

631631
//---------------------------------------------------------
@@ -731,8 +731,8 @@ class LightweightSemaphore
731731
} // end namespace moodycamel
732732

733733
#if defined(AE_VCPP) && (_MSC_VER < 1700 || defined(__cplusplus_cli))
734-
#pragma warning(pop)
735-
#ifdef __cplusplus_cli
736-
#pragma managed(pop)
737-
#endif
734+
# pragma warning(pop)
735+
# ifdef __cplusplus_cli
736+
# pragma managed(pop)
737+
# endif
738738
#endif

include/ur_client_library/queue/readerwriterqueue.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <utility>
1414
#include "atomicops.h"
1515
#if __cplusplus > 199711L || _MSC_VER >= 1700 // C++11 or VS2012
16-
#include <chrono>
16+
# include <chrono>
1717
#endif
1818

1919
// A lock-free queue for a single-consumer, single-producer architecture.
@@ -30,21 +30,21 @@
3030
// Using the queue exclusively from one thread is fine, though a bit silly.
3131

3232
#ifndef MOODYCAMEL_CACHE_LINE_SIZE
33-
#define MOODYCAMEL_CACHE_LINE_SIZE 64
33+
# define MOODYCAMEL_CACHE_LINE_SIZE 64
3434
#endif
3535

3636
#ifndef MOODYCAMEL_EXCEPTIONS_ENABLED
37-
#if (defined(_MSC_VER) && defined(_CPPUNWIND)) || (defined(__GNUC__) && defined(__EXCEPTIONS)) || \
38-
(!defined(_MSC_VER) && !defined(__GNUC__))
39-
#define MOODYCAMEL_EXCEPTIONS_ENABLED
40-
#endif
37+
# if (defined(_MSC_VER) && defined(_CPPUNWIND)) || (defined(__GNUC__) && defined(__EXCEPTIONS)) || \
38+
(!defined(_MSC_VER) && !defined(__GNUC__))
39+
# define MOODYCAMEL_EXCEPTIONS_ENABLED
40+
# endif
4141
#endif
4242

4343
#ifdef AE_VCPP
44-
#pragma warning(push)
45-
#pragma warning(disable : 4324) // structure was padded due to __declspec(align())
46-
#pragma warning(disable : 4820) // padding was added
47-
#pragma warning(disable : 4127) // conditional expression is constant
44+
# pragma warning(push)
45+
# pragma warning(disable : 4324) // structure was padded due to __declspec(align())
46+
# pragma warning(disable : 4820) // padding was added
47+
# pragma warning(disable : 4127) // conditional expression is constant
4848
#endif
4949

5050
namespace moodycamel
@@ -861,5 +861,5 @@ class BlockingReaderWriterQueue
861861
} // end namespace moodycamel
862862

863863
#ifdef AE_VCPP
864-
#pragma warning(pop)
864+
# pragma warning(pop)
865865
#endif

0 commit comments

Comments
 (0)