Cleanup: clang-format (re-run after v12 version bump)

This commit is contained in:
Campbell Barton 2021-07-30 16:19:19 +10:00
parent f81a6a2ff1
commit 93eb460dd0
47 changed files with 155 additions and 131 deletions

View File

@ -57,8 +57,8 @@
#include "util/util_function.h"
#include "util/util_logging.h"
#include "util/util_map.h"
#include "util/util_openimagedenoise.h"
#include "util/util_opengl.h"
#include "util/util_openimagedenoise.h"
#include "util/util_optimization.h"
#include "util/util_progress.h"
#include "util/util_system.h"

View File

@ -432,9 +432,9 @@ ccl_device void bssrdf_sample(const ShaderClosure *sc, float xi, float *r, float
xi *= bssrdf->channels;
if (xi < 1.0f) {
radius = (bssrdf->radius.x > 0.0f) ?
bssrdf->radius.x :
(bssrdf->radius.y > 0.0f) ? bssrdf->radius.y : bssrdf->radius.z;
radius = (bssrdf->radius.x > 0.0f) ? bssrdf->radius.x :
(bssrdf->radius.y > 0.0f) ? bssrdf->radius.y :
bssrdf->radius.z;
}
else if (xi < 2.0f) {
xi -= 1.0f;

View File

@ -52,15 +52,14 @@ typedef struct TileInfo {
tile_buffer_6, tile_buffer_7, tile_buffer_8, tile_buffer_9
# define ccl_get_tile_buffer(id) \
(id == 0 ? tile_buffer_1 : \
id == 1 ? \
tile_buffer_2 : \
id == 2 ? \
tile_buffer_3 : \
id == 3 ? tile_buffer_4 : \
id == 4 ? tile_buffer_5 : \
id == 5 ? tile_buffer_6 : \
id == 6 ? tile_buffer_7 : \
id == 7 ? tile_buffer_8 : tile_buffer_9)
id == 1 ? tile_buffer_2 : \
id == 2 ? tile_buffer_3 : \
id == 3 ? tile_buffer_4 : \
id == 4 ? tile_buffer_5 : \
id == 5 ? tile_buffer_6 : \
id == 6 ? tile_buffer_7 : \
id == 7 ? tile_buffer_8 : \
tile_buffer_9)
#else
# ifdef __KERNEL_CUDA__
# define CCL_FILTER_TILE_INFO ccl_global TileInfo *tile_info

View File

@ -356,7 +356,7 @@ class ShaderGraph : public NodeOwner {
/* This function is used to create a node of a specified type instead of
* calling 'new', and sets the graph as the owner of the node.
*/
template<typename T, typename... Args> T *create_node(Args &&... args)
template<typename T, typename... Args> T *create_node(Args &&...args)
{
T *node = new T(args...);
node->set_owner(this);

View File

@ -299,7 +299,7 @@ class Scene : public NodeOwner {
* node array (e.g. Scene::geometry for Geometry nodes) and tag the appropriate
* manager for an update.
*/
template<typename T, typename... Args> T *create_node(Args &&... args)
template<typename T, typename... Args> T *create_node(Args &&...args)
{
T *node = new T(args...);
node->set_owner(this);

View File

@ -57,7 +57,7 @@ struct avxb {
: m256(_mm256_insertf128_ps(_mm256_castps128_ps256(a), b, 1))
{
}
__forceinline operator const __m256 &(void)const
__forceinline operator const __m256 &(void) const
{
return m256;
}

View File

@ -54,7 +54,7 @@ struct avxi {
__forceinline avxi(const __m256i a) : m256(a)
{
}
__forceinline operator const __m256i &(void)const
__forceinline operator const __m256i &(void) const
{
return m256;
}

View File

@ -57,7 +57,7 @@ struct sseb {
__forceinline sseb(const __m128 input) : m128(input)
{
}
__forceinline operator const __m128 &(void)const
__forceinline operator const __m128 &(void) const
{
return m128;
}

View File

@ -57,7 +57,7 @@ struct ssei {
__forceinline ssei(const __m128i a) : m128(a)
{
}
__forceinline operator const __m128i &(void)const
__forceinline operator const __m128i &(void) const
{
return m128;
}

View File

@ -475,16 +475,15 @@ int GHOST_ContextWGL::choose_pixel_format(bool stereoVisual, bool needAlpha)
PIXELFORMATDESCRIPTOR preferredPFD = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */
(DWORD)(
PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER | /* support double-buffering */
(stereoVisual ? PFD_STEREO : 0) | /* support stereo */
(
(DWORD)(PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER | /* support double-buffering */
(stereoVisual ? PFD_STEREO : 0) | /* support stereo */
(
#ifdef WIN32_COMPOSITING
needAlpha ?
PFD_SUPPORT_COMPOSITION : /* support composition for transparent background */
needAlpha ? PFD_SUPPORT_COMPOSITION : /* support composition for transparent
background */
#endif
0)),
0)),
PFD_TYPE_RGBA, /* color type */
(BYTE)(needAlpha ? 32 : 24), /* preferred color depth */
0,

View File

@ -2111,10 +2111,9 @@ GHOST_TSuccess GHOST_SystemWin32::showMessageBox(const char *title,
config.cbSize = sizeof(config);
config.hInstance = 0;
config.dwCommonButtons = 0;
config.pszMainIcon = (dialog_options & GHOST_DialogError ?
TD_ERROR_ICON :
dialog_options & GHOST_DialogWarning ? TD_WARNING_ICON :
TD_INFORMATION_ICON);
config.pszMainIcon = (dialog_options & GHOST_DialogError ? TD_ERROR_ICON :
dialog_options & GHOST_DialogWarning ? TD_WARNING_ICON :
TD_INFORMATION_ICON);
config.pszWindowTitle = L"Blender";
config.pszMainInstruction = title_16;
config.pszContent = message_16;

View File

@ -1189,9 +1189,9 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
else {
printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
(unsigned int)key_sym,
(status == XLookupNone ?
"XLookupNone" :
status == XLookupKeySym ? "XLookupKeySym" : "Unknown status"));
(status == XLookupNone ? "XLookupNone" :
status == XLookupKeySym ? "XLookupKeySym" :
"Unknown status"));
printf("'%.*s' %p %p\n", len, utf8_buf, xic, m_xim);
}

View File

@ -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
}

View File

@ -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;

View File

@ -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))

View File

@ -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));

View File

@ -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)...)})

View File

@ -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));

View File

@ -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;

View File

@ -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);

View File

@ -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)...);

View File

@ -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;

View File

@ -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;

View File

@ -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))

View File

@ -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];

View File

@ -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;

View File

@ -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 */

View File

@ -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];

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

View File

@ -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) {

View File

@ -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(

View File

@ -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;

View File

@ -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,
};

View File

@ -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.

View File

@ -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(

View File

@ -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__);

View File

@ -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;

View File

@ -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_;

View File

@ -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);

View File

@ -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;

View File

@ -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 {

View File

@ -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);

View File

@ -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);