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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c4
-rw-r--r--source/blender/blenlib/BLI_compiler_compat.h41
-rw-r--r--source/blender/blenlib/BLI_map.h19
-rw-r--r--source/blender/editors/screen/area.c3
4 files changed, 36 insertions, 31 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 9f7b6be18a7..7e42f370e9b 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1977,7 +1977,7 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *bvh,
if (mode & PBVH_Collapse) {
EdgeQueue q;
- BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert * [2]), 0, 128, BLI_MEMPOOL_NOP);
+ BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert *) * 2, 0, 128, BLI_MEMPOOL_NOP);
EdgeQueueContext eq_ctx = {
&q,
queue_pool,
@@ -1996,7 +1996,7 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *bvh,
if (mode & PBVH_Subdivide) {
EdgeQueue q;
- BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert * [2]), 0, 128, BLI_MEMPOOL_NOP);
+ BLI_mempool *queue_pool = BLI_mempool_create(sizeof(BMVert *) * 2, 0, 128, BLI_MEMPOOL_NOP);
EdgeQueueContext eq_ctx = {
&q,
queue_pool,
diff --git a/source/blender/blenlib/BLI_compiler_compat.h b/source/blender/blenlib/BLI_compiler_compat.h
index bd1cd327d3c..056ea1a08c6 100644
--- a/source/blender/blenlib/BLI_compiler_compat.h
+++ b/source/blender/blenlib/BLI_compiler_compat.h
@@ -14,8 +14,13 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+/* clang-format off */
+
+/* #define typeof() triggers a bug in some clang-format versions, disable format
+ * for entire file to keep results consistent. */
+
#ifndef __BLI_COMPILER_COMPAT_H__
-# define __BLI_COMPILER_COMPAT_H__
+#define __BLI_COMPILER_COMPAT_H__
/** \file
* \ingroup bli
@@ -23,32 +28,32 @@
* Use to help with cross platform portability.
*/
-# if defined(_MSC_VER)
-# define alloca _alloca
-# endif
+#if defined(_MSC_VER)
+# define alloca _alloca
+#endif
-# if (defined(__GNUC__) || defined(__clang__)) && defined(__cplusplus)
+#if (defined(__GNUC__) || defined(__clang__)) && defined(__cplusplus)
extern "C++" {
/* Some magic to be sure we don't have reference in the type. */
template<typename T> static inline T decltype_helper(T x)
{
return x;
}
-# define typeof(x) decltype(decltype_helper(x))
+#define typeof(x) decltype(decltype_helper(x))
}
-# endif
+#endif
/* little macro so inline keyword works */
-# if defined(_MSC_VER)
-# define BLI_INLINE static __forceinline
-# else
-# define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__))
-# endif
-
-# if defined(__GNUC__)
-# define BLI_NOINLINE __attribute__((noinline))
-# else
-# define BLI_NOINLINE
-# endif
+#if defined(_MSC_VER)
+# define BLI_INLINE static __forceinline
+#else
+# define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__))
+#endif
+
+#if defined(__GNUC__)
+# define BLI_NOINLINE __attribute__((noinline))
+#else
+# define BLI_NOINLINE
+#endif
#endif /* __BLI_COMPILER_COMPAT_H__ */
diff --git a/source/blender/blenlib/BLI_map.h b/source/blender/blenlib/BLI_map.h
index 73b731252b6..6971f9d362e 100644
--- a/source/blender/blenlib/BLI_map.h
+++ b/source/blender/blenlib/BLI_map.h
@@ -637,16 +637,15 @@ template<typename KeyT, typename ValueT, typename Allocator = GuardedAllocator>
template<typename ForwardKeyT, typename ForwardValueT>
bool add_override__impl(ForwardKeyT &&key, ForwardValueT &&value)
{
- return this->add_or_modify(
- std::forward<ForwardKeyT>(key),
- [&](ValueT *dst) {
- new (dst) ValueT(std::forward<ForwardValueT>(value));
- return true;
- },
- [&](ValueT *old_value) {
- *old_value = std::forward<ForwardValueT>(value);
- return false;
- });
+ auto create_func = [&](ValueT *dst) {
+ new (dst) ValueT(std::forward<ForwardValueT>(value));
+ return true;
+ };
+ auto modify_func = [&](ValueT *old_value) {
+ *old_value = std::forward<ForwardValueT>(value);
+ return false;
+ };
+ return this->add_or_modify(std::forward<ForwardKeyT>(key), create_func, modify_func);
}
template<typename ForwardKeyT, typename ForwardValueT>
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 353f3124d37..c9e6cd24ac0 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2943,7 +2943,8 @@ void ED_region_info_draw(ARegion *ar,
float fill_color[4],
const bool full_redraw)
{
- ED_region_info_draw_multiline(ar, (const char * [2]){text, NULL}, fill_color, full_redraw);
+ const char *text_array[2] = {text, NULL};
+ ED_region_info_draw_multiline(ar, text_array, fill_color, full_redraw);
}
#define MAX_METADATA_STR 1024