aboutsummaryrefslogtreecommitdiff
path: root/include/gsl/gsl_assert
diff options
context:
space:
mode:
authorTiago <tiagomacarios@users.noreply.github.com>2017-04-20 07:51:37 -0700
committerNeil MacIntosh <neilmac@microsoft.com>2017-04-20 07:51:37 -0700
commitebe7ebfd855a95eb93783164ffb342dbd85cbc27 (patch)
tree6f0e8f434b6efde44a165dc1100f9a70eef617e3 /include/gsl/gsl_assert
parentc5851a8161938798c5594a66420cb814fea92711 (diff)
downloadMicrosoft-GSL-ebe7ebfd855a95eb93783164ffb342dbd85cbc27.tar.gz
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.
Diffstat (limited to 'include/gsl/gsl_assert')
-rw-r--r--include/gsl/gsl_assert30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/gsl/gsl_assert b/include/gsl/gsl_assert
index fdfe0b0..43da231 100644
--- a/include/gsl/gsl_assert
+++ b/include/gsl/gsl_assert
@@ -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