Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenlib/BLI_assert.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenlib/BLI_assert.h')
-rw-r--r--source/blender/blenlib/BLI_assert.h50
1 files changed, 32 insertions, 18 deletions
diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h
index 52d4858548a..44dc4324328 100644
--- a/source/blender/blenlib/BLI_assert.h
+++ b/source/blender/blenlib/BLI_assert.h
@@ -31,11 +31,11 @@ extern "C" {
#endif
#ifndef NDEBUG /* for BLI_assert */
-#include <stdio.h>
+# include <stdio.h>
#endif
#ifdef _MSC_VER
-#include <crtdbg.h> /* for _STATIC_ASSERT */
+# include <crtdbg.h> /* for _STATIC_ASSERT */
#endif
/* BLI_assert(), default only to print
@@ -46,50 +46,64 @@ extern "C" {
#ifndef NDEBUG
# include "BLI_system.h"
- /* _BLI_ASSERT_PRINT_POS */
+/* _BLI_ASSERT_PRINT_POS */
# if defined(__GNUC__)
# define _BLI_ASSERT_PRINT_POS(a) \
- fprintf(stderr, "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", __FILE__, __LINE__, __func__, #a)
+ fprintf(stderr, \
+ "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", \
+ __FILE__, \
+ __LINE__, \
+ __func__, \
+ #a)
# elif defined(_MSC_VER)
# define _BLI_ASSERT_PRINT_POS(a) \
- fprintf(stderr, "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", __FILE__, __LINE__, __FUNCTION__, #a)
+ fprintf(stderr, \
+ "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", \
+ __FILE__, \
+ __LINE__, \
+ __FUNCTION__, \
+ #a)
# else
# define _BLI_ASSERT_PRINT_POS(a) \
- fprintf(stderr, "BLI_assert failed: %s:%d, at \'%s\'\n", __FILE__, __LINE__, #a)
+ fprintf(stderr, "BLI_assert failed: %s:%d, at \'%s\'\n", __FILE__, __LINE__, #a)
# endif
- /* _BLI_ASSERT_ABORT */
+/* _BLI_ASSERT_ABORT */
# ifdef WITH_ASSERT_ABORT
# define _BLI_ASSERT_ABORT abort
# else
# define _BLI_ASSERT_ABORT() (void)0
# endif
- /* BLI_assert */
+/* BLI_assert */
# define BLI_assert(a) \
- (void)((!(a)) ? ((BLI_system_backtrace(stderr), _BLI_ASSERT_PRINT_POS(a), _BLI_ASSERT_ABORT(), NULL)) : NULL)
+ (void)((!(a)) ? ((BLI_system_backtrace(stderr), \
+ _BLI_ASSERT_PRINT_POS(a), \
+ _BLI_ASSERT_ABORT(), \
+ NULL)) : \
+ NULL)
#else
# define BLI_assert(a) ((void)0)
#endif
/* C++ can't use _Static_assert, expects static_assert() but c++0x only,
* Coverity also errors out. */
-#if (!defined(__cplusplus)) && \
- (!defined(__COVERITY__)) && \
- (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) /* gcc4.6+ only */
+#if (!defined(__cplusplus)) && (!defined(__COVERITY__)) && \
+ (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) /* gcc4.6+ only */
# define BLI_STATIC_ASSERT(a, msg) __extension__ _Static_assert(a, msg);
#elif defined(_MSC_VER)
# define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);
-#else /* older gcc, clang... */
- /* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */
- /* Note we need the two concats below because arguments to ## are not expanded, so we need to
+#else /* older gcc, clang... */
+/* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */
+/* Note we need the two concats below because arguments to ## are not expanded, so we need to
* expand __LINE__ with one indirection before doing the actual concatenation. */
# define _BLI_ASSERT_CONCAT_(a, b) a##b
# define _BLI_ASSERT_CONCAT(a, b) _BLI_ASSERT_CONCAT_(a, b)
- /* This can't be used twice on the same line so ensure if using in headers
+/* 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 BLI_STATIC_ASSERT(a, msg) \
- ; enum { _BLI_ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (int)(!!(a)) };
+ ; \
+ enum { _BLI_ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (int)(!!(a)) };
#endif
#define BLI_STATIC_ASSERT_ALIGN(st, align) \
@@ -99,4 +113,4 @@ extern "C" {
}
#endif
-#endif /* __BLI_ASSERT_H__ */
+#endif /* __BLI_ASSERT_H__ */