aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/assert.h
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2021-10-12 16:56:52 +0200
committerGitHub <noreply@github.com>2021-10-12 07:56:52 -0700
commit40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf (patch)
treec46f06f4c40d85e308017e379a97fd1aebcebef1 /src/nvim/assert.h
parentee342d3cef97aa2414c05261b448228ae3277862 (diff)
downloadrneovim-40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf.tar.gz
rneovim-40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf.tar.bz2
rneovim-40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf.zip
refactor: format all C files under nvim/ #15977
* refactor: format all C files under nvim * refactor: disable formatting for Vim-owned files: * src/nvim/indent_c.c * src/nvim/regexp.c * src/nvim/regexp_nfa.c * src/nvim/testdir/samples/memfile_test.c
Diffstat (limited to 'src/nvim/assert.h')
-rw-r--r--src/nvim/assert.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/nvim/assert.h b/src/nvim/assert.h
index 1361879876..fc1a4be164 100644
--- a/src/nvim/assert.h
+++ b/src/nvim/assert.h
@@ -49,11 +49,11 @@
#define STATIC_ASSERT_PRAGMA_START
#define STATIC_ASSERT_PRAGMA_END
#define STATIC_ASSERT(cond, msg) \
- do { \
- STATIC_ASSERT_PRAGMA_START \
- STATIC_ASSERT_STATEMENT(cond, msg); \
- STATIC_ASSERT_PRAGMA_END \
- } while (0)
+ do { \
+ STATIC_ASSERT_PRAGMA_START \
+ STATIC_ASSERT_STATEMENT(cond, msg); \
+ STATIC_ASSERT_PRAGMA_END \
+ } while (0)
// the easiest case, when the mode is C11 (generic compiler) or Clang
// advertises explicit support for c_static_assert, meaning it won't warn.
@@ -68,19 +68,19 @@
# undef STATIC_ASSERT_PRAGMA_START
-#if __GNUC__ >= 6
-# define STATIC_ASSERT_PRAGMA_START \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
-#else
-# define STATIC_ASSERT_PRAGMA_START \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-pedantic\"")
-#endif
+# if __GNUC__ >= 6
+# define STATIC_ASSERT_PRAGMA_START \
+ _Pragma("GCC diagnostic push")\
+ _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
+# else
+# define STATIC_ASSERT_PRAGMA_START \
+ _Pragma("GCC diagnostic push")\
+ _Pragma("GCC diagnostic ignored \"-pedantic\"")
+# endif
# undef STATIC_ASSERT_PRAGMA_END
# define STATIC_ASSERT_PRAGMA_END \
- _Pragma("GCC diagnostic pop")
+ _Pragma("GCC diagnostic pop")
// the same goes for clang in C99 mode, but we suppress a different warning
#elif defined(__clang__) && __has_extension(c_static_assert)
@@ -89,12 +89,12 @@
# undef STATIC_ASSERT_PRAGMA_START
# define STATIC_ASSERT_PRAGMA_START \
- _Pragma("clang diagnostic push") \
- _Pragma("clang diagnostic ignored \"-Wc11-extensions\"")
+ _Pragma("clang diagnostic push")\
+ _Pragma("clang diagnostic ignored \"-Wc11-extensions\"")
# undef STATIC_ASSERT_PRAGMA_END
# define STATIC_ASSERT_PRAGMA_END \
- _Pragma("clang diagnostic pop")
+ _Pragma("clang diagnostic pop")
// TODO(aktau): verify that this works, don't have MSVC on hand.
#elif _MSC_VER >= 1600
@@ -113,14 +113,14 @@
// These can't be used after statements in c89.
#ifdef __COUNTER__
# define STATIC_ASSERT_EXPR(e, m) \
- ((enum { ASSERT_CONCAT(static_assert_, __COUNTER__) = 1/(!!(e)) }) 0)
+ ((enum { ASSERT_CONCAT(static_assert_, __COUNTER__) = 1/(!!(e)) }) 0)
#else
// This can't be used twice on the same line so ensure if using in headers
// that the headers are not included twice (by wrapping in #ifndef...#endif)
// Note it doesn't cause an issue when used on same line of separate modules
// compiled with gcc -combine -fwhole-program.
# define STATIC_ASSERT_EXPR(e, m) \
- ((enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }) 0)
+ ((enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }) 0)
#endif
/// @def STRICT_ADD