Reformat files to follow clang-format style (#492)
Project files were not following the clang-format style. For people using IDEs were clang-format is always run after a save this would cause unwanted changes. This commit only applies "clang-format -i" to files.
This commit is contained in:
1 parent
c5851a8161
commit
ebe7ebfd85
20 files changed
+1965
-1892
No files matched your search
+15
-15
@@ -32,18 +32,18 @@
|
||||
//
|
||||
#if !(defined(GSL_THROW_ON_CONTRACT_VIOLATION) || defined(GSL_TERMINATE_ON_CONTRACT_VIOLATION) || \
|
||||
defined(GSL_UNENFORCED_ON_CONTRACT_VIOLATION))
|
||||
#define GSL_TERMINATE_ON_CONTRACT_VIOLATION
|
||||
#define GSL_TERMINATE_ON_CONTRACT_VIOLATION
|
||||
#endif
|
||||
|
||||
#define GSL_STRINGIFY_DETAIL(x) #x
|
||||
#define GSL_STRINGIFY(x) GSL_STRINGIFY_DETAIL(x)
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#define GSL_LIKELY(x) __builtin_expect (!!(x), 1)
|
||||
#define GSL_UNLIKELY(x) __builtin_expect (!!(x), 0)
|
||||
#define GSL_LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
#define GSL_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
#define GSL_LIKELY(x) (!!(x))
|
||||
#define GSL_UNLIKELY(x) (!!(x))
|
||||
#define GSL_LIKELY(x) (!!(x))
|
||||
#define GSL_UNLIKELY(x) (!!(x))
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -53,13 +53,13 @@
|
||||
// whether or not cond is actually evaluated.
|
||||
//
|
||||
#ifdef _MSC_VER
|
||||
#define GSL_ASSUME(cond) __assume(cond)
|
||||
#define GSL_ASSUME(cond) __assume(cond)
|
||||
#elif defined(__clang__)
|
||||
#define GSL_ASSUME(cond) __builtin_assume(cond)
|
||||
#define GSL_ASSUME(cond) __builtin_assume(cond)
|
||||
#elif defined(__GNUC__)
|
||||
#define GSL_ASSUME(cond) ((cond) ? static_cast<void>(0) : __builtin_unreachable())
|
||||
#define GSL_ASSUME(cond) ((cond) ? static_cast<void>(0) : __builtin_unreachable())
|
||||
#else
|
||||
#define GSL_ASSUME(cond) static_cast<void>(!!(cond))
|
||||
#define GSL_ASSUME(cond) static_cast<void>(!!(cond))
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -76,18 +76,18 @@ struct fail_fast : public std::logic_error
|
||||
|
||||
#if defined(GSL_THROW_ON_CONTRACT_VIOLATION)
|
||||
|
||||
#define GSL_CONTRACT_CHECK(type, cond) \
|
||||
(GSL_LIKELY(cond) ? static_cast<void>(0) : \
|
||||
throw gsl::fail_fast("GSL: " type " failure at " __FILE__ ": " GSL_STRINGIFY(__LINE__)))
|
||||
#define GSL_CONTRACT_CHECK(type, cond) \
|
||||
(GSL_LIKELY(cond) ? static_cast<void>(0) \
|
||||
: throw gsl::fail_fast("GSL: " type " failure at " __FILE__ \
|
||||
": " GSL_STRINGIFY(__LINE__)))
|
||||
|
||||
#elif defined(GSL_TERMINATE_ON_CONTRACT_VIOLATION)
|
||||
|
||||
#define GSL_CONTRACT_CHECK(type, cond) \
|
||||
(GSL_LIKELY(cond) ? static_cast<void>(0) : std::terminate())
|
||||
#define GSL_CONTRACT_CHECK(type, cond) (GSL_LIKELY(cond) ? static_cast<void>(0) : std::terminate())
|
||||
|
||||
#elif defined(GSL_UNENFORCED_ON_CONTRACT_VIOLATION)
|
||||
|
||||
#define GSL_CONTRACT_CHECK(type, cond) GSL_ASSUME(cond)
|
||||
#define GSL_CONTRACT_CHECK(type, cond) GSL_ASSUME(cond)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user