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:
authorCampbell Barton <ideasman42@gmail.com>2021-07-30 09:19:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-07-30 09:19:19 +0300
commit93eb460dd0aca4de33bf780de76eee319c224bae (patch)
tree8ee44df80044964ee00bb1217d00623fd928d891 /source
parentf81a6a2ff1dc34bbffd6ed34cfc49646e1bfc5f9 (diff)
Cleanup: clang-format (re-run after v12 version bump)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_mesh_mapping.h5
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c7
-rw-r--r--source/blender/blenlib/BLI_alloca.h4
-rw-r--r--source/blender/blenlib/BLI_linear_allocator.hh6
-rw-r--r--source/blender/blenlib/BLI_map.hh24
-rw-r--r--source/blender/blenlib/BLI_map_slots.hh4
-rw-r--r--source/blender/blenlib/BLI_resource_scope.hh2
-rw-r--r--source/blender/blenlib/BLI_stack.hh2
-rw-r--r--source/blender/blenlib/BLI_vector.hh4
-rw-r--r--source/blender/blenlib/intern/array_store.c4
-rw-r--r--source/blender/blenlib/intern/fileops.c8
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c6
-rw-r--r--source/blender/blenlib/intern/math_color.c10
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c3
-rw-r--r--source/blender/datatoc/datatoc_icon.c5
-rw-r--r--source/blender/draw/engines/eevee/eevee_cryptomatte.c6
-rw-r--r--source/blender/draw/engines/eevee/eevee_volumes.c7
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c6
-rw-r--r--source/blender/draw/engines/overlay/overlay_armature.c7
-rw-r--r--source/blender/draw/intern/draw_manager_data.c8
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c2
-rw-r--r--source/blender/editors/animation/anim_markers.c3
-rw-r--r--source/blender/editors/armature/armature_edit.c5
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c2
-rw-r--r--source/blender/editors/interface/interface_draw.c32
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c3
-rw-r--r--source/blender/editors/object/object_modifier.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c7
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c7
-rw-r--r--source/blender/functions/FN_generic_virtual_array.hh4
-rw-r--r--source/blender/imbuf/intern/png.c5
-rw-r--r--source/blender/makesdna/DNA_fluid_types.h2
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h6
-rw-r--r--source/blender/nodes/NOD_node_tree_multi_function.hh6
-rw-r--r--source/blender/windowmanager/WM_api.h5
35 files changed, 124 insertions, 97 deletions
diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h
index 327c13c7ce4..0518f303744 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -249,7 +249,10 @@ int *BKE_mesh_calc_smoothgroups(const struct MEdge *medge,
((CHECK_TYPE_ANY( \
_tri, unsigned int *, int *, int[3], const unsigned int *, const int *, const int[3]), \
CHECK_TYPE_ANY(_v, unsigned int, const unsigned int, int, const int)), \
- (((_tri)[0] == _v) ? 0 : ((_tri)[1] == _v) ? 1 : ((_tri)[2] == _v) ? 2 : -1))
+ (((_tri)[0] == _v) ? 0 : \
+ ((_tri)[1] == _v) ? 1 : \
+ ((_tri)[2] == _v) ? 2 : \
+ -1))
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index ffc060bb64e..fae75762cde 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -148,8 +148,11 @@ KeyingSet *BKE_keyingset_add(
/* allocate new KeyingSet */
ks = MEM_callocN(sizeof(KeyingSet), "KeyingSet");
- BLI_strncpy(
- ks->idname, (idname) ? idname : (name) ? name : DATA_("KeyingSet"), sizeof(ks->idname));
+ BLI_strncpy(ks->idname,
+ (idname) ? idname :
+ (name) ? name :
+ DATA_("KeyingSet"),
+ sizeof(ks->idname));
BLI_strncpy(ks->name, (name) ? name : (idname) ? idname : DATA_("Keying Set"), sizeof(ks->name));
ks->flag = flag;
diff --git a/source/blender/blenlib/BLI_alloca.h b/source/blender/blenlib/BLI_alloca.h
index 92567ed35fa..9e3bd98537d 100644
--- a/source/blender/blenlib/BLI_alloca.h
+++ b/source/blender/blenlib/BLI_alloca.h
@@ -28,9 +28,9 @@
#if defined(__GNUC__) || defined(__clang__)
# if defined(__cplusplus) && (__cplusplus > 199711L)
-# define BLI_array_alloca(arr, realsize) (decltype(arr)) alloca(sizeof(*arr) * (realsize))
+# define BLI_array_alloca(arr, realsize) (decltype(arr))alloca(sizeof(*arr) * (realsize))
# else
-# define BLI_array_alloca(arr, realsize) (typeof(arr)) alloca(sizeof(*arr) * (realsize))
+# define BLI_array_alloca(arr, realsize) (typeof(arr))alloca(sizeof(*arr) * (realsize))
# endif
#else
# define BLI_array_alloca(arr, realsize) alloca(sizeof(*arr) * (realsize))
diff --git a/source/blender/blenlib/BLI_linear_allocator.hh b/source/blender/blenlib/BLI_linear_allocator.hh
index 7de6bcfdd98..bb14a6008a7 100644
--- a/source/blender/blenlib/BLI_linear_allocator.hh
+++ b/source/blender/blenlib/BLI_linear_allocator.hh
@@ -121,7 +121,7 @@ template<typename Allocator = GuardedAllocator> class LinearAllocator : NonCopya
* You must not call `delete` on the returned value.
* Instead, only the destructor has to be called.
*/
- template<typename T, typename... Args> destruct_ptr<T> construct(Args &&... args)
+ template<typename T, typename... Args> destruct_ptr<T> construct(Args &&...args)
{
void *buffer = this->allocate(sizeof(T), alignof(T));
T *value = new (buffer) T(std::forward<Args>(args)...);
@@ -134,7 +134,7 @@ template<typename Allocator = GuardedAllocator> class LinearAllocator : NonCopya
* the constructed elements.
*/
template<typename T, typename... Args>
- MutableSpan<T> construct_array(int64_t size, Args &&... args)
+ MutableSpan<T> construct_array(int64_t size, Args &&...args)
{
MutableSpan<T> array = this->allocate_array<T>(size);
for (const int64_t i : IndexRange(size)) {
@@ -186,7 +186,7 @@ template<typename Allocator = GuardedAllocator> class LinearAllocator : NonCopya
}
template<typename T, typename... Args>
- Span<T *> construct_elements_and_pointer_array(int64_t n, Args &&... args)
+ Span<T *> construct_elements_and_pointer_array(int64_t n, Args &&...args)
{
MutableSpan<void *> void_pointers = this->allocate_elements_and_pointer_array(
n, sizeof(T), alignof(T));
diff --git a/source/blender/blenlib/BLI_map.hh b/source/blender/blenlib/BLI_map.hh
index 4d254960f34..0e7d7c06049 100644
--- a/source/blender/blenlib/BLI_map.hh
+++ b/source/blender/blenlib/BLI_map.hh
@@ -248,7 +248,7 @@ class Map {
this->add_new_as(std::move(key), std::move(value));
}
template<typename ForwardKey, typename... ForwardValue>
- void add_new_as(ForwardKey &&key, ForwardValue &&... value)
+ void add_new_as(ForwardKey &&key, ForwardValue &&...value)
{
this->add_new__impl(
std::forward<ForwardKey>(key), hash_(key), std::forward<ForwardValue>(value)...);
@@ -278,7 +278,7 @@ class Map {
return this->add_as(std::move(key), std::move(value));
}
template<typename ForwardKey, typename... ForwardValue>
- bool add_as(ForwardKey &&key, ForwardValue &&... value)
+ bool add_as(ForwardKey &&key, ForwardValue &&...value)
{
return this->add__impl(
std::forward<ForwardKey>(key), hash_(key), std::forward<ForwardValue>(value)...);
@@ -308,7 +308,7 @@ class Map {
return this->add_overwrite_as(std::move(key), std::move(value));
}
template<typename ForwardKey, typename... ForwardValue>
- bool add_overwrite_as(ForwardKey &&key, ForwardValue &&... value)
+ bool add_overwrite_as(ForwardKey &&key, ForwardValue &&...value)
{
return this->add_overwrite__impl(
std::forward<ForwardKey>(key), hash_(key), std::forward<ForwardValue>(value)...);
@@ -414,7 +414,7 @@ class Map {
return this->pop_default_as(key, std::move(default_value));
}
template<typename ForwardKey, typename... ForwardValue>
- Value pop_default_as(const ForwardKey &key, ForwardValue &&... default_value)
+ Value pop_default_as(const ForwardKey &key, ForwardValue &&...default_value)
{
Slot *slot = this->lookup_slot_ptr(key, hash_(key));
if (slot == nullptr) {
@@ -526,7 +526,7 @@ class Map {
return this->lookup_default_as(key, default_value);
}
template<typename ForwardKey, typename... ForwardValue>
- Value lookup_default_as(const ForwardKey &key, ForwardValue &&... default_value) const
+ Value lookup_default_as(const ForwardKey &key, ForwardValue &&...default_value) const
{
const Value *ptr = this->lookup_ptr_as(key);
if (ptr != nullptr) {
@@ -558,7 +558,7 @@ class Map {
return this->lookup_or_add_as(std::move(key), std::move(value));
}
template<typename ForwardKey, typename... ForwardValue>
- Value &lookup_or_add_as(ForwardKey &&key, ForwardValue &&... value)
+ Value &lookup_or_add_as(ForwardKey &&key, ForwardValue &&...value)
{
return this->lookup_or_add__impl(
std::forward<ForwardKey>(key), hash_(key), std::forward<ForwardValue>(value)...);
@@ -1058,7 +1058,7 @@ class Map {
}
template<typename ForwardKey, typename... ForwardValue>
- void add_new__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&... value)
+ void add_new__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
{
BLI_assert(!this->contains_as(key));
@@ -1075,7 +1075,7 @@ class Map {
}
template<typename ForwardKey, typename... ForwardValue>
- bool add__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&... value)
+ bool add__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
{
this->ensure_can_add();
@@ -1148,7 +1148,7 @@ class Map {
}
template<typename ForwardKey, typename... ForwardValue>
- Value &lookup_or_add__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&... value)
+ Value &lookup_or_add__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
{
this->ensure_can_add();
@@ -1166,7 +1166,7 @@ class Map {
}
template<typename ForwardKey, typename... ForwardValue>
- bool add_overwrite__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&... value)
+ bool add_overwrite__impl(ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
{
auto create_func = [&](Value *ptr) {
new (static_cast<void *>(ptr)) Value(std::forward<ForwardValue>(value)...);
@@ -1283,13 +1283,13 @@ template<typename Key, typename Value> class StdUnorderedMapWrapper {
}
template<typename ForwardKey, typename... ForwardValue>
- void add_new(ForwardKey &&key, ForwardValue &&... value)
+ void add_new(ForwardKey &&key, ForwardValue &&...value)
{
map_.insert({std::forward<ForwardKey>(key), Value(std::forward<ForwardValue>(value)...)});
}
template<typename ForwardKey, typename... ForwardValue>
- bool add(ForwardKey &&key, ForwardValue &&... value)
+ bool add(ForwardKey &&key, ForwardValue &&...value)
{
return map_
.insert({std::forward<ForwardKey>(key), Value(std::forward<ForwardValue>(value)...)})
diff --git a/source/blender/blenlib/BLI_map_slots.hh b/source/blender/blenlib/BLI_map_slots.hh
index 1b4ca11af41..7658ae51fd9 100644
--- a/source/blender/blenlib/BLI_map_slots.hh
+++ b/source/blender/blenlib/BLI_map_slots.hh
@@ -196,7 +196,7 @@ template<typename Key, typename Value> class SimpleMapSlot {
* constructed by calling the constructor with the given key/value as parameter.
*/
template<typename ForwardKey, typename... ForwardValue>
- void occupy(ForwardKey &&key, uint64_t hash, ForwardValue &&... value)
+ void occupy(ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
{
BLI_assert(!this->is_occupied());
new (&value_buffer_) Value(std::forward<ForwardValue>(value)...);
@@ -316,7 +316,7 @@ template<typename Key, typename Value, typename KeyInfo> class IntrusiveMapSlot
}
template<typename ForwardKey, typename... ForwardValue>
- void occupy(ForwardKey &&key, uint64_t hash, ForwardValue &&... value)
+ void occupy(ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
{
BLI_assert(!this->is_occupied());
BLI_assert(KeyInfo::is_not_empty_or_removed(key));
diff --git a/source/blender/blenlib/BLI_resource_scope.hh b/source/blender/blenlib/BLI_resource_scope.hh
index e5a698f25f1..6a98c2dcc1c 100644
--- a/source/blender/blenlib/BLI_resource_scope.hh
+++ b/source/blender/blenlib/BLI_resource_scope.hh
@@ -148,7 +148,7 @@ class ResourceScope : NonCopyable, NonMovable {
/**
* Utility method to construct an instance of type T that will be owned by the ResourceScope.
*/
- template<typename T, typename... Args> T &construct(const char *name, Args &&... args)
+ template<typename T, typename... Args> T &construct(const char *name, Args &&...args)
{
destruct_ptr<T> value_ptr = m_allocator.construct<T>(std::forward<Args>(args)...);
T &value_ref = *value_ptr;
diff --git a/source/blender/blenlib/BLI_stack.hh b/source/blender/blenlib/BLI_stack.hh
index d66316a95d9..c9c355288b6 100644
--- a/source/blender/blenlib/BLI_stack.hh
+++ b/source/blender/blenlib/BLI_stack.hh
@@ -233,7 +233,7 @@ class Stack {
this->push_as(std::move(value));
}
/* This is similar to `std::stack::emplace`. */
- template<typename... ForwardT> void push_as(ForwardT &&... value)
+ template<typename... ForwardT> void push_as(ForwardT &&...value)
{
if (top_ == top_chunk_->capacity_end) {
this->activate_next_chunk(1);
diff --git a/source/blender/blenlib/BLI_vector.hh b/source/blender/blenlib/BLI_vector.hh
index da02c4f4ae1..d2b94a6d8ef 100644
--- a/source/blender/blenlib/BLI_vector.hh
+++ b/source/blender/blenlib/BLI_vector.hh
@@ -445,7 +445,7 @@ class Vector {
this->append_as(std::move(value));
}
/* This is similar to `std::vector::emplace_back`. */
- template<typename... ForwardValue> void append_as(ForwardValue &&... value)
+ template<typename... ForwardValue> void append_as(ForwardValue &&...value)
{
this->ensure_space_for_one();
this->append_unchecked_as(std::forward<ForwardValue>(value)...);
@@ -487,7 +487,7 @@ class Vector {
{
this->append_unchecked_as(std::move(value));
}
- template<typename... ForwardT> void append_unchecked_as(ForwardT &&... value)
+ template<typename... ForwardT> void append_unchecked_as(ForwardT &&...value)
{
BLI_assert(end_ < capacity_end_);
new (end_) T(std::forward<ForwardT>(value)...);
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c
index 5ad57a7bec8..ee06d8b6347 100644
--- a/source/blender/blenlib/intern/array_store.c
+++ b/source/blender/blenlib/intern/array_store.c
@@ -1436,8 +1436,8 @@ BArrayStore *BLI_array_store_create(uint stride, uint chunk_count)
bs->info.accum_steps = BCHUNK_HASH_TABLE_ACCUMULATE_STEPS - 1;
/* Triangle number, identifying now much read-ahead we need:
* https://en.wikipedia.org/wiki/Triangular_number (+ 1) */
- bs->info.accum_read_ahead_len = (uint)(
- (((bs->info.accum_steps * (bs->info.accum_steps + 1))) / 2) + 1);
+ bs->info.accum_read_ahead_len =
+ (uint)((((bs->info.accum_steps * (bs->info.accum_steps + 1))) / 2) + 1);
bs->info.accum_read_ahead_bytes = bs->info.accum_read_ahead_len * stride;
#else
bs->info.accum_read_ahead_bytes = BCHUNK_HASH_LEN * stride;
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 1a00142ddb1..ac034d2b5cd 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -919,8 +919,8 @@ static int delete_soft(const char *file, const char **error_message)
Class NSStringClass = objc_getClass("NSString");
SEL stringWithUTF8StringSel = sel_registerName("stringWithUTF8String:");
- id pathString = ((id(*)(Class, SEL, const char *))objc_msgSend)(
- NSStringClass, stringWithUTF8StringSel, file);
+ id pathString = ((
+ id(*)(Class, SEL, const char *))objc_msgSend)(NSStringClass, stringWithUTF8StringSel, file);
Class NSFileManagerClass = objc_getClass("NSFileManager");
SEL defaultManagerSel = sel_registerName("defaultManager");
@@ -931,8 +931,8 @@ static int delete_soft(const char *file, const char **error_message)
id nsurl = ((id(*)(Class, SEL, id))objc_msgSend)(NSURLClass, fileURLWithPathSel, pathString);
SEL trashItemAtURLSel = sel_registerName("trashItemAtURL:resultingItemURL:error:");
- BOOL deleteSuccessful = ((BOOL(*)(id, SEL, id, id, id))objc_msgSend)(
- fileManager, trashItemAtURLSel, nsurl, nil, nil);
+ BOOL deleteSuccessful = ((
+ BOOL(*)(id, SEL, id, id, id))objc_msgSend)(fileManager, trashItemAtURLSel, nsurl, nil, nil);
if (deleteSuccessful) {
ret = 0;
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index 0a213fa8696..6e3846e59c6 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -807,9 +807,9 @@ MINLINE unsigned char unit_float_to_uchar_clamp(float val)
MINLINE unsigned short unit_float_to_ushort_clamp(float val)
{
- return (unsigned short)((val >= 1.0f - 0.5f / 65535) ?
- 65535 :
- (val <= 0.0f) ? 0 : (val * 65535.0f + 0.5f));
+ return (unsigned short)((val >= 1.0f - 0.5f / 65535) ? 65535 :
+ (val <= 0.0f) ? 0 :
+ (val * 65535.0f + 0.5f));
}
#define unit_float_to_ushort_clamp(val) \
((CHECK_TYPE_INLINE(val, float)), unit_float_to_ushort_clamp(val))
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index da97e697f2f..14eb78648e0 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -685,10 +685,12 @@ static void blackbody_temperature_to_rgb(float rgb[3], float t)
rgb[2] = 0.0f;
}
else {
- int i = (t >= 6365.0f) ?
- 5 :
- (t >= 3315.0f) ? 4 :
- (t >= 1902.0f) ? 3 : (t >= 1449.0f) ? 2 : (t >= 1167.0f) ? 1 : 0;
+ int i = (t >= 6365.0f) ? 5 :
+ (t >= 3315.0f) ? 4 :
+ (t >= 1902.0f) ? 3 :
+ (t >= 1449.0f) ? 2 :
+ (t >= 1167.0f) ? 1 :
+ 0;
const float *r = blackbody_table_r[i];
const float *g = blackbody_table_g[i];
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 1bbb22eb323..8362e001ea6 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -183,7 +183,8 @@ static void blo_update_defaults_screen(bScreen *screen,
else if (area->spacetype == SPACE_SEQ) {
SpaceSeq *seq = area->spacedata.first;
seq->flag |= SEQ_SHOW_MARKERS | SEQ_SHOW_FCURVES | SEQ_ZOOM_TO_FIT | SEQ_SHOW_STRIP_OVERLAY |
- SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_NAME | SEQ_SHOW_STRIP_DURATION | SEQ_SHOW_GRID;
+ SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_NAME | SEQ_SHOW_STRIP_DURATION |
+ SEQ_SHOW_GRID;
seq->render_size = SEQ_RENDER_SIZE_PROXY_100;
seq->flag |= SEQ_USE_PROXIES;
diff --git a/source/blender/datatoc/datatoc_icon.c b/source/blender/datatoc/datatoc_icon.c
index 2023260c168..ba7120daa92 100644
--- a/source/blender/datatoc/datatoc_icon.c
+++ b/source/blender/datatoc/datatoc_icon.c
@@ -172,8 +172,9 @@ static bool write_png(const char *name, const uint *pixels, const int width, con
/* set the individual row-pointers to point at the correct offsets */
for (i = 0; i < height; i++) {
- row_pointers[height - 1 - i] = (png_bytep)(
- ((const unsigned char *)pixels) + (i * width) * bytesperpixel * sizeof(unsigned char));
+ row_pointers[height - 1 - i] = (png_bytep)(((const unsigned char *)pixels) +
+ (i * width) * bytesperpixel *
+ sizeof(unsigned char));
}
/* write out the entire image data in one call */
diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.c b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
index 7fe984b4397..76a1b561972 100644
--- a/source/blender/draw/engines/eevee/eevee_cryptomatte.c
+++ b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
@@ -158,9 +158,9 @@ void EEVEE_cryptomatte_output_init(EEVEE_ViewLayerData *UNUSED(sldata),
const ViewLayer *view_layer = draw_ctx->view_layer;
const int num_cryptomatte_layers = eevee_cryptomatte_layers_count(view_layer);
- eGPUTextureFormat format = (num_cryptomatte_layers == 1) ?
- GPU_R32F :
- (num_cryptomatte_layers == 2) ? GPU_RG32F : GPU_RGBA32F;
+ eGPUTextureFormat format = (num_cryptomatte_layers == 1) ? GPU_R32F :
+ (num_cryptomatte_layers == 2) ? GPU_RG32F :
+ GPU_RGBA32F;
const float *viewport_size = DRW_viewport_size_get();
const int buffer_size = viewport_size[0] * viewport_size[1];
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c
index 47e8aeeb6e2..ac9abcca16b 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -394,10 +394,9 @@ static bool eevee_volume_object_grids_init(Object *ob, ListBase *gpu_grids, DRWS
* - Grid exists and texture was loaded -> use texture.
* - Grid exists but has zero size or failed to load -> use zero.
* - Grid does not exist -> use default value. */
- GPUTexture *grid_tex = (drw_grid) ? drw_grid->texture :
- (volume_grid) ?
- e_data.dummy_zero :
- eevee_volume_default_texture(gpu_grid->default_value);
+ GPUTexture *grid_tex = (drw_grid) ? drw_grid->texture :
+ (volume_grid) ? e_data.dummy_zero :
+ eevee_volume_default_texture(gpu_grid->default_value);
DRW_shgroup_uniform_texture(grp, gpu_grid->sampler_name, grid_tex);
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index fc6ad68d753..dbe0f27f883 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -283,9 +283,9 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd,
!BLI_listbase_is_empty(&gpl->mask_layers);
float vert_col_opacity = (override_vertcol) ?
- (is_vert_col_mode ? pd->vertex_paint_opacity : 0.0f) :
- pd->is_render ? gpl->vertex_paint_opacity :
- pd->vertex_paint_opacity;
+ (is_vert_col_mode ? pd->vertex_paint_opacity : 0.0f) :
+ pd->is_render ? gpl->vertex_paint_opacity :
+ pd->vertex_paint_opacity;
/* Negate thickness sign to tag that strokes are in screen space.
* Convert to world units (by default, 1 meter = 2000 pixels). */
float thickness_scale = (is_screenspace) ? -1.0f : (gpd->pixfactor / GPENCIL_PIXEL_FACTOR);
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c
index 9d15f0e176d..1da682ff01b 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -1294,10 +1294,9 @@ static void draw_axes(ArmatureDrawContext *ctx,
const bArmature *arm)
{
float final_col[4];
- const float *col = (ctx->const_color) ?
- ctx->const_color :
- (BONE_FLAG(eBone, pchan) & BONE_SELECTED) ? G_draw.block.colorTextHi :
- G_draw.block.colorText;
+ const float *col = (ctx->const_color) ? ctx->const_color :
+ (BONE_FLAG(eBone, pchan) & BONE_SELECTED) ? G_draw.block.colorTextHi :
+ G_draw.block.colorText;
copy_v4_v4(final_col, col);
/* Mix with axes color. */
final_col[3] = (ctx->const_color) ? 1.0 : (BONE_FLAG(eBone, pchan) & BONE_SELECTED) ? 0.1 : 0.65;
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index b001c5bbf8f..2126385a352 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -528,10 +528,10 @@ static void drw_call_obinfos_init(DRWObjectInfos *ob_infos, Object *ob)
drw_call_calc_orco(ob, ob_infos->orcotexfac);
/* Random float value. */
uint random = (DST.dupli_source) ?
- DST.dupli_source->random_id :
- /* TODO(fclem): this is rather costly to do at runtime. Maybe we can
- * put it in ob->runtime and make depsgraph ensure it is up to date. */
- BLI_hash_int_2d(BLI_hash_string(ob->id.name + 2), 0);
+ DST.dupli_source->random_id :
+ /* TODO(fclem): this is rather costly to do at runtime. Maybe we can
+ * put it in ob->runtime and make depsgraph ensure it is up to date. */
+ BLI_hash_int_2d(BLI_hash_string(ob->id.name + 2), 0);
ob_infos->ob_random = random * (1.0f / (float)0xFFFFFFFF);
/* Object State. */
ob_infos->ob_flag = 1.0f; /* Required to have a correct sign */
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 87688ee343c..e5dc9a83ebb 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -966,7 +966,7 @@ static int acf_group_setting_flag(bAnimContext *ac, eAnimChannel_Settings settin
* proved to be a hazard for workflows...
*/
return (ac->spacetype == SPACE_GRAPH) ? AGRP_EXPANDED_G : /* Graph Editor case */
- AGRP_EXPANDED; /* DopeSheet and elsewhere */
+ AGRP_EXPANDED; /* DopeSheet and elsewhere */
}
case ACHANNEL_SETTING_MUTE: /* muted */
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 227af598f53..cfcea950955 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -483,7 +483,8 @@ static int marker_get_icon_id(TimeMarker *marker, int flag)
{
if (flag & DRAW_MARKERS_LOCAL) {
return (marker->flag & ACTIVE) ? ICON_PMARKER_ACT :
- (marker->flag & SELECT) ? ICON_PMARKER_SEL : ICON_PMARKER;
+ (marker->flag & SELECT) ? ICON_PMARKER_SEL :
+ ICON_PMARKER;
}
#ifdef DURIAN_CAMERA_SWITCH
if (marker->camera) {
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index ea6c71fd33f..fd5ae6c7099 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -286,8 +286,9 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
eCalcRollTypes type = RNA_enum_get(op->ptr, "type");
const bool axis_only = RNA_boolean_get(op->ptr, "axis_only");
/* axis_flip when matching the active bone never makes sense */
- bool axis_flip = ((type >= CALC_ROLL_ACTIVE) ? RNA_boolean_get(op->ptr, "axis_flip") :
- (type >= CALC_ROLL_TAN_NEG_X) ? true : false);
+ bool axis_flip = ((type >= CALC_ROLL_ACTIVE) ? RNA_boolean_get(op->ptr, "axis_flip") :
+ (type >= CALC_ROLL_TAN_NEG_X) ? true :
+ false);
uint objects_len = 0;
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
index 31ab5eca974..a4a034830b7 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
@@ -374,7 +374,7 @@ short ED_gizmotypes_snap_3d_update(wmGizmo *gz,
eSnapEditType edit_mode_type = (snap_gizmo->flag & ED_SNAPGIZMO_SNAP_EDIT_GEOM_FINAL) ?
SNAP_GEOM_FINAL :
- (snap_gizmo->flag & ED_SNAPGIZMO_SNAP_EDIT_GEOM_CAGE) ?
+ (snap_gizmo->flag & ED_SNAPGIZMO_SNAP_EDIT_GEOM_CAGE) ?
SNAP_GEOM_CAGE :
SNAP_GEOM_EDIT;
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 655fdda3069..65104885d98 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -106,14 +106,30 @@ void UI_draw_roundbox_4fv_ex(const rctf *rect,
.color_inner1[1] = inner1 ? inner1[1] : 0.0f,
.color_inner1[2] = inner1 ? inner1[2] : 0.0f,
.color_inner1[3] = inner1 ? inner1[3] : 0.0f,
- .color_inner2[0] = inner2 ? inner2[0] : inner1 ? inner1[0] : 0.0f,
- .color_inner2[1] = inner2 ? inner2[1] : inner1 ? inner1[1] : 0.0f,
- .color_inner2[2] = inner2 ? inner2[2] : inner1 ? inner1[2] : 0.0f,
- .color_inner2[3] = inner2 ? inner2[3] : inner1 ? inner1[3] : 0.0f,
- .color_outline[0] = outline ? outline[0] : inner1 ? inner1[0] : 0.0f,
- .color_outline[1] = outline ? outline[1] : inner1 ? inner1[1] : 0.0f,
- .color_outline[2] = outline ? outline[2] : inner1 ? inner1[2] : 0.0f,
- .color_outline[3] = outline ? outline[3] : inner1 ? inner1[3] : 0.0f,
+ .color_inner2[0] = inner2 ? inner2[0] :
+ inner1 ? inner1[0] :
+ 0.0f,
+ .color_inner2[1] = inner2 ? inner2[1] :
+ inner1 ? inner1[1] :
+ 0.0f,
+ .color_inner2[2] = inner2 ? inner2[2] :
+ inner1 ? inner1[2] :
+ 0.0f,
+ .color_inner2[3] = inner2 ? inner2[3] :
+ inner1 ? inner1[3] :
+ 0.0f,
+ .color_outline[0] = outline ? outline[0] :
+ inner1 ? inner1[0] :
+ 0.0f,
+ .color_outline[1] = outline ? outline[1] :
+ inner1 ? inner1[1] :
+ 0.0f,
+ .color_outline[2] = outline ? outline[2] :
+ inner1 ? inner1[2] :
+ 0.0f,
+ .color_outline[3] = outline ? outline[3] :
+ inner1 ? inner1[3] :
+ 0.0f,
.shade_dir = shade_dir,
.alpha_discard = 1.0f,
};
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 0a4fecde6ea..8b78b091fd2 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -187,7 +187,8 @@ static void ringsel_finish(bContext *C, wmOperator *op)
const bool is_edge_wire = BM_edge_is_wire(lcd->eed);
const bool is_single = is_edge_wire || !BM_edge_is_any_face_len_test(lcd->eed, 4);
const int seltype = is_edge_wire ? SUBDIV_SELECT_INNER :
- is_single ? SUBDIV_SELECT_NONE : SUBDIV_SELECT_LOOPCUT;
+ is_single ? SUBDIV_SELECT_NONE :
+ SUBDIV_SELECT_LOOPCUT;
/* Enable grid-fill, so that intersecting loop-cut works as one would expect.
* Note though that it will break edge-slide in this specific case.
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 7bbca7ea9e6..e9142742d15 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1923,8 +1923,8 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- const eMultiresSubdivideModeType subdivide_mode = (eMultiresSubdivideModeType)(
- RNA_enum_get(op->ptr, "mode"));
+ const eMultiresSubdivideModeType subdivide_mode = (eMultiresSubdivideModeType)(RNA_enum_get(
+ op->ptr, "mode"));
multiresModifier_subdivide(object, mmd, subdivide_mode);
ED_object_iter_other(
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 062d2e2b5d1..6538f5709b7 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -912,10 +912,9 @@ static int collection_view_layer_exec(bContext *C, wmOperator *op)
.space_outliner = space_outliner,
};
bool clear = strstr(op->idname, "clear") != NULL;
- int flag = strstr(op->idname, "holdout") ?
- LAYER_COLLECTION_HOLDOUT :
- strstr(op->idname, "indirect_only") ? LAYER_COLLECTION_INDIRECT_ONLY :
- LAYER_COLLECTION_EXCLUDE;
+ int flag = strstr(op->idname, "holdout") ? LAYER_COLLECTION_HOLDOUT :
+ strstr(op->idname, "indirect_only") ? LAYER_COLLECTION_INDIRECT_ONLY :
+ LAYER_COLLECTION_EXCLUDE;
data.collections_to_edit = BLI_gset_ptr_new(__func__);
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 080a19cce1f..279dca9731d 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -354,10 +354,9 @@ static void gizmo_get_axis_color(const int axis_idx,
if (is_plane) {
idot_axis = 1.0f - idot_axis;
}
- alpha_fac = ((idot_axis > idot_max) ?
- 1.0f :
- (idot_axis < idot_min) ? 0.0f :
- ((idot_axis - idot_min) / (idot_max - idot_min)));
+ alpha_fac = ((idot_axis > idot_max) ? 1.0f :
+ (idot_axis < idot_min) ? 0.0f :
+ ((idot_axis - idot_min) / (idot_max - idot_min)));
}
else {
alpha_fac = 1.0f;
diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh
index 40dc585b39b..c9398ceb547 100644
--- a/source/blender/functions/FN_generic_virtual_array.hh
+++ b/source/blender/functions/FN_generic_virtual_array.hh
@@ -688,7 +688,7 @@ class GVArray_For_EmbeddedVArray : public GVArray_For_VArray<T> {
public:
template<typename... Args>
- GVArray_For_EmbeddedVArray(const int64_t size, Args &&... args)
+ GVArray_For_EmbeddedVArray(const int64_t size, Args &&...args)
: GVArray_For_VArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
{
this->varray_ = &embedded_varray_;
@@ -703,7 +703,7 @@ class GVMutableArray_For_EmbeddedVMutableArray : public GVMutableArray_For_VMuta
public:
template<typename... Args>
- GVMutableArray_For_EmbeddedVMutableArray(const int64_t size, Args &&... args)
+ GVMutableArray_For_EmbeddedVMutableArray(const int64_t size, Args &&...args)
: GVMutableArray_For_VMutableArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
{
this->varray_ = &embedded_varray_;
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 561a833803d..399fd487065 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -749,8 +749,9 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors
/* set the individual row-pointers to point at the correct offsets */
for (int i = 0; i < ibuf->y; i++) {
- row_pointers[ibuf->y - 1 - i] = (png_bytep)(
- (unsigned char *)pixels + (((size_t)i) * ibuf->x) * channels * sizeof(unsigned char));
+ row_pointers[ibuf->y - 1 - i] = (png_bytep)((unsigned char *)pixels +
+ (((size_t)i) * ibuf->x) * channels *
+ sizeof(unsigned char));
}
png_read_image(png_ptr, row_pointers);
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
index 57523f1c4d8..835af3c6ff8 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -575,7 +575,7 @@ typedef struct FluidDomainSettings {
float noise_time_anim;
int res_noise[3];
int noise_scale;
- char _pad3[4]; /* Unused. */
+ char _pad3[4]; /* Unused. */
/* Liquid domain options. */
float particle_randomness;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index b59ea838719..932f4715298 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -281,9 +281,9 @@ enum {
/* We can't have both flags enabled at once,
* flags defined in DNA_scene_types.h */
#define ME_EDIT_PAINT_SEL_MODE(_me) \
- (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? \
- SCE_SELECT_FACE : \
- ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : 0)
+ (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? SCE_SELECT_FACE : \
+ ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \
+ 0)
/* me->flag */
enum {
diff --git a/source/blender/nodes/NOD_node_tree_multi_function.hh b/source/blender/nodes/NOD_node_tree_multi_function.hh
index e3f31e011e4..7eeeaef0b98 100644
--- a/source/blender/nodes/NOD_node_tree_multi_function.hh
+++ b/source/blender/nodes/NOD_node_tree_multi_function.hh
@@ -233,7 +233,7 @@ class MFNetworkBuilderBase {
/**
* Constructs a new function that will live at least as long as the MFNetwork.
*/
- template<typename T, typename... Args> T &construct_fn(Args &&... args)
+ template<typename T, typename... Args> T &construct_fn(Args &&...args)
{
BLI_STATIC_ASSERT((std::is_base_of_v<fn::MultiFunction, T>), "");
void *buffer = common_.scope.linear_allocator().allocate(sizeof(T), alignof(T));
@@ -287,7 +287,7 @@ class SocketMFNetworkBuilder : public MFNetworkBuilderBase {
this->construct_generator_fn<fn::CustomMF_GenericConstant>(type, value);
}
- template<typename T, typename... Args> void construct_generator_fn(Args &&... args)
+ template<typename T, typename... Args> void construct_generator_fn(Args &&...args)
{
const fn::MultiFunction &fn = this->construct_fn<T>(std::forward<Args>(args)...);
this->set_generator_fn(fn);
@@ -334,7 +334,7 @@ class NodeMFNetworkBuilder : public MFNetworkBuilderBase {
* Tells the builder to build a function that corresponds to the node that is being built. It
* will try to match up sockets.
*/
- template<typename T, typename... Args> T &construct_and_set_matching_fn(Args &&... args)
+ template<typename T, typename... Args> T &construct_and_set_matching_fn(Args &&...args)
{
T &function = this->construct_fn<T>(std::forward<Args>(args)...);
this->set_matching_fn(function);
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 1c994707ca9..c0d408be2e0 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -263,8 +263,9 @@ struct wmEventHandler_Keymap *WM_event_add_keymap_handler_priority(ListBase *han
wmKeyMap *keymap,
int priority);
-typedef struct wmKeyMap *(wmEventHandler_KeymapDynamicFn)(
- wmWindowManager *wm, struct wmEventHandler_Keymap *handler)ATTR_WARN_UNUSED_RESULT;
+typedef struct wmKeyMap *(wmEventHandler_KeymapDynamicFn)(wmWindowManager *wm,
+ struct wmEventHandler_Keymap *handler)
+ ATTR_WARN_UNUSED_RESULT;
struct wmKeyMap *WM_event_get_keymap_from_toolsystem_fallback(
struct wmWindowManager *wm, struct wmEventHandler_Keymap *handler);