diff --git a/intern/atomic/intern/atomic_ops_ext.h b/intern/atomic/intern/atomic_ops_ext.h index 3097b51c07d..28ed7ffe192 100644 --- a/intern/atomic/intern/atomic_ops_ext.h +++ b/intern/atomic/intern/atomic_ops_ext.h @@ -67,9 +67,9 @@ ATOMIC_INLINE size_t atomic_add_and_fetch_z(size_t *p, size_t x) ATOMIC_INLINE size_t atomic_sub_and_fetch_z(size_t *p, size_t x) { #if (LG_SIZEOF_PTR == 8) - return (size_t)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t) - ((int64_t)x)); + return (size_t)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_PTR == 4) - return (size_t)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t) - ((int32_t)x)); + return (size_t)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } @@ -85,9 +85,9 @@ ATOMIC_INLINE size_t atomic_fetch_and_add_z(size_t *p, size_t x) ATOMIC_INLINE size_t atomic_fetch_and_sub_z(size_t *p, size_t x) { #if (LG_SIZEOF_PTR == 8) - return (size_t)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t) - ((int64_t)x)); + return (size_t)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_PTR == 4) - return (size_t)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t) - ((int32_t)x)); + return (size_t)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } @@ -146,9 +146,9 @@ ATOMIC_INLINE unsigned int atomic_add_and_fetch_u(unsigned int *p, unsigned int ATOMIC_INLINE unsigned int atomic_sub_and_fetch_u(unsigned int *p, unsigned int x) { #if (LG_SIZEOF_INT == 8) - return (unsigned int)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t) - ((int64_t)x)); + return (unsigned int)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_INT == 4) - return (unsigned int)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t) - ((int32_t)x)); + return (unsigned int)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } @@ -164,9 +164,9 @@ ATOMIC_INLINE unsigned int atomic_fetch_and_add_u(unsigned int *p, unsigned int ATOMIC_INLINE unsigned int atomic_fetch_and_sub_u(unsigned int *p, unsigned int x) { #if (LG_SIZEOF_INT == 8) - return (unsigned int)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t) - ((int64_t)x)); + return (unsigned int)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_INT == 4) - return (unsigned int)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t) - ((int32_t)x)); + return (unsigned int)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp index b5798288b0b..af49adf4743 100644 --- a/intern/cycles/blender/mesh.cpp +++ b/intern/cycles/blender/mesh.cpp @@ -620,7 +620,7 @@ static void create_mesh(Scene *scene, const bool need_default_tangent = (subdivision == false) && (blender_uv_names.empty()) && (mesh->need_attribute(scene, ATTR_STD_UV_TANGENT)); if (mesh->need_attribute(scene, ATTR_STD_GENERATED) || need_default_tangent) { - const float(*orco)[3] = static_cast( + const float (*orco)[3] = static_cast( CustomData_get_layer(&b_mesh.vert_data, CD_ORCO)); Attribute *attr = attributes.add(ATTR_STD_GENERATED); diff --git a/intern/cycles/integrator/path_trace_work.h b/intern/cycles/integrator/path_trace_work.h index 44eabac9da6..2479d14c98b 100644 --- a/intern/cycles/integrator/path_trace_work.h +++ b/intern/cycles/integrator/path_trace_work.h @@ -51,7 +51,7 @@ class PathTraceWork { bool has_multiple_works() const; /* Allocate working memory for execution. Must be called before init_execution(). */ - virtual void alloc_work_memory(){}; + virtual void alloc_work_memory() {}; /* Initialize execution of kernels. * Will ensure that all device queues are initialized for execution. diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h index b12be528cf7..c609abaa0b9 100644 --- a/intern/cycles/kernel/integrator/shade_volume.h +++ b/intern/cycles/kernel/integrator/shade_volume.h @@ -1141,7 +1141,7 @@ ccl_device_inline void volume_distance_sampling_finalize( reservoir.add_sample( 1.0f - guided_scatter_prob, # ifdef __DENOISING_FEATURES__ - {vstate.emission, reservoir.candidate.t, result.indirect_throughput, 0.0f, vstate.albedo} + { vstate.emission, reservoir.candidate.t, result.indirect_throughput, 0.0f, vstate.albedo } # else {vstate.emission, reservoir.candidate.t, result.indirect_throughput, 0.0f} # endif diff --git a/intern/cycles/kernel/osl/closures_setup.h b/intern/cycles/kernel/osl/closures_setup.h index 4a88c6c8880..77bbc4162a4 100644 --- a/intern/cycles/kernel/osl/closures_setup.h +++ b/intern/cycles/kernel/osl/closures_setup.h @@ -20,8 +20,7 @@ CCL_NAMESPACE_BEGIN #define OSL_CLOSURE_STRUCT_BEGIN(Upper, lower) \ - struct ccl_align(8) Upper##Closure \ - { \ + struct ccl_align(8) Upper##Closure { \ const char *label; #define OSL_CLOSURE_STRUCT_END(Upper, lower) \ } \ @@ -31,8 +30,7 @@ CCL_NAMESPACE_BEGIN #include "closures_template.h" -struct ccl_align(8) LayerClosure -{ +struct ccl_align(8) LayerClosure { const ccl_private OSLClosure *base; const ccl_private OSLClosure *top; }; diff --git a/intern/cycles/kernel/osl/types.h b/intern/cycles/kernel/osl/types.h index ae4cce3df8d..9ac7abd97bd 100644 --- a/intern/cycles/kernel/osl/types.h +++ b/intern/cycles/kernel/osl/types.h @@ -66,20 +66,17 @@ struct OSLClosure { OSLClosureType id; }; -struct ccl_align(8) OSLClosureMul : public OSLClosure -{ +struct ccl_align(8) OSLClosureMul : public OSLClosure { packed_float3 weight; const ccl_private OSLClosure *closure; }; -struct ccl_align(8) OSLClosureAdd : public OSLClosure -{ +struct ccl_align(8) OSLClosureAdd : public OSLClosure { const ccl_private OSLClosure *closureA; const ccl_private OSLClosure *closureB; }; -struct ccl_align(8) OSLClosureComponent : public OSLClosure -{ +struct ccl_align(8) OSLClosureComponent : public OSLClosure { packed_float3 weight; }; diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index 629eeaa97b0..b4f65a21692 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -1000,8 +1000,7 @@ struct AttributeMap { ClosureType type; \ float sample_weight -struct ccl_align(16) ShaderClosure -{ +struct ccl_align(16) ShaderClosure { SHADER_CLOSURE_BASE; /* Extra space for closures to store data, somewhat arbitrary but closures @@ -1132,8 +1131,7 @@ enum ShaderDataObjectFlag { SD_OBJECT_HAS_VOLUME_MOTION) }; -struct ccl_align(16) ShaderData -{ +struct ccl_align(16) ShaderData { /* position */ float3 P; /* smooth normal for shading */ @@ -1215,15 +1213,13 @@ struct ccl_align(16) ShaderData #ifdef __KERNEL_GPU__ /* ShaderDataTinyStorage needs the same alignment as ShaderData, or else * the pointer cast in AS_SHADER_DATA invokes undefined behavior. */ -struct ccl_align(16) ShaderDataTinyStorage -{ +struct ccl_align(16) ShaderDataTinyStorage { char pad[sizeof(ShaderData) - sizeof(ShaderClosure) * MAX_CLOSURE]; }; /* ShaderDataCausticsStorage needs the same alignment as ShaderData, or else * the pointer cast in AS_SHADER_DATA invokes undefined behavior. */ -struct ccl_align(16) ShaderDataCausticsStorage -{ +struct ccl_align(16) ShaderDataCausticsStorage { char pad[sizeof(ShaderData) - sizeof(ShaderClosure) * (MAX_CLOSURE - CAUSTICS_MAX_CLOSURE)]; }; #else @@ -1432,9 +1428,7 @@ enum KernelBVHLayout { }; /* Specialized struct that can become constants in dynamic compilation. */ -#define KERNEL_STRUCT_BEGIN(name, parent) \ - struct ccl_align(16) name \ - { +#define KERNEL_STRUCT_BEGIN(name, parent) struct ccl_align(16) name { #define KERNEL_STRUCT_END(name) \ } \ ; \ @@ -1476,8 +1470,7 @@ struct KernelLightLinkSet { uint light_tree_root; }; -struct ccl_align(16) KernelData -{ +struct ccl_align(16) KernelData { /* Features and limits. */ uint kernel_features; uint max_closures; diff --git a/intern/cycles/scene/image.h b/intern/cycles/scene/image.h index 0b2ea631221..70ed5272aa8 100644 --- a/intern/cycles/scene/image.h +++ b/intern/cycles/scene/image.h @@ -109,7 +109,7 @@ class ImageLoader { virtual int get_tile_number() const; /* Free any memory used for loading metadata and pixels. */ - virtual void cleanup(){}; + virtual void cleanup() {}; /* Compare avoid loading the same image multiple times. */ virtual bool equals(const ImageLoader &other) const = 0; diff --git a/intern/cycles/scene/shader_graph.h b/intern/cycles/scene/shader_graph.h index 3ceecfc0369..d164c099f1a 100644 --- a/intern/cycles/scene/shader_graph.h +++ b/intern/cycles/scene/shader_graph.h @@ -172,7 +172,7 @@ class ShaderNode : public Node { /* Simplify settings used by artists to the ones which are simpler to * evaluate in the kernel but keep the final result unchanged. */ - virtual void simplify_settings(Scene * /*scene*/){}; + virtual void simplify_settings(Scene * /*scene*/) {}; virtual bool has_surface_emission() { diff --git a/intern/cycles/session/display_driver.h b/intern/cycles/session/display_driver.h index b2f5e2c9121..6d137f70389 100644 --- a/intern/cycles/session/display_driver.h +++ b/intern/cycles/session/display_driver.h @@ -146,7 +146,7 @@ class DisplayDriver { virtual void update_end() = 0; /* Optionally flush outstanding display commands before ending the render loop. */ - virtual void flush(){}; + virtual void flush() {}; virtual half4 *map_texture_buffer() = 0; virtual void unmap_texture_buffer() = 0; @@ -171,8 +171,8 @@ class DisplayDriver { * * For example, destruction of the CUDA object associated with an OpenGL requires the * OpenGL context to be active. */ - virtual void graphics_interop_activate(){}; - virtual void graphics_interop_deactivate(){}; + virtual void graphics_interop_activate() {}; + virtual void graphics_interop_deactivate() {}; /* Clear the display buffer by filling it with zeros. */ virtual void zero() = 0; diff --git a/intern/cycles/util/stack_allocator.h b/intern/cycles/util/stack_allocator.h index 68d80ec49e5..97dd08e8baf 100644 --- a/intern/cycles/util/stack_allocator.h +++ b/intern/cycles/util/stack_allocator.h @@ -12,8 +12,7 @@ CCL_NAMESPACE_BEGIN /* Stack allocator for the use with STL. */ -template class ccl_try_align(16) StackAllocator -{ +template class ccl_try_align(16) StackAllocator { public: using size_type = size_t; using difference_type = ptrdiff_t; @@ -61,7 +60,7 @@ template class ccl_try_align(16) StackAllocator return mem; } - void deallocate(T * p, const size_t n) + void deallocate(T *p, const size_t n) { if (p == nullptr) { return; @@ -80,7 +79,7 @@ template class ccl_try_align(16) StackAllocator /* Address of an reference. */ - T *address(T & x) const + T *address(T &x) const { return &x; } @@ -92,14 +91,14 @@ template class ccl_try_align(16) StackAllocator /* Object construction/destruction. */ - void construct(T * p, const T &val) + void construct(T *p, const T &val) { if (p != nullptr) { new (p) T(val); } } - void destroy(T * p) + void destroy(T *p) { p->~T(); } diff --git a/intern/cycles/util/types_float4.h b/intern/cycles/util/types_float4.h index 22ae3d9c7ea..a4657dc72f0 100644 --- a/intern/cycles/util/types_float4.h +++ b/intern/cycles/util/types_float4.h @@ -13,8 +13,7 @@ CCL_NAMESPACE_BEGIN #ifndef __KERNEL_NATIVE_VECTOR_TYPES__ struct int4; -struct ccl_try_align(16) float4 -{ +struct ccl_try_align(16) float4 { # ifdef __KERNEL_SSE__ union { __m128 m128; diff --git a/intern/cycles/util/types_int3.h b/intern/cycles/util/types_int3.h index 8e8af27b55e..b89257949fd 100644 --- a/intern/cycles/util/types_int3.h +++ b/intern/cycles/util/types_int3.h @@ -114,7 +114,7 @@ struct packed_int3 { ccl_device_inline_method packed_int3() = default; ccl_device_inline_method packed_int3(const int px, const int py, const int pz) - : x(px), y(py), z(pz){}; + : x(px), y(py), z(pz) {}; ccl_device_inline_method packed_int3(const int3 &a) : x(a.x), y(a.y), z(a.z) {} diff --git a/intern/cycles/util/types_int4.h b/intern/cycles/util/types_int4.h index a5604ee9c32..31520957cf7 100644 --- a/intern/cycles/util/types_int4.h +++ b/intern/cycles/util/types_int4.h @@ -10,8 +10,7 @@ CCL_NAMESPACE_BEGIN #ifndef __KERNEL_NATIVE_VECTOR_TYPES__ -struct ccl_try_align(16) int4 -{ +struct ccl_try_align(16) int4 { # ifdef __KERNEL_SSE__ union { __m128i m128; diff --git a/intern/cycles/util/types_uint3.h b/intern/cycles/util/types_uint3.h index e107a0af38b..1198ce2b6d1 100644 --- a/intern/cycles/util/types_uint3.h +++ b/intern/cycles/util/types_uint3.h @@ -47,7 +47,7 @@ struct packed_uint3 { ccl_device_inline_method packed_uint3() = default; ccl_device_inline_method packed_uint3(const uint px, const uint py, const uint pz) - : x(px), y(py), z(pz){}; + : x(px), y(py), z(pz) {}; ccl_device_inline_method packed_uint3(const uint3 &a) : x(a.x), y(a.y), z(a.z) {} diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 9ca5b54a12d..07d0f77fe8d 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -593,7 +593,7 @@ typedef enum { } GHOST_TKey; #define GHOST_KEY_MODIFIER_NUM ((_GHOST_KEY_MODIFIER_MAX - _GHOST_KEY_MODIFIER_MIN) + 1) -#define GHOST_KEY_MODIFIER_TO_INDEX(key) ((unsigned int)(key)-_GHOST_KEY_MODIFIER_MIN) +#define GHOST_KEY_MODIFIER_TO_INDEX(key) ((unsigned int)(key) - _GHOST_KEY_MODIFIER_MIN) #define GHOST_KEY_MODIFIER_FROM_INDEX(key) \ (GHOST_TKey)(((unsigned int)(key) + _GHOST_KEY_MODIFIER_MIN)) #define GHOST_KEY_MODIFIER_CHECK(key) (GHOST_KEY_MODIFIER_TO_INDEX(key) < GHOST_KEY_MODIFIER_NUM) @@ -825,22 +825,24 @@ typedef struct { #define GHOST_CONTEXT_PARAMS_NONE \ { \ - /*is_stereo_visual*/ false, /*is_debug*/ false, /*vsync*/ GHOST_kVSyncModeUnset, \ + /*is_stereo_visual*/ false, \ + /*is_debug*/ false, \ + /*vsync*/ GHOST_kVSyncModeUnset, \ } #define GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS_OFFSCREEN(gpu_settings) \ { \ - /*is_stereo_visual*/ false, \ - /*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), \ - /*vsync*/ GHOST_kVSyncModeUnset, \ + /*is_stereo_visual*/ false, \ + /*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), \ + /*vsync*/ GHOST_kVSyncModeUnset, \ } #define GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS(gpu_settings) \ { \ - /*is_stereo_visual*/ (((gpu_settings).flags & GHOST_gpuStereoVisual) != 0), \ - /*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), /*vsync*/ \ - (((gpu_settings).flags & GHOST_gpuVSyncIsOverridden) ? (gpu_settings).vsync : \ - GHOST_kVSyncModeUnset), \ + /*is_stereo_visual*/ (((gpu_settings).flags & GHOST_gpuStereoVisual) != 0), \ + /*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), /*vsync*/ \ + (((gpu_settings).flags & GHOST_gpuVSyncIsOverridden) ? (gpu_settings).vsync : \ + GHOST_kVSyncModeUnset), \ } typedef struct { @@ -869,7 +871,9 @@ typedef struct { #define GHOST_WINDOW_HDR_INFO_NONE \ { \ - /*hdr_enabled*/ false, /*wide_gamut_enabled*/ false, /*sdr_white_level*/ 1.0f, \ + /*hdr_enabled*/ false, \ + /*wide_gamut_enabled*/ false, \ + /*sdr_white_level*/ 1.0f, \ } #ifdef WITH_VULKAN_BACKEND diff --git a/intern/ghost/intern/GHOST_ContextMTL.hh b/intern/ghost/intern/GHOST_ContextMTL.hh index ec8f25bc735..db85b1a509b 100644 --- a/intern/ghost/intern/GHOST_ContextMTL.hh +++ b/intern/ghost/intern/GHOST_ContextMTL.hh @@ -177,5 +177,5 @@ class GHOST_ContextMTL : public GHOST_Context { void metalInitFramebuffer(); void metalUpdateFramebuffer(); void metalSwapBuffers(); - void initClear(){}; + void initClear() {}; }; diff --git a/intern/ghost/intern/GHOST_NDOFManager.cc b/intern/ghost/intern/GHOST_NDOFManager.cc index e10df93391f..97da117ba0e 100644 --- a/intern/ghost/intern/GHOST_NDOFManager.cc +++ b/intern/ghost/intern/GHOST_NDOFManager.cc @@ -41,10 +41,7 @@ static const char *ndof_progress_string[] = { }; /* Printable values for #NDOF_ButtonT enum (keep aligned) */ -#define MAP_ENTRY(button) \ - { \ - GHOST_##button, #button \ - } +#define MAP_ENTRY(button) {GHOST_##button, #button} static const std::map ndof_button_names = { /* Disable wrapping, it makes it difficult to read. */ /* clang-format off */ diff --git a/intern/ghost/intern/GHOST_SystemWayland.hh b/intern/ghost/intern/GHOST_SystemWayland.hh index ebe69078b12..42a840c8ce1 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.hh +++ b/intern/ghost/intern/GHOST_SystemWayland.hh @@ -149,7 +149,7 @@ struct GWL_Output { class GHOST_SystemWayland : public GHOST_System { public: GHOST_SystemWayland(bool background); - GHOST_SystemWayland() : GHOST_SystemWayland(true){}; + GHOST_SystemWayland() : GHOST_SystemWayland(true) {}; ~GHOST_SystemWayland() override; diff --git a/intern/ghost/intern/GHOST_XrAction.cc b/intern/ghost/intern/GHOST_XrAction.cc index b5f92dd9a7d..6de6daa4835 100644 --- a/intern/ghost/intern/GHOST_XrAction.cc +++ b/intern/ghost/intern/GHOST_XrAction.cc @@ -326,7 +326,7 @@ void GHOST_XrAction::updateState(XrSession session, (std::string("Failed to get state for vector2f action \"") + action_name + "\".") .data()); if (state.isActive) { - memcpy(((float(*)[2])states_)[subaction_idx], &state.currentState, sizeof(float[2])); + memcpy(((float (*)[2])states_)[subaction_idx], &state.currentState, sizeof(float[2])); } break; } diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cc b/intern/ghost/intern/GHOST_XrGraphicsBinding.cc index 59846345b08..9b2c7fcb393 100644 --- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cc +++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cc @@ -219,13 +219,13 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding { GL_RGB10_A2, GL_RGBA16, # endif - GL_RGBA16F, + GL_RGBA16F, # if 1 - GL_RGB10_A2, - GL_RGBA16, + GL_RGB10_A2, + GL_RGBA16, # endif - GL_RGBA8, - GL_SRGB8_ALPHA8, + GL_RGBA8, + GL_SRGB8_ALPHA8, }; std::optional result = choose_swapchain_format_from_candidates(gpu_binding_formats, diff --git a/intern/ghost/intern/GHOST_XrGraphicsBindingD3D.cc b/intern/ghost/intern/GHOST_XrGraphicsBindingD3D.cc index fe733b0734e..99019550654 100644 --- a/intern/ghost/intern/GHOST_XrGraphicsBindingD3D.cc +++ b/intern/ghost/intern/GHOST_XrGraphicsBindingD3D.cc @@ -139,13 +139,13 @@ std::optional GHOST_XrGraphicsBindingD3D::chooseSwapchainFormat( DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM, #endif - DXGI_FORMAT_R16G16B16A16_FLOAT, + DXGI_FORMAT_R16G16B16A16_FLOAT, #if 1 - DXGI_FORMAT_R10G10B10A2_UNORM, - DXGI_FORMAT_R16G16B16A16_UNORM, + DXGI_FORMAT_R10G10B10A2_UNORM, + DXGI_FORMAT_R16G16B16A16_UNORM, #endif - DXGI_FORMAT_R8G8B8A8_UNORM, - DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, }; std::optional result = choose_swapchain_format_from_candidates(gpu_binding_formats, diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index af72aeef044..11d7c54c75e 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -248,7 +248,7 @@ extern size_t (*MEM_get_peak_memory)(void) ATTR_WARN_UNUSED_RESULT; /** Overhead for lockfree allocator (use to avoid slop-space). */ #define MEM_SIZE_OVERHEAD sizeof(size_t) -#define MEM_SIZE_OPTIMAL(size) ((size)-MEM_SIZE_OVERHEAD) +#define MEM_SIZE_OPTIMAL(size) ((size) - MEM_SIZE_OVERHEAD) #ifndef NDEBUG extern const char *(*MEM_name_ptr)(void *vmemh); diff --git a/intern/guardedalloc/intern/mallocn_intern.hh b/intern/guardedalloc/intern/mallocn_intern.hh index 89fd26c34a2..2b896653e43 100644 --- a/intern/guardedalloc/intern/mallocn_intern.hh +++ b/intern/guardedalloc/intern/mallocn_intern.hh @@ -69,7 +69,7 @@ size_t malloc_usable_size(void *ptr); # define MEM_INLINE static inline #endif -#define IS_POW2(a) (((a) & ((a)-1)) == 0) +#define IS_POW2(a) (((a) & ((a) - 1)) == 0) /* Extra padding which needs to be applied on MemHead to make it aligned. */ #define MEMHEAD_ALIGN_PADDING(alignment) \ diff --git a/source/blender/blenkernel/BKE_attribute.h b/source/blender/blenkernel/BKE_attribute.h index 4482dd2949f..1d6e75d9607 100644 --- a/source/blender/blenkernel/BKE_attribute.h +++ b/source/blender/blenkernel/BKE_attribute.h @@ -57,8 +57,8 @@ class AttributeOwner { void *ptr_ = nullptr; public: - AttributeOwner(){}; - AttributeOwner(AttributeOwnerType type, void *ptr) : type_(type), ptr_(ptr){}; + AttributeOwner() {}; + AttributeOwner(AttributeOwnerType type, void *ptr) : type_(type), ptr_(ptr) {}; static AttributeOwner from_id(ID *id); diff --git a/source/blender/blenkernel/BKE_context.hh b/source/blender/blenkernel/BKE_context.hh index 54e31062c16..709149ff7c9 100644 --- a/source/blender/blenkernel/BKE_context.hh +++ b/source/blender/blenkernel/BKE_context.hh @@ -343,7 +343,7 @@ bool CTX_data_dir(const char *member); { \ blender::Vector ctx_data_list; \ CTX_data_##member(C, &ctx_data_list); \ - for (PointerRNA & ctx_link : ctx_data_list) { \ + for (PointerRNA &ctx_link : ctx_data_list) { \ Type instance = (Type)ctx_link.data; #define CTX_DATA_END \ diff --git a/source/blender/blenkernel/BKE_idtype.hh b/source/blender/blenkernel/BKE_idtype.hh index d6f15490ccf..a49608eaae4 100644 --- a/source/blender/blenkernel/BKE_idtype.hh +++ b/source/blender/blenkernel/BKE_idtype.hh @@ -133,7 +133,7 @@ using IDTypeForeachColorFunction = void (*)(ID *id, const IDTypeForeachColorFunc * fully valid, and can be asserted on. But in some cases, they are not (fully) valid, e.g when * copying an ID and all of its embedded data. */ -using IDTypeEmbeddedOwnerPointerGetFunction = ID **(*)(ID *id, bool debug_relationship_assert); +using IDTypeEmbeddedOwnerPointerGetFunction = ID **(*)(ID * id, bool debug_relationship_assert); using IDTypeBlendWriteFunction = void (*)(BlendWriter *writer, ID *id, const void *id_address); using IDTypeBlendReadDataFunction = void (*)(BlendDataReader *reader, ID *id); diff --git a/source/blender/blenkernel/BKE_node.hh b/source/blender/blenkernel/BKE_node.hh index 6186650ed66..2986a516f12 100644 --- a/source/blender/blenkernel/BKE_node.hh +++ b/source/blender/blenkernel/BKE_node.hh @@ -135,7 +135,7 @@ using NodeGatherAddOperationsFunction = void (*)(blender::nodes::GatherAddNodeSearchParams ¶ms); using NodeGetCompositorOperationFunction = - blender::compositor::NodeOperation *(*)(blender::compositor::Context &context, + blender::compositor::NodeOperation *(*)(blender::compositor::Context & context, blender::nodes::DNode node); using NodeExtraInfoFunction = void (*)(blender::nodes::NodeExtraInfoParams ¶ms); using NodeInverseElemEvalFunction = @@ -211,7 +211,7 @@ struct bNodeSocketType { const SocketValueVariant *geometry_nodes_default_value = nullptr; }; -using NodeInitExecFunction = void *(*)(bNodeExecContext *context, +using NodeInitExecFunction = void *(*)(bNodeExecContext * context, bNode *node, bNodeInstanceKey key); using NodeFreeExecFunction = void (*)(void *nodedata); diff --git a/source/blender/blenkernel/BKE_shrinkwrap.hh b/source/blender/blenkernel/BKE_shrinkwrap.hh index 9a3ec43b7d3..a5c2eb090ba 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.hh +++ b/source/blender/blenkernel/BKE_shrinkwrap.hh @@ -239,17 +239,17 @@ void BKE_shrinkwrap_snap_point_to_surface(const ShrinkwrapTreeData *tree, */ #define NULL_ShrinkwrapCalcData \ { \ - NULL, \ + NULL, \ } #define NULL_BVHTreeFromMesh \ { \ - NULL, \ + NULL, \ } #define NULL_BVHTreeRayHit \ { \ - NULL, \ + NULL, \ } #define NULL_BVHTreeNearest \ { \ - 0, \ + 0, \ } diff --git a/source/blender/blenkernel/intern/appdir.cc b/source/blender/blenkernel/intern/appdir.cc index 8e69421ef87..f1fdb55fe1e 100644 --- a/source/blender/blenkernel/intern/appdir.cc +++ b/source/blender/blenkernel/intern/appdir.cc @@ -986,13 +986,13 @@ bool BKE_appdir_program_python_search(char *program_filepath, /* Check both possible names. */ const char *python_names[] = { #ifdef PYTHON_EXECUTABLE_NAME - python_build_def, + python_build_def, #endif #if defined(WIN32) && !defined(NDEBUG) - basename_debug, + basename_debug, #endif - python_version, - basename, + python_version, + basename, }; bool is_found = false; diff --git a/source/blender/blenkernel/intern/armature.cc b/source/blender/blenkernel/intern/armature.cc index 3309e8f9d7c..6869d6a4414 100644 --- a/source/blender/blenkernel/intern/armature.cc +++ b/source/blender/blenkernel/intern/armature.cc @@ -1023,7 +1023,7 @@ static void equalize_cubic_bezier(const float control[4][3], const float *segment_scales, float *r_t_points) { - float(*coords)[3] = static_cast(BLI_array_alloca(coords, temp_segments + 1)); + float (*coords)[3] = static_cast(BLI_array_alloca(coords, temp_segments + 1)); float *pdist = static_cast(BLI_array_alloca(pdist, temp_segments + 1)); /* Compute the first pass of bezier point coordinates. */ @@ -1861,7 +1861,7 @@ static void find_bbone_segment_index_straight(const bPoseChannel *pchan, float *r_blend_next) { const Mat4 *mats = pchan->runtime.bbone_deform_mats; - const float(*mat)[4] = mats[0].mat; + const float (*mat)[4] = mats[0].mat; /* Transform co to bone space and get its y component. */ const float y = mat[0][1] * co[0] + mat[1][1] * co[1] + mat[2][1] * co[2] + mat[3][1]; diff --git a/source/blender/blenkernel/intern/camera.cc b/source/blender/blenkernel/intern/camera.cc index 6442efe3f2b..38589f0136a 100644 --- a/source/blender/blenkernel/intern/camera.cc +++ b/source/blender/blenkernel/intern/camera.cc @@ -722,7 +722,7 @@ static void camera_frame_fit_data_init(const Scene *scene, BKE_camera_params_compute_matrix(params); /* initialize callback data */ - copy_m3_m4(data->camera_rotmat, (float(*)[4])ob->object_to_world().ptr()); + copy_m3_m4(data->camera_rotmat, (float (*)[4])ob->object_to_world().ptr()); normalize_m3(data->camera_rotmat); /* To transform a plane which is in its homogeneous representation (4d vector), * we need the inverse of the transpose of the transform matrix... */ diff --git a/source/blender/blenkernel/intern/cloth.cc b/source/blender/blenkernel/intern/cloth.cc index 199e9ebb3a7..329f46eb260 100644 --- a/source/blender/blenkernel/intern/cloth.cc +++ b/source/blender/blenkernel/intern/cloth.cc @@ -711,7 +711,7 @@ static bool cloth_from_object( using namespace blender; int i = 0; ClothVertex *verts = nullptr; - const float(*shapekey_rest)[3] = nullptr; + const float (*shapekey_rest)[3] = nullptr; const float tnull[3] = {0, 0, 0}; /* If we have a clothObject, free it. */ @@ -746,7 +746,7 @@ static bool cloth_from_object( if (clmd->sim_parms->shapekey_rest && !(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH)) { - shapekey_rest = static_cast( + shapekey_rest = static_cast( CustomData_get_layer(&mesh->vert_data, CD_CLOTH_ORCO)); } diff --git a/source/blender/blenkernel/intern/colorband.cc b/source/blender/blenkernel/intern/colorband.cc index 32e001b7606..c14352368f9 100644 --- a/source/blender/blenkernel/intern/colorband.cc +++ b/source/blender/blenkernel/intern/colorband.cc @@ -314,7 +314,7 @@ static float colorband_hue_interp( int mode = 0; #define HUE_INTERP(h_a, h_b) ((mfac * (h_a)) + (fac * (h_b))) -#define HUE_MOD(h) (((h) < 1.0f) ? (h) : (h)-1.0f) +#define HUE_MOD(h) (((h) < 1.0f) ? (h) : (h) - 1.0f) h1 = HUE_MOD(h1); h2 = HUE_MOD(h2); diff --git a/source/blender/blenkernel/intern/colortools.cc b/source/blender/blenkernel/intern/colortools.cc index e2854fd1653..1cea609c725 100644 --- a/source/blender/blenkernel/intern/colortools.cc +++ b/source/blender/blenkernel/intern/colortools.cc @@ -490,7 +490,7 @@ void BKE_curvemap_handle_set(CurveMap *cuma, int type) static void calchandle_curvemap(BezTriple *bezt, const BezTriple *prev, const BezTriple *next) { /* defines to avoid confusion */ -#define p2_h1 ((p2)-3) +#define p2_h1 ((p2) - 3) #define p2_h2 ((p2) + 3) const float *p1, *p3; diff --git a/source/blender/blenkernel/intern/crazyspace.cc b/source/blender/blenkernel/intern/crazyspace.cc index a08e0473f9f..d4cd6dbfe24 100644 --- a/source/blender/blenkernel/intern/crazyspace.cc +++ b/source/blender/blenkernel/intern/crazyspace.cc @@ -420,7 +420,7 @@ void BKE_crazyspace_build_sculpt(Depsgraph *depsgraph, } blender::Array origVerts = deformcos; - float(*quats)[4]; + float (*quats)[4]; int i, deformed = 0; VirtualModifierData virtual_modifier_data; Object object_eval; diff --git a/source/blender/blenkernel/intern/curve.cc b/source/blender/blenkernel/intern/curve.cc index 8f56e9950bd..d51971ac3c2 100644 --- a/source/blender/blenkernel/intern/curve.cc +++ b/source/blender/blenkernel/intern/curve.cc @@ -3068,7 +3068,7 @@ static void calchandleNurb_intern(BezTriple *bezt, char fcurve_smoothing) { /* defines to avoid confusion */ -#define p2_h1 ((p2)-3) +#define p2_h1 ((p2) - 3) #define p2_h2 ((p2) + 3) const float *p1, *p3; diff --git a/source/blender/blenkernel/intern/curve_decimate.cc b/source/blender/blenkernel/intern/curve_decimate.cc index 139c6890080..5eff0296a5d 100644 --- a/source/blender/blenkernel/intern/curve_decimate.cc +++ b/source/blender/blenkernel/intern/curve_decimate.cc @@ -88,7 +88,7 @@ static void knot_remove_error_recalculate( BLI_assert(equals_v3v3(points[k->next->point_index], k->next->co)); #endif - const float(*points_offset)[3]; + const float (*points_offset)[3]; uint points_offset_len; if (k->prev->point_index < k->next->point_index) { @@ -196,7 +196,7 @@ uint BKE_curve_decimate_bezt_array(BezTriple *bezt_array, const uint bezt_array_last = bezt_array_len - 1; const uint points_len = BKE_curve_calc_coords_axis_len(bezt_array_len, resolu, is_cyclic, true); - float(*points)[3] = MEM_malloc_arrayN(points_len * (is_cyclic ? 2 : 1), __func__); + float (*points)[3] = MEM_malloc_arrayN(points_len * (is_cyclic ? 2 : 1), __func__); BKE_curve_calc_coords_axis( bezt_array, bezt_array_len, resolu, is_cyclic, false, 0, sizeof(float[3]), &points[0][0]); diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index ece381d5531..30d74888261 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -615,7 +615,7 @@ static void layerSwap_mdisps(void *data, const int *ci) return; } - float(*d)[3] = MEM_calloc_arrayN(s->totdisp, "mdisps swap"); + float (*d)[3] = MEM_calloc_arrayN(s->totdisp, "mdisps swap"); for (int S = 0; S < corners; S++) { memcpy(d + cornersize * S, s->disps + cornersize * ci[S], sizeof(float[3]) * cornersize); @@ -633,7 +633,7 @@ static void layerCopy_mdisps(const void *source, void *dest, const int count) for (int i = 0; i < count; i++) { if (s[i].disps) { - d[i].disps = static_cast(MEM_dupallocN(s[i].disps)); + d[i].disps = static_cast(MEM_dupallocN(s[i].disps)); d[i].hidden = static_cast(MEM_dupallocN(s[i].hidden)); } else { @@ -1157,7 +1157,7 @@ static void layerInterp_mvert_skin(const void **sources, static void layerSwap_flnor(void *data, const int *corner_indices) { - short(*flnors)[4][3] = static_cast(data); + short (*flnors)[4][3] = static_cast(data); short nors[4][3]; int i = 4; diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index 149d8fd3a3e..89783812a59 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -242,7 +242,7 @@ static void curve_to_displist(const Curve *cu, dl->charidx = nu->charidx; dl->type = (is_cyclic && (dl->nr != 2)) ? DL_POLY : DL_SEGM; - float(*coords)[3] = (float(*)[3])dl->verts; + float (*coords)[3] = (float (*)[3])dl->verts; for (int i = 0; i < len; i++) { const BPoint *bp = &nu->bp[i]; copy_v3_v3(coords[i], bp->vec); diff --git a/source/blender/blenkernel/intern/dynamicpaint.cc b/source/blender/blenkernel/intern/dynamicpaint.cc index 92a788f08d4..6928f72ec25 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.cc +++ b/source/blender/blenkernel/intern/dynamicpaint.cc @@ -1861,7 +1861,7 @@ static void dynamic_paint_apply_surface_vpaint_blend_cb(void *__restrict userdat userdata); PaintPoint *pPoint = (PaintPoint *)data->surface->data->type_data; - float(*fcolor)[4] = data->fcolor; + float (*fcolor)[4] = data->fcolor; /* blend dry and wet layer */ blendColors( @@ -1879,7 +1879,7 @@ static void dynamic_paint_apply_surface_vpaint_cb(void *__restrict userdata, const DynamicPaintSurface *surface = data->surface; PaintPoint *pPoint = (PaintPoint *)surface->data->type_data; - float(*fcolor)[4] = data->fcolor; + float (*fcolor)[4] = data->fcolor; blender::MutableSpan mloopcol = data->mloopcol; blender::MutableSpan mloopcol_wet = data->mloopcol_wet; @@ -1950,8 +1950,8 @@ static Mesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, Object * const blender::Span corner_verts = result->corner_verts(); /* paint is stored on dry and wet layers, so mix final color first */ - float(*fcolor)[4] = MEM_calloc_arrayN(sData->total_points, - "Temp paint color"); + float (*fcolor)[4] = MEM_calloc_arrayN(sData->total_points, + "Temp paint color"); DynamicPaintModifierApplyData data{}; data.surface = surface; @@ -2203,7 +2203,16 @@ Mesh *dynamicPaint_Modifier_do( /* Create a surface for uv image sequence format. */ #define JITTER_SAMPLES \ { \ - 0.0f, 0.0f, -0.2f, -0.4f, 0.2f, 0.4f, 0.4f, -0.2f, -0.4f, 0.3f, \ + 0.0f, \ + 0.0f, \ + -0.2f, \ + -0.4f, \ + 0.2f, \ + 0.4f, \ + 0.4f, \ + -0.2f, \ + -0.4f, \ + 0.3f, \ } struct DynamicPaintCreateUVSurfaceData { @@ -3768,11 +3777,11 @@ static void dynamic_paint_brush_velocity_compute_cb(void *__restrict userdata, Vec3f *brush_vel = data->brush_vel; - const float(*positions_p)[3] = data->positions_p; - const float(*positions_c)[3] = data->positions_c; + const float (*positions_p)[3] = data->positions_p; + const float (*positions_c)[3] = data->positions_c; - const float(*obmat)[4] = data->obmat; - float(*prev_obmat)[4] = data->prev_obmat; + const float (*obmat)[4] = data->obmat; + float (*prev_obmat)[4] = data->prev_obmat; const float timescale = data->timescale; @@ -3831,7 +3840,7 @@ static void dynamicPaint_brushMeshCalculateVelocity(Depsgraph *depsgraph, } numOfVerts_p = mesh_p->verts_num; - float(*positions_p)[3] = reinterpret_cast( + float (*positions_p)[3] = reinterpret_cast( mesh_p->vert_positions_for_write().data()); copy_m4_m4(prev_obmat, ob->object_to_world().ptr()); @@ -3854,7 +3863,7 @@ static void dynamicPaint_brushMeshCalculateVelocity(Depsgraph *depsgraph, mesh_c = runtime_data->brush_mesh; numOfVerts_c = mesh_c->verts_num; - float(*positions_c)[3] = reinterpret_cast( + float (*positions_c)[3] = reinterpret_cast( mesh_c->vert_positions_for_write().data()); (*brushVel) = MEM_malloc_arrayN(size_t(numOfVerts_c), "Dynamic Paint brush velocity"); diff --git a/source/blender/blenkernel/intern/editmesh_tangent.cc b/source/blender/blenkernel/intern/editmesh_tangent.cc index a9bd7f889f5..fb1bfb10812 100644 --- a/source/blender/blenkernel/intern/editmesh_tangent.cc +++ b/source/blender/blenkernel/intern/editmesh_tangent.cc @@ -223,7 +223,7 @@ Array> BKE_editmesh_uv_tangents_calc(BMEditMesh *em, mesh2tangent.looptris = em->looptris; result[n].reinitialize(bm->totloop); - mesh2tangent.tangent = reinterpret_cast(result[n].data()); + mesh2tangent.tangent = reinterpret_cast(result[n].data()); mikk::Mikktspace mikk(mesh2tangent); mikk.genTangSpace(); @@ -275,7 +275,7 @@ Array BKE_editmesh_orco_tangents_calc(BMEditMesh *em, mesh2tangent.orco = vert_orco; mesh2tangent.looptris = em->looptris; - mesh2tangent.tangent = reinterpret_cast(result.data()); + mesh2tangent.tangent = reinterpret_cast(result.data()); mikk::Mikktspace mikk(mesh2tangent); mikk.genTangSpace(); diff --git a/source/blender/blenkernel/intern/fcurve_driver.cc b/source/blender/blenkernel/intern/fcurve_driver.cc index ddc1dc9de74..e3908af1447 100644 --- a/source/blender/blenkernel/intern/fcurve_driver.cc +++ b/source/blender/blenkernel/intern/fcurve_driver.cc @@ -433,7 +433,7 @@ static float dvar_eval_rotDiff(const AnimationEvalContext * /*anim_eval_context* return 0.0f; } - const float(*mat[2])[4]; + const float (*mat[2])[4]; /* NOTE: for now, these are all just world-space. */ for (int i = 0; i < 2; i++) { diff --git a/source/blender/blenkernel/intern/gpencil_geom_legacy.cc b/source/blender/blenkernel/intern/gpencil_geom_legacy.cc index 360dc506641..5454cd302e5 100644 --- a/source/blender/blenkernel/intern/gpencil_geom_legacy.cc +++ b/source/blender/blenkernel/intern/gpencil_geom_legacy.cc @@ -155,9 +155,10 @@ void BKE_gpencil_stroke_fill_triangulate(bGPDstroke *gps) gps->tot_triangles = gps->totpoints - 2; uint(*tmp_triangles)[3] = MEM_malloc_arrayN(size_t(gps->tot_triangles), "GP Stroke temp triangulation"); - float(*points2d)[2] = MEM_malloc_arrayN(size_t(gps->totpoints), - "GP Stroke temp 2d points"); - float(*uv)[2] = MEM_malloc_arrayN(size_t(gps->totpoints), "GP Stroke temp 2d uv data"); + float (*points2d)[2] = MEM_malloc_arrayN(size_t(gps->totpoints), + "GP Stroke temp 2d points"); + float (*uv)[2] = MEM_malloc_arrayN(size_t(gps->totpoints), + "GP Stroke temp 2d uv data"); int direction = 0; diff --git a/source/blender/blenkernel/intern/grease_pencil.cc b/source/blender/blenkernel/intern/grease_pencil.cc index f1119f4a663..58a6f20d3f8 100644 --- a/source/blender/blenkernel/intern/grease_pencil.cc +++ b/source/blender/blenkernel/intern/grease_pencil.cc @@ -499,7 +499,7 @@ static void update_triangle_cache(const Span positions, } MutableSpan r_tris = triangles.slice(triangle_offsets[curve_i]); - float(*projverts)[2] = static_cast( + float (*projverts)[2] = static_cast( BLI_memarena_alloc(pf_arena, sizeof(*projverts) * size_t(points.size()))); float3x3 axis_mat; @@ -510,7 +510,7 @@ static void update_triangle_cache(const Span positions, } BLI_polyfill_calc_arena( - projverts, points.size(), 0, reinterpret_cast(r_tris.data()), pf_arena); + projverts, points.size(), 0, reinterpret_cast(r_tris.data()), pf_arena); BLI_memarena_clear(pf_arena); } }); diff --git a/source/blender/blenkernel/intern/key.cc b/source/blender/blenkernel/intern/key.cc index f9d9253493c..2e28c0494a4 100644 --- a/source/blender/blenkernel/intern/key.cc +++ b/source/blender/blenkernel/intern/key.cc @@ -601,7 +601,7 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char ** Mesh *mesh; BMVert *eve; BMIter iter; - float(*co)[3]; + float (*co)[3]; int a; mesh = (Mesh *)key->from; @@ -1588,7 +1588,7 @@ float *BKE_key_evaluate_object_ex( case ID_LT: { Lattice *lattice = (Lattice *)obdata; const int totpoint = min_ii(tot, lattice->pntsu * lattice->pntsv * lattice->pntsw); - keyblock_data_convert_to_lattice((const float(*)[3])out, lattice->def, totpoint); + keyblock_data_convert_to_lattice((const float (*)[3])out, lattice->def, totpoint); break; } case ID_CU_LEGACY: { @@ -1687,7 +1687,7 @@ void BKE_keyblock_data_set_with_mat4(Key *key, for (KeyBlock *kb = static_cast(key->block.first); kb; kb = kb->next, index++) { if (ELEM(shape_index, -1, index)) { const int block_elem_len = kb->totelem; - float(*block_data)[3] = (float(*)[3])kb->data; + float (*block_data)[3] = (float (*)[3])kb->data; for (int data_offset = 0; data_offset < block_elem_len; ++data_offset) { const float *src_data = (const float *)(elements + data_offset); float *dst_data = (float *)(block_data + data_offset); @@ -1956,7 +1956,7 @@ std::optional BKE_keyblock_curval_rnapath_get(const Key *key, const void BKE_keyblock_update_from_lattice(const Lattice *lt, KeyBlock *kb) { BPoint *bp; - float(*fp)[3]; + float (*fp)[3]; int a, tot; BLI_assert(kb->totelem == lt->pntsu * lt->pntsv * lt->pntsw); @@ -1967,7 +1967,7 @@ void BKE_keyblock_update_from_lattice(const Lattice *lt, KeyBlock *kb) } bp = lt->def; - fp = static_cast(kb->data); + fp = static_cast(kb->data); for (a = 0; a < kb->totelem; a++, fp++, bp++) { copy_v3_v3(*fp, bp->vec); } @@ -2002,7 +2002,7 @@ static void keyblock_data_convert_to_lattice(const float (*fp)[3], void BKE_keyblock_convert_to_lattice(const KeyBlock *kb, Lattice *lt) { BPoint *bp = lt->def; - const float(*fp)[3] = static_cast(kb->data); + const float (*fp)[3] = static_cast(kb->data); const int tot = min_ii(kb->totelem, lt->pntsu * lt->pntsv * lt->pntsw); keyblock_data_convert_to_lattice(fp, bp, tot); @@ -2213,8 +2213,8 @@ void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb, const bool face_normals_needed = r_face_normals != nullptr || vert_normals_needed || loop_normals_needed; - float(*vert_normals)[3] = r_vert_normals; - float(*face_normals)[3] = r_face_normals; + float (*vert_normals)[3] = r_vert_normals; + float (*face_normals)[3] = r_face_normals; bool free_vert_normals = false; bool free_face_normals = false; if (vert_normals_needed && r_vert_normals == nullptr) { diff --git a/source/blender/blenkernel/intern/mask_evaluate.cc b/source/blender/blenkernel/intern/mask_evaluate.cc index a9048e4ee9f..e4dbaf25f8e 100644 --- a/source/blender/blenkernel/intern/mask_evaluate.cc +++ b/source/blender/blenkernel/intern/mask_evaluate.cc @@ -121,7 +121,7 @@ float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline, MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); MaskSplinePoint *point_curr, *point_prev; - float(*diff_points)[2], (*fp)[2]; + float (*diff_points)[2], (*fp)[2]; const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol); int a; @@ -203,7 +203,7 @@ static void feather_bucket_add_edge(FeatherEdgesBucket *bucket, int start, int e bucket->segments = MEM_calloc_arrayN(alloc_delta, "feather bucket segments"); } else { - bucket->segments = static_cast(MEM_reallocN( + bucket->segments = static_cast(MEM_reallocN( bucket->segments, (alloc_delta + bucket->tot_segment) * sizeof(*bucket->segments))); } @@ -495,7 +495,7 @@ static float ( { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); MaskSplinePoint *point_curr, *point_prev; - float(*feather)[2], (*fp)[2]; + float (*feather)[2], (*fp)[2]; const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol); int a; @@ -570,7 +570,7 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); MaskSplinePoint *point_curr, *point_prev; - float(*feather)[2], (*fp)[2]; + float (*feather)[2], (*fp)[2]; const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol); int a; @@ -724,7 +724,7 @@ float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *r_tot_feather_po MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); int i, tot = 0; - float(*feather)[2], (*fp)[2]; + float (*feather)[2], (*fp)[2]; /* count */ for (i = 0; i < spline->tot_point; i++) { diff --git a/source/blender/blenkernel/intern/mask_rasterize.cc b/source/blender/blenkernel/intern/mask_rasterize.cc index a104d70a643..bd0d6436bf9 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.cc +++ b/source/blender/blenkernel/intern/mask_rasterize.cc @@ -328,7 +328,7 @@ static bool layer_bucket_isect_test(const MaskRasterLayer *layer, const float bucket_max_rad_squared) { uint *face = layer->face_array[face_index]; - float(*cos)[3] = layer->face_coords; + float (*cos)[3] = layer->face_coords; const float xmin = layer->bounds.xmin + (bucket_size_x * float(bucket_x)); const float ymin = layer->bounds.ymin + (bucket_size_y * float(bucket_y)); @@ -425,7 +425,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size) const float bucket_max_rad_squared = bucket_max_rad * bucket_max_rad; uint *face = &layer->face_array[0][0]; - float(*cos)[3] = layer->face_coords; + float (*cos)[3] = layer->face_coords; const uint bucket_tot = layer->buckets_x * layer->buckets_y; LinkNode **bucketstore = MEM_calloc_arrayN(bucket_tot, __func__); @@ -623,11 +623,11 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, const bool is_cyclic = (spline->flag & MASK_SPLINE_CYCLIC) != 0; const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; - float(*diff_points)[2]; + float (*diff_points)[2]; uint tot_diff_point; - float(*diff_feather_points)[2]; - float(*diff_feather_points_flip)[2]; + float (*diff_feather_points)[2]; + float (*diff_feather_points_flip)[2]; uint tot_diff_feather_points; const uint resol_a = uint(BKE_mask_spline_resolution(spline, width, height) / 4); @@ -899,8 +899,8 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, } { - uint(*face_array)[4], *face; /* access coords */ - float(*face_coords)[3], *cos; /* xy, z 0-1 (1.0 == filled) */ + uint(*face_array)[4], *face; /* access coords */ + float (*face_coords)[3], *cos; /* xy, z 0-1 (1.0 == filled) */ uint sf_tri_tot; rctf bounds; uint face_index; @@ -946,7 +946,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, uint sf_vert_tot_isect = uint(BLI_listbase_count(&sf_ctx.fillvertbase)); uint i = sf_vert_tot; - face_coords = static_cast( + face_coords = static_cast( MEM_reallocN(face_coords, sizeof(float[3]) * (sf_vert_tot + sf_vert_tot_isect))); cos = (&face_coords[sf_vert_tot][0]); @@ -1332,7 +1332,7 @@ static float layer_bucket_depth_from_xy(MaskRasterLayer *layer, const float xy[2 if (face_index) { uint(*face_array)[4] = layer->face_array; - float(*cos)[3] = layer->face_coords; + float (*cos)[3] = layer->face_coords; float best_dist = 1.0f; while (*face_index != TRI_TERMINATOR_ID) { const float test_dist = maskrasterize_layer_isect( diff --git a/source/blender/blenkernel/intern/mball.cc b/source/blender/blenkernel/intern/mball.cc index 19927bcfc69..6742ee2c48f 100644 --- a/source/blender/blenkernel/intern/mball.cc +++ b/source/blender/blenkernel/intern/mball.cc @@ -673,7 +673,7 @@ void BKE_mball_data_update(Depsgraph *depsgraph, Scene *scene, Object *ob) BKE_lattice_deform_coords( ob->parent, ob, - reinterpret_cast(mesh->vert_positions_for_write().data()), + reinterpret_cast(mesh->vert_positions_for_write().data()), mesh->verts_num, 0, nullptr, diff --git a/source/blender/blenkernel/intern/mball_tessellate.cc b/source/blender/blenkernel/intern/mball_tessellate.cc index 476c8056789..27894afac21 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.cc +++ b/source/blender/blenkernel/intern/mball_tessellate.cc @@ -312,7 +312,7 @@ static float densfunc(const MetaElem *ball, float x, float y, float z) float dist2; float dvec[3] = {x, y, z}; - mul_m4_v3((const float(*)[4])ball->imat, dvec); + mul_m4_v3((const float (*)[4])ball->imat, dvec); switch (ball->type) { case MB_BALL: @@ -444,7 +444,7 @@ static void make_face(PROCESS *process, int i1, int i2, int i3, int i4) if (UNLIKELY(process->totindex == process->curindex)) { process->totindex = process->totindex ? (process->totindex * 2) : MBALL_ARRAY_LEN_INIT; - process->indices = static_cast( + process->indices = static_cast( MEM_reallocN(process->indices, sizeof(int[4]) * process->totindex)); } @@ -1278,9 +1278,9 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje * rotation -> * ml local space */ - mul_m4_series((float(*)[4])new_ml->mat, obinv, bob->object_to_world().ptr(), pos, rot); + mul_m4_series((float (*)[4])new_ml->mat, obinv, bob->object_to_world().ptr(), pos, rot); /* ml local space -> basis object space */ - invert_m4_m4((float(*)[4])new_ml->imat, (float(*)[4])new_ml->mat); + invert_m4_m4((float (*)[4])new_ml->imat, (float (*)[4])new_ml->mat); /* rad2 is inverse of squared radius */ new_ml->rad2 = 1 / (ml->rad * ml->rad); @@ -1323,7 +1323,7 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje /* Transformation of meta-elem bounding-box. */ for (uint i = 0; i < 8; i++) { - mul_m4_v3((float(*)[4])new_ml->mat, new_ml->bb->vec[i]); + mul_m4_v3((float (*)[4])new_ml->mat, new_ml->bb->vec[i]); } /* Find max and min of transformed bounding-box. */ diff --git a/source/blender/blenkernel/intern/mesh_evaluate.cc b/source/blender/blenkernel/intern/mesh_evaluate.cc index 381f6d8343e..d68c3576bdd 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.cc +++ b/source/blender/blenkernel/intern/mesh_evaluate.cc @@ -80,7 +80,7 @@ float face_area_calc(const Span vert_positions, const Span face_ver for (const int i : face_verts.index_range()) { coords[i] = vert_positions[face_verts[i]]; } - return area_poly_v3((const float(*)[3])coords.data(), face_verts.size()); + return area_poly_v3((const float (*)[3])coords.data(), face_verts.size()); } } // namespace blender::bke::mesh @@ -466,7 +466,7 @@ void BKE_mesh_mdisp_flip(MDisps *md, const bool use_loop_mdisp_flip) } const int sides = int(sqrt(md->totdisp)); - float(*co)[3] = md->disps; + float (*co)[3] = md->disps; for (int x = 0; x < sides; x++) { float *co_a, *co_b; diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc index 25e0c693a1d..8f8a649929d 100644 --- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc +++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc @@ -386,9 +386,9 @@ static void bm_corners_to_loops_ex(ID *id, } if (CustomData_has_layer(fdata_legacy, CD_TESSLOOPNORMAL)) { - float(*loop_normals)[3] = (float(*)[3])CustomData_get_for_write( + float (*loop_normals)[3] = (float (*)[3])CustomData_get_for_write( ldata, loopstart, CD_NORMAL, totloop); - const short(*tessloop_normals)[3] = (short(*)[3])CustomData_get_for_write( + const short (*tessloop_normals)[3] = (short (*)[3])CustomData_get_for_write( fdata_legacy, findex, CD_TESSLOOPNORMAL, totface); const int max = mf->v4 ? 4 : 3; @@ -401,7 +401,7 @@ static void bm_corners_to_loops_ex(ID *id, MDisps *ld = (MDisps *)CustomData_get_for_write(ldata, loopstart, CD_MDISPS, totloop); const MDisps *fd = (const MDisps *)CustomData_get_for_write( fdata_legacy, findex, CD_MDISPS, totface); - const float(*disps)[3] = fd->disps; + const float (*disps)[3] = fd->disps; int tot = mf->v4 ? 4 : 3; int corners; @@ -900,10 +900,10 @@ static void mesh_loops_to_tessdata(CustomData *fdata_legacy, } if (hasLoopNormal) { - short(*face_normals)[4][3] = (short(*)[4][3])CustomData_get_layer(fdata_legacy, - CD_TESSLOOPNORMAL); - const float(*loop_normals)[3] = (const float(*)[3])CustomData_get_layer(corner_data, - CD_NORMAL); + short (*face_normals)[4][3] = (short (*)[4][3])CustomData_get_layer(fdata_legacy, + CD_TESSLOOPNORMAL); + const float (*loop_normals)[3] = (const float (*)[3])CustomData_get_layer(corner_data, + CD_NORMAL); for (findex = 0, lidx = loopindices; findex < num_faces; lidx++, findex++, face_normals++) { for (j = (mface ? mface[findex].v4 : (*lidx)[3]) ? 4 : 3; j--;) { @@ -1099,7 +1099,7 @@ static int mesh_tessface_calc(Mesh &mesh, float normal[3]; float axis_mat[3][3]; - float(*projverts)[2]; + float (*projverts)[2]; uint(*tris)[3]; const uint totfilltri = mp_totloop - 2; @@ -1109,7 +1109,7 @@ static int mesh_tessface_calc(Mesh &mesh, } tris = (uint(*)[3])BLI_memarena_alloc(arena, sizeof(*tris) * size_t(totfilltri)); - projverts = (float(*)[2])BLI_memarena_alloc(arena, sizeof(*projverts) * size_t(mp_totloop)); + projverts = (float (*)[2])BLI_memarena_alloc(arena, sizeof(*projverts) * size_t(mp_totloop)); zero_v3(normal); @@ -1233,7 +1233,7 @@ void BKE_mesh_tessface_calc(Mesh *mesh) &mesh->fdata_legacy, &mesh->corner_data, &mesh->face_data, - reinterpret_cast(mesh->vert_positions_for_write().data()), + reinterpret_cast(mesh->vert_positions_for_write().data()), mesh->totface_legacy, mesh->corners_num, mesh->faces_num); diff --git a/source/blender/blenkernel/intern/mesh_mapping.cc b/source/blender/blenkernel/intern/mesh_mapping.cc index ff9b9c1385e..7b819930b8f 100644 --- a/source/blender/blenkernel/intern/mesh_mapping.cc +++ b/source/blender/blenkernel/intern/mesh_mapping.cc @@ -63,7 +63,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(blender::OffsetIndices faces, threading::parallel_for(faces.index_range(), 1024, [&](const IndexRange range) { for (const int64_t face : range) { const Span face_uvs = uv_map.slice(faces[face]); - winding[face] = cross_poly_v2(reinterpret_cast(face_uvs.data()), + winding[face] = cross_poly_v2(reinterpret_cast(face_uvs.data()), uint(faces[face].size())) < 0.0f; } }); diff --git a/source/blender/blenkernel/intern/mesh_mirror.cc b/source/blender/blenkernel/intern/mesh_mirror.cc index a2d49ef7cda..b35c0b9cf98 100644 --- a/source/blender/blenkernel/intern/mesh_mirror.cc +++ b/source/blender/blenkernel/intern/mesh_mirror.cc @@ -283,7 +283,7 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, /* handle shape keys */ totshape = CustomData_number_of_layers(&result->vert_data, CD_SHAPEKEY); for (a = 0; a < totshape; a++) { - float(*cos)[3] = static_cast( + float (*cos)[3] = static_cast( CustomData_get_layer_n_for_write(&result->vert_data, CD_SHAPEKEY, a, result->verts_num)); for (int i = src_verts_num; i < result->verts_num; i++) { mul_m4_v3(mtx, cos[i]); @@ -359,7 +359,7 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, const int totuv = CustomData_number_of_layers(&result->corner_data, CD_PROP_FLOAT2); for (a = 0; a < totuv; a++) { - float(*uv_map)[2] = static_cast(CustomData_get_layer_n_for_write( + float (*uv_map)[2] = static_cast(CustomData_get_layer_n_for_write( &result->corner_data, CD_PROP_FLOAT2, a, result->corners_num)); int j = src_loops_num; uv_map += j; /* second set of loops only */ diff --git a/source/blender/blenkernel/intern/mesh_remap.cc b/source/blender/blenkernel/intern/mesh_remap.cc index 6f470b76aaa..01c9e57495b 100644 --- a/source/blender/blenkernel/intern/mesh_remap.cc +++ b/source/blender/blenkernel/intern/mesh_remap.cc @@ -181,13 +181,13 @@ static void mesh_calc_eigen_matrix(const Span positions, float r_mat[4][ /* NOTE: here we apply sample correction to covariance matrix, since we consider the vertices * as a sample of the whole 'surface' population of our mesh. */ - BLI_covariance_m3_v3n(reinterpret_cast(positions.data()), + BLI_covariance_m3_v3n(reinterpret_cast(positions.data()), int(positions.size()), true, covmat, center); - eigen_success = BLI_eigen_solve_selfadjoint_m3((const float(*)[3])covmat, eigen_val, eigen_vec); + eigen_success = BLI_eigen_solve_selfadjoint_m3((const float (*)[3])covmat, eigen_val, eigen_vec); BLI_assert(eigen_success); UNUSED_VARS_NDEBUG(eigen_success); @@ -247,7 +247,7 @@ void BKE_mesh_remap_find_best_match_from_mesh(const Span vert_positions_ {1.0f, 1.0f, -1.0f}, /* -> 1, -1, 1 */ {0.0f, 0.0f, 0.0f}, }; - const float(*mirr)[3]; + const float (*mirr)[3]; float mat_src[4][4], mat_dst[4][4], best_mat_dst[4][4]; float best_match = FLT_MAX, match; @@ -355,7 +355,7 @@ static int mesh_remap_interp_face_data_get(const blender::IndexRange face, const bool do_weights, int *r_closest_index) { - float(*vco)[3]; + float (*vco)[3]; float ref_dist_sq = FLT_MAX; int *index; const int sources_num = int(face.size()); @@ -363,7 +363,7 @@ static int mesh_remap_interp_face_data_get(const blender::IndexRange face, if (size_t(sources_num) > *buff_size) { *buff_size = size_t(sources_num); - *vcos = static_cast(MEM_reallocN(*vcos, sizeof(**vcos) * *buff_size)); + *vcos = static_cast(MEM_reallocN(*vcos, sizeof(**vcos) * *buff_size)); *indices = static_cast(MEM_reallocN(*indices, sizeof(**indices) * *buff_size)); if (do_weights) { *weights = static_cast(MEM_reallocN(*weights, sizeof(**weights) * *buff_size)); @@ -543,7 +543,7 @@ void BKE_mesh_remap_calc_verts_from_mesh(const int mode, const blender::Span tri_faces = me_src->corner_tri_faces(); size_t tmp_buff_size = MREMAP_DEFAULT_BUFSIZE; - float(*vcos)[3] = MEM_malloc_arrayN(tmp_buff_size, __func__); + float (*vcos)[3] = MEM_malloc_arrayN(tmp_buff_size, __func__); int *indices = MEM_malloc_arrayN(tmp_buff_size, __func__); float *weights = MEM_malloc_arrayN(tmp_buff_size, __func__); @@ -1074,14 +1074,14 @@ static void mesh_island_to_astar_graph(MeshIslandStore *islands, const int node_num = islands ? island_face_map->count : int(faces.size()); uchar *face_status = MEM_calloc_arrayN(size_t(node_num), __func__); - float(*face_centers)[3]; + float (*face_centers)[3]; int pidx_isld; int i; BLI_astar_graph_init(r_as_graph, node_num, nullptr); /* face_centers is owned by graph memarena. */ - face_centers = static_cast( + face_centers = static_cast( BLI_memarena_calloc(r_as_graph->mem, sizeof(*face_centers) * size_t(node_num))); if (islands) { @@ -1260,7 +1260,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode, blender::Span tri_faces_src; size_t buff_size_interp = MREMAP_DEFAULT_BUFSIZE; - float(*vcos_interp)[3] = nullptr; + float (*vcos_interp)[3] = nullptr; int *indices_interp = nullptr; float *weights_interp = nullptr; @@ -1479,7 +1479,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode, if (mesh_remap_bvhtree_query_nearest(tdata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { - float(*nor_dst)[3]; + float (*nor_dst)[3]; blender::Span nors_src; float best_nor_dot = -2.0f; float best_sqdist_fallback = FLT_MAX; @@ -2084,9 +2084,9 @@ void BKE_mesh_remap_calc_faces_from_mesh(const int mode, float *weights = MEM_malloc_arrayN(numfaces_src, __func__); size_t tmp_face_size = MREMAP_DEFAULT_BUFSIZE; - float(*face_vcos_2d)[2] = MEM_malloc_arrayN(tmp_face_size, __func__); + float (*face_vcos_2d)[2] = MEM_malloc_arrayN(tmp_face_size, __func__); /* Tessellated 2D face, always (num_loops - 2) triangles. */ - int(*tri_vidx_2d)[3] = MEM_malloc_arrayN(tmp_face_size - 2, __func__); + int (*tri_vidx_2d)[3] = MEM_malloc_arrayN(tmp_face_size - 2, __func__); for (const int64_t i : faces_dst.index_range()) { /* For each dst face, we sample some rays from it (2D grid in pnor space) @@ -2123,9 +2123,9 @@ void BKE_mesh_remap_calc_faces_from_mesh(const int mode, if (UNLIKELY(size_t(face.size()) > tmp_face_size)) { tmp_face_size = size_t(face.size()); - face_vcos_2d = static_cast( + face_vcos_2d = static_cast( MEM_reallocN(face_vcos_2d, sizeof(*face_vcos_2d) * tmp_face_size)); - tri_vidx_2d = static_cast( + tri_vidx_2d = static_cast( MEM_reallocN(tri_vidx_2d, sizeof(*tri_vidx_2d) * (tmp_face_size - 2))); } diff --git a/source/blender/blenkernel/intern/mesh_runtime.cc b/source/blender/blenkernel/intern/mesh_runtime.cc index fe6c9638ab5..8182aa3383b 100644 --- a/source/blender/blenkernel/intern/mesh_runtime.cc +++ b/source/blender/blenkernel/intern/mesh_runtime.cc @@ -509,7 +509,7 @@ bool BKE_mesh_runtime_is_valid(Mesh *mesh_eval) CustomData_get_layer_for_write(&mesh_eval->vert_data, CD_MDEFORMVERT, mesh_eval->verts_num)); is_valid &= BKE_mesh_validate_arrays( mesh_eval, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), edges.data(), edges.size(), diff --git a/source/blender/blenkernel/intern/mesh_tessellate.cc b/source/blender/blenkernel/intern/mesh_tessellate.cc index 3f22556a3b9..da1ac92f1e3 100644 --- a/source/blender/blenkernel/intern/mesh_tessellate.cc +++ b/source/blender/blenkernel/intern/mesh_tessellate.cc @@ -106,7 +106,7 @@ BLI_INLINE void mesh_calc_tessellation_for_face_impl(const Span corner_vert uint(*tris)[3] = static_cast( BLI_memarena_alloc(pf_arena, sizeof(*tris) * size_t(totfilltri))); - float(*projverts)[2] = static_cast( + float (*projverts)[2] = static_cast( BLI_memarena_alloc(pf_arena, sizeof(*projverts) * size_t(face_size))); for (int j = 0; j < face_size; j++) { diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc index 3402ad7d9c2..58a2d7dac08 100644 --- a/source/blender/blenkernel/intern/mesh_validate.cc +++ b/source/blender/blenkernel/intern/mesh_validate.cc @@ -1050,7 +1050,7 @@ bool BKE_mesh_validate(Mesh *mesh, const bool do_verbose, const bool cddata_chec CustomData_get_layer_for_write(&mesh->vert_data, CD_MDEFORMVERT, mesh->verts_num)); BKE_mesh_validate_arrays( mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), edges.data(), edges.size(), @@ -1107,7 +1107,7 @@ bool BKE_mesh_is_valid(Mesh *mesh) CustomData_get_layer_for_write(&mesh->vert_data, CD_MDEFORMVERT, mesh->verts_num)); is_valid &= BKE_mesh_validate_arrays( mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), edges.data(), edges.size(), diff --git a/source/blender/blenkernel/intern/multires.cc b/source/blender/blenkernel/intern/multires.cc index e19420203f7..f3db6a18435 100644 --- a/source/blender/blenkernel/intern/multires.cc +++ b/source/blender/blenkernel/intern/multires.cc @@ -489,11 +489,11 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, const int MDisps *mdisp = &mdisps[corner]; const int totdisp = multires_grid_tot[lvl]; - float(*disps)[3] = MEM_calloc_arrayN(totdisp, "multires disps"); + float (*disps)[3] = MEM_calloc_arrayN(totdisp, "multires disps"); if (mdisp->disps != nullptr) { - float(*ndisps)[3] = disps; - float(*hdisps)[3] = mdisp->disps; + float (*ndisps)[3] = disps; + float (*hdisps)[3] = mdisp->disps; multires_copy_grid(ndisps, hdisps, nsize, hsize); if (mdisp->hidden) { diff --git a/source/blender/blenkernel/intern/multires_reshape_subdivide.cc b/source/blender/blenkernel/intern/multires_reshape_subdivide.cc index d52c390005d..d4eea696280 100644 --- a/source/blender/blenkernel/intern/multires_reshape_subdivide.cc +++ b/source/blender/blenkernel/intern/multires_reshape_subdivide.cc @@ -34,7 +34,7 @@ static void multires_subdivide_create_object_space_linear_grids(Mesh *mesh) for (int l = 0; l < face.size(); l++) { const int loop_index = face[l]; - float(*disps)[3] = mdisps[loop_index].disps; + float (*disps)[3] = mdisps[loop_index].disps; mdisps[loop_index].totdisp = 4; mdisps[loop_index].level = 1; diff --git a/source/blender/blenkernel/intern/multires_reshape_util.cc b/source/blender/blenkernel/intern/multires_reshape_util.cc index 8c5349e38a8..d1cfbcdede0 100644 --- a/source/blender/blenkernel/intern/multires_reshape_util.cc +++ b/source/blender/blenkernel/intern/multires_reshape_util.cc @@ -561,7 +561,7 @@ static void allocate_displacement_grid(MDisps *displacement_grid, const int leve { const int grid_size = blender::bke::subdiv::grid_size_from_level(level); const int grid_area = grid_size * grid_size; - float(*disps)[3] = MEM_calloc_arrayN(grid_area, "multires disps"); + float (*disps)[3] = MEM_calloc_arrayN(grid_area, "multires disps"); if (displacement_grid->disps != nullptr) { MEM_freeN(displacement_grid->disps); } @@ -644,7 +644,7 @@ void multires_reshape_store_original_grids(MultiresReshapeContext *reshape_conte * Reshape process will ensure all grids are on top level, but that happens on separate set of * grids which eventually replaces original one. */ if (orig_grid->disps != nullptr) { - orig_grid->disps = static_cast(MEM_dupallocN(orig_grid->disps)); + orig_grid->disps = static_cast(MEM_dupallocN(orig_grid->disps)); } if (orig_grid_paint_masks != nullptr) { GridPaintMask *orig_paint_mask_grid = &orig_grid_paint_masks[grid_index]; diff --git a/source/blender/blenkernel/intern/multires_unsubdivide.cc b/source/blender/blenkernel/intern/multires_unsubdivide.cc index 658977ec587..86c3aa125c4 100644 --- a/source/blender/blenkernel/intern/multires_unsubdivide.cc +++ b/source/blender/blenkernel/intern/multires_unsubdivide.cc @@ -650,7 +650,7 @@ static void store_grid_data(MultiresUnsubdivideContext *context, const int grid_size = CCG_grid_size(context->num_original_levels); const int face_grid_size = CCG_grid_size(context->num_original_levels + 1); const int face_grid_area = face_grid_size * face_grid_size; - float(*face_grid)[3] = MEM_calloc_arrayN(face_grid_area, "face_grid"); + float (*face_grid)[3] = MEM_calloc_arrayN(face_grid_area, "face_grid"); for (int i = 0; i < face.size(); i++) { const int loop_index = face[i]; @@ -1178,7 +1178,7 @@ static void multires_create_grids_in_unsubdivided_base_mesh(MultiresUnsubdivideC /* Allocate the MDISPS grids and copy the extracted data from context. */ for (int i = 0; i < totloop; i++) { - float(*disps)[3] = MEM_calloc_arrayN(totdisp, __func__); + float (*disps)[3] = MEM_calloc_arrayN(totdisp, __func__); if (mdisps[i].disps) { MEM_freeN(mdisps[i].disps); diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 73fba5900c4..f3a9a42a57b 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -2735,7 +2735,7 @@ void BKE_object_obdata_size_init(Object *ob, const float size) unit_m4(mat); scale_m4_fl(mat, size); - BKE_lattice_transform(lt, (float(*)[4])mat, false); + BKE_lattice_transform(lt, (float (*)[4])mat, false); break; } } @@ -3160,7 +3160,7 @@ static void give_parvert(const Object *par, int nr, float vec[3], const bool use DispList *dl = par->runtime->curve_cache ? BKE_displist_find(&par->runtime->curve_cache->disp, DL_VERTS) : nullptr; - float(*co)[3] = dl ? (float(*)[3])dl->verts : nullptr; + float (*co)[3] = dl ? (float (*)[3])dl->verts : nullptr; int tot; if (latt->editlatt) { diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc index 7123e3d5ade..88fd5760dd5 100644 --- a/source/blender/blenkernel/intern/object_dupli.cc +++ b/source/blender/blenkernel/intern/object_dupli.cc @@ -213,7 +213,7 @@ static bool copy_dupli_context(DupliContext *r_ctx, r_ctx->object = ob; r_ctx->instance_stack = ctx->instance_stack; if (mat) { - mul_m4_m4m4(r_ctx->space_mat, (float(*)[4])ctx->space_mat, mat); + mul_m4_m4m4(r_ctx->space_mat, (float (*)[4])ctx->space_mat, mat); } r_ctx->persistent_id[r_ctx->level] = index; r_ctx->instance_idx[r_ctx->level] = instance_index; @@ -279,7 +279,7 @@ static DupliObject *make_dupli(const DupliContext *ctx, dob->ob = ob; dob->ob_data = const_cast(object_data); - mul_m4_m4m4(dob->mat, (float(*)[4])ctx->space_mat, mat); + mul_m4_m4m4(dob->mat, (float (*)[4])ctx->space_mat, mat); dob->type = ctx->gen == nullptr ? 0 : ctx->dupli_gen_type_stack->last(); dob->preview_base_geometry = ctx->preview_base_geometry; dob->preview_instance_index = ctx->preview_instance_index; @@ -779,7 +779,7 @@ static void make_duplis_verts(const DupliContext *ctx) vdd.totvert = mesh_eval->verts_num; vdd.vert_positions = mesh_eval->vert_positions(); vdd.vert_normals = mesh_eval->vert_normals(); - vdd.orco = (const float(*)[3])CustomData_get_layer(&mesh_eval->vert_data, CD_ORCO); + vdd.orco = (const float (*)[3])CustomData_get_layer(&mesh_eval->vert_data, CD_ORCO); make_child_duplis(ctx, &vdd, make_child_duplis_verts_from_mesh); } @@ -1149,7 +1149,7 @@ static void get_dupliface_transform_from_coords(Span coords, /* Scale. */ float scale; if (use_scale) { - const float area = area_poly_v3((const float(*)[3])coords.data(), uint(coords.size())); + const float area = area_poly_v3((const float (*)[3])coords.data(), uint(coords.size())); scale = sqrtf(area) * scale_fac; } else { @@ -1255,7 +1255,7 @@ static void make_child_duplis_faces_from_mesh(const DupliContext *ctx, Object *inst_ob) { FaceDupliData_Mesh *fdd = (FaceDupliData_Mesh *)userdata; - const float(*orco)[3] = fdd->orco; + const float (*orco)[3] = fdd->orco; const float2 *uv_map = fdd->uv_map; const int totface = fdd->totface; const bool use_scale = fdd->params.use_scale; @@ -1371,7 +1371,7 @@ static void make_duplis_faces(const DupliContext *ctx) fdd.uv_map = (uv_idx != -1) ? (const float2 *)CustomData_get_layer_n( &mesh_eval->corner_data, CD_PROP_FLOAT2, uv_idx) : nullptr; - fdd.orco = (const float(*)[3])CustomData_get_layer(&mesh_eval->vert_data, CD_ORCO); + fdd.orco = (const float (*)[3])CustomData_get_layer(&mesh_eval->vert_data, CD_ORCO); make_child_duplis(ctx, &fdd, make_child_duplis_faces_from_mesh); } diff --git a/source/blender/blenkernel/intern/particle.cc b/source/blender/blenkernel/intern/particle.cc index 7367d7d6ca1..7f77a3bb1c6 100644 --- a/source/blender/blenkernel/intern/particle.cc +++ b/source/blender/blenkernel/intern/particle.cc @@ -1716,7 +1716,7 @@ void psys_interpolate_face(Mesh *mesh, else { interp_v3_v3v3v3(orco, o1, o2, o3, w); } - BKE_mesh_orco_verts_transform(mesh, (float(*)[3])orco, 1, true); + BKE_mesh_orco_verts_transform(mesh, (float (*)[3])orco, 1, true); } else { copy_v3_v3(orco, vec); @@ -1841,7 +1841,7 @@ int psys_particle_dm_face_lookup(Mesh *mesh_final, const OrigSpaceFace *osface_final; int pindex_orig; float uv[2]; - const float(*faceuv)[2]; + const float (*faceuv)[2]; const int *index_mf_to_mpoly_deformed = nullptr; const int *index_mf_to_mpoly = nullptr; @@ -2031,7 +2031,7 @@ void psys_particle_on_dm(Mesh *mesh_final, float orco[3]) { float tmpnor[3], mapfw[4]; - const float(*orcodata)[3]; + const float (*orcodata)[3]; int mapindex; if (!psys_map_index_on_dm(mesh_final, from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) @@ -2056,7 +2056,8 @@ void psys_particle_on_dm(Mesh *mesh_final, return; } - orcodata = static_cast(CustomData_get_layer(&mesh_final->vert_data, CD_ORCO)); + orcodata = static_cast( + CustomData_get_layer(&mesh_final->vert_data, CD_ORCO)); const blender::Span vert_normals = mesh_final->vert_normals(); if (from == PART_FROM_VERT) { @@ -2070,7 +2071,7 @@ void psys_particle_on_dm(Mesh *mesh_final, if (orco) { if (orcodata) { copy_v3_v3(orco, orcodata[mapindex]); - BKE_mesh_orco_verts_transform(mesh_final, (float(*)[3])orco, 1, true); + BKE_mesh_orco_verts_transform(mesh_final, (float (*)[3])orco, 1, true); } else { copy_v3_v3(orco, vec); @@ -2099,8 +2100,8 @@ void psys_particle_on_dm(Mesh *mesh_final, if (from == PART_FROM_VOLUME) { psys_interpolate_face(mesh_final, - reinterpret_cast(vert_positions.data()), - reinterpret_cast(vert_normals.data()), + reinterpret_cast(vert_positions.data()), + reinterpret_cast(vert_normals.data()), mface, mtface, orcodata, @@ -2122,8 +2123,8 @@ void psys_particle_on_dm(Mesh *mesh_final, } else { psys_interpolate_face(mesh_final, - reinterpret_cast(vert_positions.data()), - reinterpret_cast(vert_normals.data()), + reinterpret_cast(vert_positions.data()), + reinterpret_cast(vert_normals.data()), mface, mtface, orcodata, @@ -3803,7 +3804,7 @@ static void psys_face_mat(Object *ob, Mesh *mesh, ParticleData *pa, float mat[4] { float v[3][3]; MFace *mface; - const float(*orcodata)[3]; + const float (*orcodata)[3]; int i = ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND) ? pa->num : pa->num_dmcache; if (i == -1 || i >= mesh->totface_legacy) { @@ -3817,8 +3818,8 @@ static void psys_face_mat(Object *ob, Mesh *mesh, ParticleData *pa, float mat[4] const OrigSpaceFace *osface = static_cast( CustomData_get_for_write(&mesh->fdata_legacy, i, CD_ORIGSPACE, mesh->totface_legacy)); - if (orco && - (orcodata = static_cast(CustomData_get_layer(&mesh->vert_data, CD_ORCO)))) + if (orco && (orcodata = static_cast( + CustomData_get_layer(&mesh->vert_data, CD_ORCO)))) { copy_v3_v3(v[0], orcodata[mface->v1]); copy_v3_v3(v[1], orcodata[mface->v2]); diff --git a/source/blender/blenkernel/intern/particle_distribute.cc b/source/blender/blenkernel/intern/particle_distribute.cc index e06231ff957..1512a352f4a 100644 --- a/source/blender/blenkernel/intern/particle_distribute.cc +++ b/source/blender/blenkernel/intern/particle_distribute.cc @@ -370,9 +370,9 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount) jit2 = MEM_malloc_arrayN(3 + 2 * size_t(num), "initjit"); for (i = 0; i < 4; i++) { - BLI_jitterate1((float(*)[2])jit, (float(*)[2])jit2, num, rad1); - BLI_jitterate1((float(*)[2])jit, (float(*)[2])jit2, num, rad1); - BLI_jitterate2((float(*)[2])jit, (float(*)[2])jit2, num, rad2); + BLI_jitterate1((float (*)[2])jit, (float (*)[2])jit2, num, rad1); + BLI_jitterate1((float (*)[2])jit, (float (*)[2])jit2, num, rad1); + BLI_jitterate2((float (*)[2])jit, (float (*)[2])jit2, num, rad2); } MEM_freeN(jit2); BLI_rng_free(rng); @@ -617,8 +617,8 @@ static void distribute_from_volume_exec(ParticleTask *thread, ParticleData *pa, tot = mesh->totface_legacy; psys_interpolate_face(mesh, - reinterpret_cast(positions.data()), - reinterpret_cast(mesh->vert_normals().data()), + reinterpret_cast(positions.data()), + reinterpret_cast(mesh->vert_normals().data()), mface, nullptr, nullptr, @@ -1020,7 +1020,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, if (from == PART_FROM_VERT) { const blender::Span positions = mesh->vert_positions(); - const float(*orcodata)[3] = static_cast( + const float (*orcodata)[3] = static_cast( CustomData_get_layer(&mesh->vert_data, CD_ORCO)); int totvert = mesh->verts_num; @@ -1068,9 +1068,9 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, /* Calculate weights from face areas */ if ((part->flag & PART_EDISTR || children) && from != PART_FROM_VERT) { float totarea = 0.0f, co1[3], co2[3], co3[3], co4[3]; - const float(*orcodata)[3]; + const float (*orcodata)[3]; - orcodata = static_cast(CustomData_get_layer(&mesh->vert_data, CD_ORCO)); + orcodata = static_cast(CustomData_get_layer(&mesh->vert_data, CD_ORCO)); MFace *mfaces = (MFace *)CustomData_get_layer_for_write( &mesh->fdata_legacy, CD_MFACE, mesh->totface_legacy); diff --git a/source/blender/blenkernel/intern/particle_system.cc b/source/blender/blenkernel/intern/particle_system.cc index b5275d03705..ea1fdb8516f 100644 --- a/source/blender/blenkernel/intern/particle_system.cc +++ b/source/blender/blenkernel/intern/particle_system.cc @@ -1404,10 +1404,7 @@ static void integrate_particle( { #define ZERO_F43 \ { \ - {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, \ - { \ - 0.0f, 0.0f, 0.0f \ - } \ + {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} \ } ParticleKey states[5]; @@ -2784,8 +2781,8 @@ void BKE_psys_collision_neartest_cb(void *userdata, ParticleCollision *col = (ParticleCollision *)userdata; ParticleCollisionElement pce; const blender::int3 vert_tri = &col->md->vert_tris[index]; - float(*x)[3] = col->md->x; - float(*v)[3] = col->md->current_v; + float (*x)[3] = col->md->x; + float (*v)[3] = col->md->current_v; float t = hit->dist / col->original_ray_length; int collision = 0; @@ -3508,7 +3505,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim) sim->scene, sim->ob, psys->hair_in_mesh, - reinterpret_cast(psys->hair_out_mesh->vert_positions_for_write().data())); + reinterpret_cast(psys->hair_out_mesh->vert_positions_for_write().data())); psys->hair_out_mesh->tag_positions_changed(); /* restore cloth effector weights */ diff --git a/source/blender/blenkernel/intern/rigidbody.cc b/source/blender/blenkernel/intern/rigidbody.cc index 15936078dc5..d7f061a1c23 100644 --- a/source/blender/blenkernel/intern/rigidbody.cc +++ b/source/blender/blenkernel/intern/rigidbody.cc @@ -285,12 +285,12 @@ static rbCollisionShape *rigidbody_get_shape_convexhull_from_mesh(Object *ob, { rbCollisionShape *shape = nullptr; const Mesh *mesh = nullptr; - const float(*positions)[3] = nullptr; + const float (*positions)[3] = nullptr; int totvert = 0; if (ob->type == OB_MESH && ob->data) { mesh = rigidbody_get_mesh(ob); - positions = (mesh) ? reinterpret_cast(mesh->vert_positions().data()) : + positions = (mesh) ? reinterpret_cast(mesh->vert_positions().data()) : nullptr; totvert = (mesh) ? mesh->verts_num : 0; } @@ -600,7 +600,7 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol) const blender::Span corner_verts = mesh->corner_verts(); if (!positions.is_empty() && !corner_tris.is_empty()) { - BKE_mesh_calc_volume(reinterpret_cast(positions.data()), + BKE_mesh_calc_volume(reinterpret_cast(positions.data()), positions.size(), corner_tris.data(), corner_tris.size(), @@ -673,7 +673,7 @@ void BKE_rigidbody_calc_center_of_mass(Object *ob, float r_center[3]) const blender::Span corner_tris = mesh->corner_tris(); if (!positions.is_empty() && !corner_tris.is_empty()) { - BKE_mesh_calc_volume(reinterpret_cast(positions.data()), + BKE_mesh_calc_volume(reinterpret_cast(positions.data()), positions.size(), corner_tris.data(), corner_tris.size(), @@ -1675,7 +1675,7 @@ static void rigidbody_update_sim_ob(Depsgraph *depsgraph, Object *ob, RigidBodyO if (rbo->shape == RB_SHAPE_TRIMESH && rbo->flag & RBO_FLAG_USE_DEFORM) { const Mesh *mesh = BKE_object_get_mesh_deform_eval(ob); if (mesh) { - const float(*positions)[3] = reinterpret_cast( + const float (*positions)[3] = reinterpret_cast( mesh->vert_positions().data()); int totvert = mesh->verts_num; const std::optional> bounds = BKE_object_boundbox_get(ob); diff --git a/source/blender/blenkernel/intern/shrinkwrap.cc b/source/blender/blenkernel/intern/shrinkwrap.cc index b531b1d8402..f8d2bb2f440 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.cc +++ b/source/blender/blenkernel/intern/shrinkwrap.cc @@ -1417,13 +1417,13 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, if (mesh != nullptr && smd->shrinkType == MOD_SHRINKWRAP_PROJECT) { /* Setup arrays to get vertex positions, normals and deform weights */ - calc.vert_positions = reinterpret_cast(mesh->vert_positions_for_write().data()); + calc.vert_positions = reinterpret_cast(mesh->vert_positions_for_write().data()); calc.vert_normals = mesh->vert_normals(); /* Using vertices positions/normals as if a subsurface was applied */ if (smd->subsurfLevels) { subdivided_positions = shrinkwrap_calc_subdivided_positions(mesh, smd->subsurfLevels); - calc.vert_positions = reinterpret_cast(subdivided_positions.data()); + calc.vert_positions = reinterpret_cast(subdivided_positions.data()); } } @@ -1477,7 +1477,7 @@ void shrinkwrapParams_deform(const ShrinkwrapParams ¶ms, calc.smd = &smd; calc.ob = &object; calc.numVerts = int(positions.size()); - calc.vertexCos = reinterpret_cast(positions.data()); + calc.vertexCos = reinterpret_cast(positions.data()); calc.dvert = dvert.is_empty() ? nullptr : dvert.data(); calc.vgroup = defgrp_index; calc.invert_vgroup = params.invert_vertex_weights; @@ -1525,7 +1525,7 @@ void BKE_shrinkwrap_mesh_nearest_surface_deform(Depsgraph *depsgraph, src_me, nullptr, -1, - reinterpret_cast(src_me->vert_positions_for_write().data()), + reinterpret_cast(src_me->vert_positions_for_write().data()), src_me->verts_num); src_me->tag_positions_changed(); } @@ -1549,12 +1549,12 @@ void BKE_shrinkwrap_remesh_target_project(Mesh *src_me, Mesh *target_me, Object calc.smd = &ssmd; calc.numVerts = src_me->verts_num; - calc.vertexCos = reinterpret_cast(src_me->vert_positions_for_write().data()); + calc.vertexCos = reinterpret_cast(src_me->vert_positions_for_write().data()); calc.vert_normals = src_me->vert_normals(); calc.vgroup = -1; calc.target = target_me; calc.keepDist = ssmd.keepDist; - calc.vert_positions = reinterpret_cast(src_me->vert_positions_for_write().data()); + calc.vert_positions = reinterpret_cast(src_me->vert_positions_for_write().data()); BLI_SPACE_TRANSFORM_SETUP(&calc.local2target, ob_target, ob_target); ShrinkwrapTreeData tree; diff --git a/source/blender/blenkernel/intern/softbody.cc b/source/blender/blenkernel/intern/softbody.cc index 9753cd7fe02..fe19d4b4c3a 100644 --- a/source/blender/blenkernel/intern/softbody.cc +++ b/source/blender/blenkernel/intern/softbody.cc @@ -298,7 +298,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) hull = max_ff(ob->pd->pdef_sbift, ob->pd->pdef_sboft); /* Allocate and copy verts. */ - pccd_M->vert_positions = static_cast(MEM_dupallocN(cmd->xnew)); + pccd_M->vert_positions = static_cast(MEM_dupallocN(cmd->xnew)); /* note that xnew coords are already in global space, */ /* determine the ortho BB */ for (i = 0; i < pccd_M->mvert_num; i++) { @@ -387,7 +387,7 @@ static void ccd_mesh_update(Object *ob, ccd_Mesh *pccd_M) } pccd_M->vert_positions_prev = pccd_M->vert_positions; /* Allocate and copy verts. */ - pccd_M->vert_positions = static_cast(MEM_dupallocN(cmd->xnew)); + pccd_M->vert_positions = static_cast(MEM_dupallocN(cmd->xnew)); /* note that xnew coords are already in global space, */ /* determine the ortho BB */ for (i = 0; i < pccd_M->mvert_num; i++) { @@ -754,7 +754,7 @@ static void build_bps_springlist(Object *ob) add_bp_springlist(bp, sb->totspring - b); } } /* For springs. */ - } /* For bp. */ + } /* For bp. */ } static void calculate_collision_balls(Object *ob) @@ -1064,8 +1064,8 @@ static int sb_detect_face_pointCached(const float face_v1[3], { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { - const float(*vert_positions)[3] = nullptr; - const float(*vert_positions_prev)[3] = nullptr; + const float (*vert_positions)[3] = nullptr; + const float (*vert_positions_prev)[3] = nullptr; if (ccdm) { vert_positions = ccdm->vert_positions; a = ccdm->mvert_num; @@ -1117,8 +1117,8 @@ static int sb_detect_face_pointCached(const float face_v1[3], } a--; } /* while (a) */ - } /* if (vert_positions) */ - } /* if (ob->pd && ob->pd->deflect) */ + } /* if (vert_positions) */ + } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); } } /* while () */ @@ -1157,8 +1157,8 @@ static int sb_detect_face_collisionCached(const float face_v1[3], { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { - const float(*vert_positions)[3] = nullptr; - const float(*vert_positions_prev)[3] = nullptr; + const float (*vert_positions)[3] = nullptr; + const float (*vert_positions_prev)[3] = nullptr; const blender::int3 *vt = nullptr; const CCDF_MinMax *mima = nullptr; @@ -1230,7 +1230,7 @@ static int sb_detect_face_collisionCached(const float face_v1[3], mima++; vt++; } /* while a */ - } /* if (ob->pd && ob->pd->deflect) */ + } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); } } /* while () */ @@ -1338,8 +1338,8 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3], { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { - const float(*vert_positions)[3] = nullptr; - const float(*vert_positions_prev)[3] = nullptr; + const float (*vert_positions)[3] = nullptr; + const float (*vert_positions_prev)[3] = nullptr; const blender::int3 *vt = nullptr; const CCDF_MinMax *mima = nullptr; @@ -1417,7 +1417,7 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3], mima++; vt++; } /* while a */ - } /* if (ob->pd && ob->pd->deflect) */ + } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); } } /* while () */ @@ -1640,8 +1640,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { - const float(*vert_positions)[3] = nullptr; - const float(*vert_positions_prev)[3] = nullptr; + const float (*vert_positions)[3] = nullptr; + const float (*vert_positions_prev)[3] = nullptr; const blender::int3 *vt = nullptr; const CCDF_MinMax *mima = nullptr; @@ -1761,7 +1761,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], mima++; vt++; } /* while a */ - } /* if (ob->pd && ob->pd->deflect) */ + } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); } } /* while () */ @@ -2160,11 +2160,11 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, // sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float forcetime) sb_spring_force(ob, ilast - bb, bs, iks, forcetime); } /* loop springs. */ - } /* existing spring list. */ - } /* Any edges. */ + } /* existing spring list. */ + } /* Any edges. */ /* ---springs */ - } /* Omit on snap. */ - } /* Loop all bp's. */ + } /* Omit on snap. */ + } /* Loop all bp's. */ return 0; /* Done fine. */ } @@ -3240,8 +3240,8 @@ void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float ls BodyPoint *bp; ReferenceVert *rp; SoftBody *sb = nullptr; - float(*opos)[3]; - float(*rpos)[3]; + float (*opos)[3]; + float (*rpos)[3]; float com[3], rcom[3]; int a; diff --git a/source/blender/blenkernel/intern/studiolight.cc b/source/blender/blenkernel/intern/studiolight.cc index 8c4930d4dcf..5c2328cd1f1 100644 --- a/source/blender/blenkernel/intern/studiolight.cc +++ b/source/blender/blenkernel/intern/studiolight.cc @@ -457,8 +457,8 @@ static void studiolight_create_matcap_gputexture(StudioLightImage *sli) const size_t ibuf_pixel_count = IMB_get_pixel_count(ibuf); float *gpu_matcap_3components = MEM_calloc_arrayN(3 * ibuf_pixel_count, __func__); - const float(*offset4)[4] = (const float(*)[4])ibuf->float_buffer.data; - float(*offset3)[3] = (float(*)[3])gpu_matcap_3components; + const float (*offset4)[4] = (const float (*)[4])ibuf->float_buffer.data; + float (*offset3)[3] = (float (*)[3])gpu_matcap_3components; for (size_t i = 0; i < ibuf_pixel_count; i++, offset4++, offset3++) { copy_v3_v3(*offset3, *offset4); } diff --git a/source/blender/blenkernel/intern/subdiv_eval.cc b/source/blender/blenkernel/intern/subdiv_eval.cc index 82307add42a..4307ec6d01f 100644 --- a/source/blender/blenkernel/intern/subdiv_eval.cc +++ b/source/blender/blenkernel/intern/subdiv_eval.cc @@ -131,7 +131,7 @@ static void set_face_varying_data_from_uv_task(void *__restrict userdata, FaceVaryingDataFromUVContext *ctx = static_cast(userdata); opensubdiv::TopologyRefinerImpl *topology_refiner = ctx->topology_refiner; const int layer_index = ctx->layer_index; - const float(*mluv)[2] = &ctx->uv_map[ctx->faces[face_index].start()]; + const float (*mluv)[2] = &ctx->uv_map[ctx->faces[face_index].start()]; /* TODO(sergey): OpenSubdiv's C-API converter can change winding of * loops of a face, need to watch for that, to prevent wrong UVs assigned. @@ -151,11 +151,11 @@ static void set_face_varying_data_from_uv(Subdiv *subdiv, opensubdiv::TopologyRefinerImpl *topology_refiner = subdiv->topology_refiner; OpenSubdiv_Evaluator *evaluator = subdiv->evaluator; const int num_faces = topology_refiner->base_level().GetNumFaces(); - const float(*mluv)[2] = uv_map; + const float (*mluv)[2] = uv_map; const int num_fvar_values = topology_refiner->base_level().GetNumFVarValues(layer_index); /* Use a temporary buffer so we do not upload UVs one at a time to the GPU. */ - float(*buffer)[2] = MEM_malloc_arrayN(size_t(num_fvar_values), __func__); + float (*buffer)[2] = MEM_malloc_arrayN(size_t(num_fvar_values), __func__); FaceVaryingDataFromUVContext ctx; ctx.topology_refiner = topology_refiner; @@ -179,9 +179,9 @@ static void set_face_varying_data_from_uv(Subdiv *subdiv, static void set_vertex_data_from_orco(Subdiv *subdiv, const Mesh *mesh) { - const float(*orco)[3] = static_cast( + const float (*orco)[3] = static_cast( CustomData_get_layer(&mesh->vert_data, CD_ORCO)); - const float(*cloth_orco)[3] = static_cast( + const float (*cloth_orco)[3] = static_cast( CustomData_get_layer(&mesh->vert_data, CD_CLOTH_ORCO)); if (orco || cloth_orco) { @@ -256,7 +256,7 @@ bool eval_refine_from_mesh(Subdiv *subdiv, /* Set face-varying data to UV maps. */ const int num_uv_layers = CustomData_number_of_layers(&mesh->corner_data, CD_PROP_FLOAT2); for (int layer_index = 0; layer_index < num_uv_layers; layer_index++) { - const float(*uv_map)[2] = static_cast( + const float (*uv_map)[2] = static_cast( CustomData_get_layer_n(&mesh->corner_data, CD_PROP_FLOAT2, layer_index)); set_face_varying_data_from_uv(subdiv, mesh, uv_map, layer_index); } diff --git a/source/blender/blenkernel/intern/subdiv_mesh.cc b/source/blender/blenkernel/intern/subdiv_mesh.cc index 10bb316c727..79aebb98af4 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.cc +++ b/source/blender/blenkernel/intern/subdiv_mesh.cc @@ -116,9 +116,9 @@ static void subdiv_mesh_ctx_cache_custom_data_layers(SubdivMeshContext *ctx) /* UV layers interpolation. */ subdiv_mesh_ctx_cache_uv_layers(ctx); /* Orco interpolation. */ - ctx->orco = static_cast( + ctx->orco = static_cast( CustomData_get_layer_for_write(&subdiv_mesh->vert_data, CD_ORCO, subdiv_mesh->verts_num)); - ctx->cloth_orco = static_cast(CustomData_get_layer_for_write( + ctx->cloth_orco = static_cast(CustomData_get_layer_for_write( &subdiv_mesh->vert_data, CD_CLOTH_ORCO, subdiv_mesh->verts_num)); } diff --git a/source/blender/blenkernel/intern/tracking.cc b/source/blender/blenkernel/intern/tracking.cc index 8423ffa86ec..f81aaec11ca 100644 --- a/source/blender/blenkernel/intern/tracking.cc +++ b/source/blender/blenkernel/intern/tracking.cc @@ -2823,7 +2823,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf, const MovieTrackingPlaneMarker *plane_marker) { /* Alias for corners, allowing shorter access to coordinates. */ - const float(*corners)[2] = plane_marker->corners; + const float (*corners)[2] = plane_marker->corners; /* Dimensions of the frame image in pixels. */ const int frame_width = frame_ibuf->x; diff --git a/source/blender/blenkernel/intern/tracking_stabilize.cc b/source/blender/blenkernel/intern/tracking_stabilize.cc index 1694da26df5..0712326b829 100644 --- a/source/blender/blenkernel/intern/tracking_stabilize.cc +++ b/source/blender/blenkernel/intern/tracking_stabilize.cc @@ -1301,7 +1301,7 @@ static void tracking_stabilize_frame_interpolation_cb(void *__restrict userdata, static_cast(userdata); ImBuf *ibuf = data->ibuf; ImBuf *tmpibuf = data->tmpibuf; - float(*mat)[4] = data->mat; + float (*mat)[4] = data->mat; float vec[3] = {0.0f, float(y), 0.0f}; float rvec[3]; diff --git a/source/blender/blenkernel/intern/volume_render.cc b/source/blender/blenkernel/intern/volume_render.cc index 5a635a9cf63..8bfc26e9cea 100644 --- a/source/blender/blenkernel/intern/volume_render.cc +++ b/source/blender/blenkernel/intern/volume_render.cc @@ -372,8 +372,8 @@ void BKE_volume_grid_wireframe(const Volume *volume, boxes_to_edge_mesh({box}, grid.transform(), verts, edges); } cb(cb_userdata, - (float(*)[3])verts.data(), - (int(*)[2])edges.data(), + (float (*)[3])verts.data(), + (int (*)[2])edges.data(), verts.size(), edges.size()); } @@ -395,8 +395,8 @@ void BKE_volume_grid_wireframe(const Volume *volume, } cb(cb_userdata, - (float(*)[3])verts.data(), - (int(*)[2])edges.data(), + (float (*)[3])verts.data(), + (int (*)[2])edges.data(), verts.size(), edges.size()); } @@ -453,7 +453,7 @@ void BKE_volume_grid_selection_surface(const Volume * /*volume*/, const float offset_factor = 0.01f; grow_triangles(verts, tris, offset_factor); - cb(cb_userdata, (float(*)[3])verts.data(), (int(*)[3])tris.data(), verts.size(), tris.size()); + cb(cb_userdata, (float (*)[3])verts.data(), (int (*)[3])tris.data(), verts.size(), tris.size()); #else UNUSED_VARS(volume_grid); cb(cb_userdata, nullptr, nullptr, 0, 0); diff --git a/source/blender/blenlib/BLI_index_mask.hh b/source/blender/blenlib/BLI_index_mask.hh index 8b36e762d29..19bcb3011d7 100644 --- a/source/blender/blenlib/BLI_index_mask.hh +++ b/source/blender/blenlib/BLI_index_mask.hh @@ -850,8 +850,7 @@ template #if (defined(__GNUC__) && !defined(__clang__)) [[gnu::optimize("O3")]] #endif -inline void -optimized_foreach_index(const IndexMaskSegment segment, const Fn fn) +inline void optimized_foreach_index(const IndexMaskSegment segment, const Fn fn) { BLI_assert(segment.last() < std::numeric_limits::max()); if (unique_sorted_indices::non_empty_is_range(segment.base_span())) { @@ -872,10 +871,9 @@ template #if (defined(__GNUC__) && !defined(__clang__)) [[gnu::optimize("O3")]] #endif -inline void -optimized_foreach_index_with_pos(const IndexMaskSegment segment, - const int64_t segment_pos, - const Fn fn) +inline void optimized_foreach_index_with_pos(const IndexMaskSegment segment, + const int64_t segment_pos, + const Fn fn) { BLI_assert(segment.last() < std::numeric_limits::max()); BLI_assert(segment.size() + segment_pos < std::numeric_limits::max()); diff --git a/source/blender/blenlib/BLI_math_angle_types.hh b/source/blender/blenlib/BLI_math_angle_types.hh index 2ab008eb29d..0a726ba853a 100644 --- a/source/blender/blenlib/BLI_math_angle_types.hh +++ b/source/blender/blenlib/BLI_math_angle_types.hh @@ -38,8 +38,8 @@ template struct AngleRadianBase { public: AngleRadianBase() = default; - AngleRadianBase(const T &radian) : value_(radian){}; - explicit AngleRadianBase(const T &cos, const T &sin) : value_(math::atan2(sin, cos)){}; + AngleRadianBase(const T &radian) : value_(radian) {}; + explicit AngleRadianBase(const T &cos, const T &sin) : value_(math::atan2(sin, cos)) {}; /** Static functions. */ @@ -184,9 +184,9 @@ template struct AngleCartesianBase { * Create an angle from a radian value. */ explicit AngleCartesianBase(const T &radian) - : AngleCartesianBase(math::cos(radian), math::sin(radian)){}; + : AngleCartesianBase(math::cos(radian), math::sin(radian)) {}; explicit AngleCartesianBase(const AngleRadianBase &angle) - : AngleCartesianBase(math::cos(angle.radian()), math::sin(angle.radian())){}; + : AngleCartesianBase(math::cos(angle.radian()), math::sin(angle.radian())) {}; /** Static functions. */ @@ -385,7 +385,7 @@ template struct AngleFraction { * fractions. */ AngleFraction(int64_t numerator, int64_t denominator = 1) - : numerator_(numerator), denominator_(denominator){}; + : numerator_(numerator), denominator_(denominator) {}; public: /** Static functions. */ diff --git a/source/blender/blenlib/BLI_math_basis_types.hh b/source/blender/blenlib/BLI_math_basis_types.hh index f418eaf053c..668f0ba76be 100644 --- a/source/blender/blenlib/BLI_math_basis_types.hh +++ b/source/blender/blenlib/BLI_math_basis_types.hh @@ -58,7 +58,7 @@ class Axis { public: Axis() = default; - constexpr Axis(const Value axis) : axis_(axis){}; + constexpr Axis(const Value axis) : axis_(axis) {}; /** Convert an uppercase axis character 'X', 'Y' or 'Z' to an enum value. */ constexpr static Axis from_char(char axis_char) @@ -124,8 +124,8 @@ class AxisSigned { public: AxisSigned() = default; - constexpr AxisSigned(Value axis) : axis_(axis){}; - constexpr AxisSigned(Axis axis) : axis_(from_int(axis.as_int())){}; + constexpr AxisSigned(Value axis) : axis_(axis) {}; + constexpr AxisSigned(Axis axis) : axis_(from_int(axis.as_int())) {}; /** Allow casting from DNA enums stored as short / int. */ constexpr static AxisSigned from_int(int axis_int) diff --git a/source/blender/blenlib/BLI_math_euler_types.hh b/source/blender/blenlib/BLI_math_euler_types.hh index af06c500226..a75c4b1bd6f 100644 --- a/source/blender/blenlib/BLI_math_euler_types.hh +++ b/source/blender/blenlib/BLI_math_euler_types.hh @@ -64,11 +64,11 @@ template struct EulerBase { EulerBase() = default; - EulerBase(const AngleT &x, const AngleT &y, const AngleT &z) : xyz_(x, y, z){}; + EulerBase(const AngleT &x, const AngleT &y, const AngleT &z) : xyz_(x, y, z) {}; - EulerBase(const VecBase &vec) : xyz_(vec){}; + EulerBase(const VecBase &vec) : xyz_(vec) {}; - EulerBase(const VecBase &vec) : xyz_(vec.x, vec.y, vec.z){}; + EulerBase(const VecBase &vec) : xyz_(vec.x, vec.y, vec.z) {}; public: /** Static functions. */ @@ -144,7 +144,7 @@ template struct EulerXYZBase : public EulerBase { */ template EulerXYZBase(const VecBase &vec) : EulerBase(vec){}; - EulerXYZBase(const AngleT &x, const AngleT &y, const AngleT &z) : EulerBase(x, y, z){}; + EulerXYZBase(const AngleT &x, const AngleT &y, const AngleT &z) : EulerBase(x, y, z) {}; /** * Create a rotation from an basis axis and an angle. @@ -216,7 +216,7 @@ template struct Euler3Base : public EulerBase { Euler3Base &eul_; public: - explicit Swizzle(Euler3Base &eul) : eul_(eul){}; + explicit Swizzle(Euler3Base &eul) : eul_(eul) {}; Euler3Base &operator=(const VecBase &angles) { @@ -250,7 +250,7 @@ template struct Euler3Base : public EulerBase { : EulerBase(angles_xyz), order_(order){}; Euler3Base(const AngleT &x, const AngleT &y, const AngleT &z, EulerOrder order) - : EulerBase(x, y, z), order_(order){}; + : EulerBase(x, y, z), order_(order) {}; /** * Create a rotation around a single euler axis and an angle. @@ -264,7 +264,7 @@ template struct Euler3Base : public EulerBase { * Defines rotation order but not the rotation values. * Used for conversion from other rotation types. */ - Euler3Base(EulerOrder order) : order_(order){}; + Euler3Base(EulerOrder order) : order_(order) {}; /** Methods. */ diff --git a/source/blender/blenlib/BLI_math_matrix_types.hh b/source/blender/blenlib/BLI_math_matrix_types.hh index cfb20a11cac..92a1241001a 100644 --- a/source/blender/blenlib/BLI_math_matrix_types.hh +++ b/source/blender/blenlib/BLI_math_matrix_types.hh @@ -525,7 +525,7 @@ struct MatView : NonCopyable, NonMovable { /** Allow wrapping C-style matrices using view. IMPORTANT: Alignment of src needs to match. */ explicit MatView(const float (*src)[SrcNumRow]) - : MatView(*reinterpret_cast(&src[0][0])){}; + : MatView(*reinterpret_cast(&src[0][0])) {}; /** Array access. */ @@ -720,11 +720,11 @@ struct MutableMatView public: MutableMatView() = delete; - MutableMatView(SrcMatT &src) : MatViewT(const_cast(src)){}; + MutableMatView(SrcMatT &src) : MatViewT(const_cast(src)) {}; /** Allow wrapping C-style matrices using view. IMPORTANT: Alignment of src needs to match. */ explicit MutableMatView(float src[SrcNumCol][SrcNumRow]) - : MutableMatView(*reinterpret_cast(&src[0][0])){}; + : MutableMatView(*reinterpret_cast(&src[0][0])) {}; /** Array access. */ diff --git a/source/blender/blenlib/BLI_math_quaternion_types.hh b/source/blender/blenlib/BLI_math_quaternion_types.hh index c09d03ba60e..e4779aa36d6 100644 --- a/source/blender/blenlib/BLI_math_quaternion_types.hh +++ b/source/blender/blenlib/BLI_math_quaternion_types.hh @@ -40,19 +40,19 @@ template struct QuaternionBase { QuaternionBase() = default; QuaternionBase(const T &new_w, const T &new_x, const T &new_y, const T &new_z) - : w(new_w), x(new_x), y(new_y), z(new_z){}; + : w(new_w), x(new_x), y(new_y), z(new_z) {}; /** * Creates a quaternion from an vector without reordering the components. * \note Component order must follow the scalar constructor (w, x, y, z). */ - explicit QuaternionBase(const VecBase &vec) : QuaternionBase(UNPACK4(vec)){}; + explicit QuaternionBase(const VecBase &vec) : QuaternionBase(UNPACK4(vec)) {}; /** * Creates a quaternion from real (w) and imaginary parts (x, y, z). */ QuaternionBase(const T &real, const VecBase &imaginary) - : QuaternionBase(real, UNPACK3(imaginary)){}; + : QuaternionBase(real, UNPACK3(imaginary)) {}; /** Static functions. */ diff --git a/source/blender/blenlib/intern/BLI_heap.cc b/source/blender/blenlib/intern/BLI_heap.cc index 25142665d06..6e9a66013c3 100644 --- a/source/blender/blenlib/intern/BLI_heap.cc +++ b/source/blender/blenlib/intern/BLI_heap.cc @@ -60,7 +60,7 @@ struct Heap { /** \name Internal Functions * \{ */ -#define HEAP_PARENT(i) (((i)-1) >> 1) +#define HEAP_PARENT(i) (((i) - 1) >> 1) #define HEAP_LEFT(i) (((i) << 1) + 1) #define HEAP_RIGHT(i) (((i) << 1) + 2) #define HEAP_COMPARE(a, b) ((a)->value < (b)->value) diff --git a/source/blender/blenlib/intern/BLI_heap_simple.cc b/source/blender/blenlib/intern/BLI_heap_simple.cc index 3a5c4ed6a01..303858537cb 100644 --- a/source/blender/blenlib/intern/BLI_heap_simple.cc +++ b/source/blender/blenlib/intern/BLI_heap_simple.cc @@ -22,7 +22,7 @@ #include "BLI_strict_flags.h" /* IWYU pragma: keep. Keep last. */ -#define HEAP_PARENT(i) (((i)-1) >> 1) +#define HEAP_PARENT(i) (((i) - 1) >> 1) /* -------------------------------------------------------------------- */ /** \name HeapSimple Internal Structs diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.cc b/source/blender/blenlib/intern/BLI_kdopbvh.cc index 664d790e996..055fa8f1887 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.cc +++ b/source/blender/blenlib/intern/BLI_kdopbvh.cc @@ -226,7 +226,7 @@ MINLINE axis_t max_axis(axis_t a, axis_t b) static void node_minmax_init(const BVHTree *tree, BVHNode *node) { axis_t axis_iter; - float(*bv)[2] = (float(*)[2])node->bv; + float (*bv)[2] = (float (*)[2])node->bv; for (axis_iter = tree->start_axis; axis_iter != tree->stop_axis; axis_iter++) { bv[axis_iter][0] = FLT_MAX; diff --git a/source/blender/blenlib/intern/BLI_memarena.cc b/source/blender/blenlib/intern/BLI_memarena.cc index d043ec67939..2c0096ec72e 100644 --- a/source/blender/blenlib/intern/BLI_memarena.cc +++ b/source/blender/blenlib/intern/BLI_memarena.cc @@ -103,7 +103,7 @@ void BLI_memarena_free(MemArena *ma) } /** Pad num up by \a amt (must be power of two). */ -#define PADUP(num, amt) (((num) + ((amt)-1)) & ~((amt)-1)) +#define PADUP(num, amt) (((num) + ((amt) - 1)) & ~((amt) - 1)) /** Align alloc'ed memory (needed if `align > 8`). */ static void memarena_curbuf_align(MemArena *ma) diff --git a/source/blender/blenlib/intern/BLI_memiter.cc b/source/blender/blenlib/intern/BLI_memiter.cc index 5a482d7a921..6d4db7ae92d 100644 --- a/source/blender/blenlib/intern/BLI_memiter.cc +++ b/source/blender/blenlib/intern/BLI_memiter.cc @@ -50,7 +50,7 @@ using offset_t = intptr_t; // #define USE_TOTALLOC /* pad must be power of two */ -#define PADUP(num, pad) (((num) + ((pad)-1)) & ~((pad)-1)) +#define PADUP(num, pad) (((num) + ((pad) - 1)) & ~((pad) - 1)) struct BLI_memiter_elem { offset_t size; diff --git a/source/blender/blenlib/intern/BLI_mempool.cc b/source/blender/blenlib/intern/BLI_mempool.cc index 97a9b1fc41d..8caa8777606 100644 --- a/source/blender/blenlib/intern/BLI_mempool.cc +++ b/source/blender/blenlib/intern/BLI_mempool.cc @@ -130,7 +130,7 @@ struct BLI_mempool { ((BLI_freenode *)(CHECK_TYPE_INLINE(chunk, BLI_mempool_chunk *), (void *)((chunk) + 1))) #define NODE_STEP_NEXT(node) ((BLI_freenode *)((char *)(node) + esize)) -#define NODE_STEP_PREV(node) ((BLI_freenode *)((char *)(node)-esize)) +#define NODE_STEP_PREV(node) ((BLI_freenode *)((char *)(node) - esize)) /** Extra bytes implicitly used for every chunk alloc. */ #define CHUNK_OVERHEAD uint(MEM_SIZE_OVERHEAD + sizeof(BLI_mempool_chunk)) diff --git a/source/blender/blenlib/intern/array_store.cc b/source/blender/blenlib/intern/array_store.cc index 9fb6c61788d..74f6cad7f4a 100644 --- a/source/blender/blenlib/intern/array_store.cc +++ b/source/blender/blenlib/intern/array_store.cc @@ -180,8 +180,8 @@ struct BChunkList; */ #define USE_HASH_TABLE_KEY_CACHE #ifdef USE_HASH_TABLE_KEY_CACHE -# define HASH_TABLE_KEY_UNSET ((hash_key)-1) -# define HASH_TABLE_KEY_FALLBACK ((hash_key)-2) +# define HASH_TABLE_KEY_UNSET ((hash_key) - 1) +# define HASH_TABLE_KEY_FALLBACK ((hash_key) - 2) #endif /** diff --git a/source/blender/blenlib/intern/bitmap_draw_2d.cc b/source/blender/blenlib/intern/bitmap_draw_2d.cc index 16513c2dfea..62d40bc751a 100644 --- a/source/blender/blenlib/intern/bitmap_draw_2d.cc +++ b/source/blender/blenlib/intern/bitmap_draw_2d.cc @@ -285,7 +285,7 @@ void BLI_bitmap_draw_2d_tri_v2i( /* sort edge-segments on y, then x axis */ static int draw_poly_v2i_n__span_y_sort(const void *a_p, const void *b_p, void *verts_p) { - const int(*verts)[2] = static_cast(verts_p); + const int (*verts)[2] = static_cast(verts_p); const int *a = static_cast(a_p); const int *b = static_cast(b_p); const int *co_a = verts[a[0]]; @@ -328,7 +328,7 @@ void BLI_bitmap_draw_2d_poly_v2i_n(const int xmin, /* Originally by Darel Rex Finley, 2007. * Optimized by Campbell Barton, 2016 to track sorted intersections. */ - int(*span_y)[2] = MEM_malloc_arrayN(size_t(verts.size()), __func__); + int (*span_y)[2] = MEM_malloc_arrayN(size_t(verts.size()), __func__); int span_y_len = 0; for (int i_curr = 0, i_prev = int(verts.size() - 1); i_curr < verts.size(); i_prev = i_curr++) { diff --git a/source/blender/blenlib/intern/convexhull_2d.cc b/source/blender/blenlib/intern/convexhull_2d.cc index 509640517da..1cf1475ad5c 100644 --- a/source/blender/blenlib/intern/convexhull_2d.cc +++ b/source/blender/blenlib/intern/convexhull_2d.cc @@ -796,7 +796,7 @@ float BLI_convexhull_aabb_fit_points_2d(blender::Span points) int points_hull_num = BLI_convexhull_2d(points, index_map); if (points_hull_num > 1) { - float(*points_hull)[2] = MEM_malloc_arrayN(size_t(points_hull_num), __func__); + float (*points_hull)[2] = MEM_malloc_arrayN(size_t(points_hull_num), __func__); for (int j = 0; j < points_hull_num; j++) { copy_v2_v2(points_hull[j], points[index_map[j]]); } diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index dca00e3fee1..cfc1cefd4b9 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -512,7 +512,7 @@ template void cdt_draw(const std::string &label, const CDTArrangemen } double scale = view_width / width; -# define SX(x) (((x)-minx) * scale) +# define SX(x) (((x) - minx) * scale) # define SY(y) ((maxy - (y)) * scale) std::ofstream f; diff --git a/source/blender/blenlib/intern/jitter_2d.cc b/source/blender/blenlib/intern/jitter_2d.cc index 6fdd45ac8bb..61f9786fca7 100644 --- a/source/blender/blenlib/intern/jitter_2d.cc +++ b/source/blender/blenlib/intern/jitter_2d.cc @@ -126,7 +126,7 @@ void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float radius2) void BLI_jitter_init(float (*jitarr)[2], int num) { - float(*jit2)[2]; + float (*jit2)[2]; float number_fl, number_fl_sqrt; float x, rad1, rad2, rad3; RNG *rng; diff --git a/source/blender/blenlib/intern/kdtree_impl.h b/source/blender/blenlib/intern/kdtree_impl.h index 75b8d6d62f9..86021852e9c 100644 --- a/source/blender/blenlib/intern/kdtree_impl.h +++ b/source/blender/blenlib/intern/kdtree_impl.h @@ -55,13 +55,13 @@ struct KDTree { #define KD_NEAR_ALLOC_INC 100 /* alloc increment for collecting nearest */ #define KD_FOUND_ALLOC_INC 50 /* alloc increment for collecting nearest */ -#define KD_NODE_UNSET ((uint)-1) +#define KD_NODE_UNSET ((uint) - 1) /** * When set we know all values are unbalanced, * otherwise clear them when re-balancing: see #62210. */ -#define KD_NODE_ROOT_IS_INIT ((uint)-2) +#define KD_NODE_ROOT_IS_INIT ((uint) - 2) /* -------------------------------------------------------------------- */ /** \name Local Math API diff --git a/source/blender/blenlib/intern/lasso_2d.cc b/source/blender/blenlib/intern/lasso_2d.cc index 7b29099a538..78bff1adf63 100644 --- a/source/blender/blenlib/intern/lasso_2d.cc +++ b/source/blender/blenlib/intern/lasso_2d.cc @@ -51,7 +51,7 @@ bool BLI_lasso_is_point_inside(const Span mcoords, const int pt[2] = {sx, sy}; return isect_point_poly_v2_int( - pt, reinterpret_cast(mcoords.data()), uint(mcoords.size())); + pt, reinterpret_cast(mcoords.data()), uint(mcoords.size())); } bool BLI_lasso_is_edge_inside( diff --git a/source/blender/blenlib/intern/math_geom.cc b/source/blender/blenlib/intern/math_geom.cc index 0c3da4ca9b0..d0c97508fee 100644 --- a/source/blender/blenlib/intern/math_geom.cc +++ b/source/blender/blenlib/intern/math_geom.cc @@ -2313,7 +2313,7 @@ bool isect_tri_tri_v3_ex(const float tri_a[3][3], double isect_dir[3]; cross_v3_v3v3_db(isect_dir, plane_a, plane_b); for (int i = 0; i < 2; i++) { - const float(*tri)[3] = i == 0 ? tri_a : tri_b; + const float (*tri)[3] = i == 0 ? tri_a : tri_b; /* Rearrange the triangle so that the vertex that is alone on one side * of the plane is located at index 1. */ int tri_i[3]; diff --git a/source/blender/blenlib/intern/math_rotation_c.cc b/source/blender/blenlib/intern/math_rotation_c.cc index 176718c427b..02696406f1e 100644 --- a/source/blender/blenlib/intern/math_rotation_c.cc +++ b/source/blender/blenlib/intern/math_rotation_c.cc @@ -2090,7 +2090,7 @@ void add_weighted_dq_dq(DualQuat *dq_sum, const DualQuat *dq, float weight) weight = -weight; } - copy_m4_m4(wmat, (float(*)[4])dq->scale); + copy_m4_m4(wmat, (float (*)[4])dq->scale); mul_m4_fl(wmat, weight); add_m4_m4m4(dq_sum->scale, dq_sum->scale, wmat); dq_sum->scale_weight += weight; diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index 52cfd1fb802..62ad42e9c1b 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -716,7 +716,7 @@ struct BBCalcData { const IMesh &im; Array *face_bounding_box; - BBCalcData(const IMesh &im, Array *fbb) : im(im), face_bounding_box(fbb){}; + BBCalcData(const IMesh &im, Array *fbb) : im(im), face_bounding_box(fbb) {}; }; static void calc_face_bb_range_func(void *__restrict userdata, @@ -741,7 +741,7 @@ struct BBPadData { Array *face_bounding_box; double pad; - BBPadData(Array *fbb, double pad) : face_bounding_box(fbb), pad(pad){}; + BBPadData(Array *fbb, double pad) : face_bounding_box(fbb), pad(pad) {}; }; static void pad_face_bb_range_func(void *__restrict userdata, @@ -1944,7 +1944,7 @@ static Array polyfill_triangulate_poly(Face *f, IMeshArena *arena) } /* Project along negative face normal so (x,y) can be used in 2d. */ float axis_mat[3][3]; - float(*projverts)[2]; + float (*projverts)[2]; uint(*tris)[3]; const int totfilltri = flen - 2; /* Prepare projected vertices and array to receive triangles in tessellation. */ @@ -2846,8 +2846,7 @@ static IMesh remove_degenerate_tris(const IMesh &tm_in) IMesh trimesh_self_intersect(const IMesh &tm_in, IMeshArena *arena) { - return trimesh_nary_intersect( - tm_in, 1, [](int /*t*/) { return 0; }, true, arena); + return trimesh_nary_intersect(tm_in, 1, [](int /*t*/) { return 0; }, true, arena); } IMesh trimesh_nary_intersect(const IMesh &tm_in, diff --git a/source/blender/blenlib/intern/noise_c.cc b/source/blender/blenlib/intern/noise_c.cc index 16ffb2922e5..e9fdf0deb92 100644 --- a/source/blender/blenlib/intern/noise_c.cc +++ b/source/blender/blenlib/intern/noise_c.cc @@ -762,7 +762,7 @@ static const float g_perlin_data_v3[512 + 2][3] = { static float noise3_perlin(const float vec[3]) { const char *p = g_perlin_data_ub; - const float(*g)[3] = g_perlin_data_v3; + const float (*g)[3] = g_perlin_data_v3; int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; float rx0, rx1, ry0, ry1, rz0, rz1, sx, sy, sz, a, b, c, d, t, u, v; const float *q; diff --git a/source/blender/blenlib/intern/polyfill_2d.cc b/source/blender/blenlib/intern/polyfill_2d.cc index a96eb898dbc..54f99fb7e85 100644 --- a/source/blender/blenlib/intern/polyfill_2d.cc +++ b/source/blender/blenlib/intern/polyfill_2d.cc @@ -586,7 +586,7 @@ static void pf_triangulate(PolyFill *pf) static void pf_coord_sign_calc(const PolyFill *pf, PolyIndex *pi) { /* localize */ - const float(*coords)[2] = pf->coords; + const float (*coords)[2] = pf->coords; pi->sign = span_tri_v2_sign(coords[pi->prev->index], coords[pi->index], coords[pi->next->index]); } @@ -682,7 +682,7 @@ static bool pf_ear_tip_check(PolyFill *pf, PolyIndex *pi_ear_tip, const eSign si { #ifndef USE_KDTREE /* localize */ - const float(*coords)[2] = pf->coords; + const float (*coords)[2] = pf->coords; PolyIndex *pi_curr; const float *v1, *v2, *v3; diff --git a/source/blender/blenlib/intern/system_win32.cc b/source/blender/blenlib/intern/system_win32.cc index 41fd9232f2d..ce665199c6f 100644 --- a/source/blender/blenlib/intern/system_win32.cc +++ b/source/blender/blenlib/intern/system_win32.cc @@ -602,17 +602,15 @@ void BLI_windows_exception_show_dialog(const char *filepath_crashlog, std::wstring(filepath_crashlog_utf16); TASKDIALOGCONFIG config = {0}; - const TASKDIALOG_BUTTON buttons[] = { - {IDRETRY, L"Restart"}, + const TASKDIALOG_BUTTON buttons[] = {{IDRETRY, L"Restart"}, #if 0 /* This lead to a large influx of low quality reports on the tracker, * and has been disabled for that reason, we can re-enable this when * a better workflow has been established. */ {IDOK, L"Report a Bug"}, #endif - {IDHELP, L"View Crash Log"}, - {IDCLOSE, L"Close"} - }; + {IDHELP, L"View Crash Log"}, + {IDCLOSE, L"Close"}}; config.cbSize = sizeof(config); config.hwndParent = GetActiveWindow(); diff --git a/source/blender/blenlib/tests/BLI_convexhull_2d_test.cc b/source/blender/blenlib/tests/BLI_convexhull_2d_test.cc index 28e87e01573..91d9d35a4e0 100644 --- a/source/blender/blenlib/tests/BLI_convexhull_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_convexhull_2d_test.cc @@ -119,9 +119,9 @@ TEST(convexhull_2d, IsCCW) } blender::Array points_hull = convexhull_2d_as_array(points); - EXPECT_GE( - cross_poly_v2(reinterpret_cast(points_hull.data()), points_hull.size()), - 0.0f); + EXPECT_GE(cross_poly_v2(reinterpret_cast(points_hull.data()), + points_hull.size()), + 0.0f); } } @@ -297,7 +297,7 @@ TEST(convexhull_2d, Simple) /* The cross product must be positive or zero. */ EXPECT_GE( - cross_poly_v2(reinterpret_cast(points_hull.data()), points_indices_num), + cross_poly_v2(reinterpret_cast(points_hull.data()), points_indices_num), 0.0f); /* The first point is documented to be the lowest, check this is so. */ diff --git a/source/blender/blenlib/tests/BLI_kdopbvh_test.cc b/source/blender/blenlib/tests/BLI_kdopbvh_test.cc index 44b5c380025..687d66aaf8d 100644 --- a/source/blender/blenlib/tests/BLI_kdopbvh_test.cc +++ b/source/blender/blenlib/tests/BLI_kdopbvh_test.cc @@ -54,7 +54,7 @@ static void optimal_check_callback(void *userdata, const float co[3], BVHTreeNearest *nearest) { - float(*points)[3] = (float(*)[3])userdata; + float (*points)[3] = (float (*)[3])userdata; /* BVH_NEAREST_OPTIMAL_ORDER should hit the right node on the first try */ EXPECT_EQ(nearest->index, -1); @@ -75,7 +75,7 @@ static void find_nearest_points_test( BVHTree *tree = BLI_bvhtree_new(points_len, 0.0, 8, 8); void *mem = MEM_malloc_arrayN(size_t(points_len), __func__); - float(*points)[3] = (float(*)[3])mem; + float (*points)[3] = (float (*)[3])mem; for (int i = 0; i < points_len; i++) { rng_v3_round(points[i], 3, rng, round, scale); diff --git a/source/blender/blenlib/tests/BLI_math_geom_test.cc b/source/blender/blenlib/tests/BLI_math_geom_test.cc index be05cbc8745..7aec447c956 100644 --- a/source/blender/blenlib/tests/BLI_math_geom_test.cc +++ b/source/blender/blenlib/tests/BLI_math_geom_test.cc @@ -123,13 +123,13 @@ TEST(math_geom, CrossPoly) const float tri_ccw_2d[3][2] = {{1, 0}, {0, 1}, {-1, 0}}; const float tri_ccw_3d[3][3] = {{1, 0}, {0, 1}, {-1, 0}}; - auto cross_tri_v3_as_float3 = [](const float(*poly)[3]) -> float3 { + auto cross_tri_v3_as_float3 = [](const float (*poly)[3]) -> float3 { float n[3]; cross_tri_v3(n, UNPACK3(poly)); return float3(n[0], n[1], n[2]); }; - auto cross_poly_v3_as_float3 = [](const float(*poly)[3]) -> float3 { + auto cross_poly_v3_as_float3 = [](const float (*poly)[3]) -> float3 { float n[3]; cross_poly_v3(n, poly, 3); return float3(n[0], n[1], n[2]); diff --git a/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc b/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc index 9b706fcf45b..71548edefc8 100644 --- a/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc +++ b/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc @@ -115,7 +115,7 @@ TEST(math_matrix_types, TypeConversion) TEST(math_matrix_types, PointerArrayConversion) { float array[2][2] = {{1.0f, 2.0f}, {3.0f, 4.0f}}; - float(*ptr)[2] = array; + float (*ptr)[2] = array; float2x2 m2(ptr); EXPECT_EQ(m2[0][0], 1.0f); EXPECT_EQ(m2[0][1], 2.0f); diff --git a/source/blender/blenlib/tests/BLI_math_vector_types_test.cc b/source/blender/blenlib/tests/BLI_math_vector_types_test.cc index e4a728e5061..1adddfe3591 100644 --- a/source/blender/blenlib/tests/BLI_math_vector_types_test.cc +++ b/source/blender/blenlib/tests/BLI_math_vector_types_test.cc @@ -134,7 +134,7 @@ TEST(math_vec_types, PointerConversion) TEST(math_vec_types, PointerArrayConversion) { float array[1][3] = {{1.0f, 2.0f, 3.0f}}; - float(*ptr)[3] = array; + float (*ptr)[3] = array; float3 fptr(ptr); EXPECT_EQ(fptr[0], 1.0f); EXPECT_EQ(fptr[1], 2.0f); diff --git a/source/blender/blenlib/tests/BLI_memory_utils_test.cc b/source/blender/blenlib/tests/BLI_memory_utils_test.cc index 7acd26ee61c..c458b0d74a0 100644 --- a/source/blender/blenlib/tests/BLI_memory_utils_test.cc +++ b/source/blender/blenlib/tests/BLI_memory_utils_test.cc @@ -12,7 +12,7 @@ namespace blender::tests { class TestBaseClass { - virtual void mymethod(){}; + virtual void mymethod() {}; }; class TestChildClass : public TestBaseClass { diff --git a/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc b/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc index 015c87b2096..bd8e81af284 100644 --- a/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc +++ b/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc @@ -1017,8 +1017,7 @@ static void spheresphere_test(int nrings, double y_offset, bool use_self) } else { int nf = sphere_tris_num; - out = trimesh_nary_intersect( - mesh, 2, [nf](int t) { return t < nf ? 0 : 1; }, false, &arena); + out = trimesh_nary_intersect(mesh, 2, [nf](int t) { return t < nf ? 0 : 1; }, false, &arena); } double time_intersect = BLI_time_now_seconds(); std::cout << "Create time: " << time_create - time_start << "\n"; @@ -1162,8 +1161,7 @@ static void spheregrid_test(int nrings, int grid_level, double z_offset, bool us } else { int nf = sphere_tris_num; - out = trimesh_nary_intersect( - mesh, 2, [nf](int t) { return t < nf ? 0 : 1; }, false, &arena); + out = trimesh_nary_intersect(mesh, 2, [nf](int t) { return t < nf ? 0 : 1; }, false, &arena); } double time_intersect = BLI_time_now_seconds(); std::cout << "Create time: " << time_create - time_start << "\n"; @@ -1231,8 +1229,7 @@ static void gridgrid_test(int x_level_1, } else { int nf = grid_tris_1_num; - out = trimesh_nary_intersect( - mesh, 2, [nf](int t) { return t < nf ? 0 : 1; }, false, &arena); + out = trimesh_nary_intersect(mesh, 2, [nf](int t) { return t < nf ? 0 : 1; }, false, &arena); } double time_intersect = BLI_time_now_seconds(); std::cout << "Create time: " << time_create - time_start << "\n"; diff --git a/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc b/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc index d889e516268..1955df5856f 100644 --- a/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc @@ -238,7 +238,7 @@ static void test_polyfill_template_flip_sign(const char *id, uint tris[][3], const uint tris_num) { - float(*poly_copy)[2] = MEM_malloc_arrayN(poly_num, id); + float (*poly_copy)[2] = MEM_malloc_arrayN(poly_num, id); for (int flip_x = 0; flip_x < 2; flip_x++) { for (int flip_y = 0; flip_y < 2; flip_y++) { float sign_x = flip_x ? -1.0f : 1.0f; @@ -263,7 +263,7 @@ static void test_polyfill_template_main(const char *id, { /* overkill? - try at _every_ offset & reverse */ uint poly_reverse; - float(*poly_copy)[2] = MEM_malloc_arrayN(poly_num, id); + float (*poly_copy)[2] = MEM_malloc_arrayN(poly_num, id); float tmp[2]; memcpy(poly_copy, poly, sizeof(float[2]) * poly_num); @@ -395,7 +395,7 @@ static void polyfill_to_obj(const char *id, * \endcode */ -#define POLY_TRI_COUNT(len) ((len)-2) +#define POLY_TRI_COUNT(len) ((len) - 2) /* A counterclockwise triangle */ TEST(polyfill2d, TriangleCCW) diff --git a/source/blender/blenlib/tests/BLI_string_test.cc b/source/blender/blenlib/tests/BLI_string_test.cc index 1b71f6547c3..eef3533df9f 100644 --- a/source/blender/blenlib/tests/BLI_string_test.cc +++ b/source/blender/blenlib/tests/BLI_string_test.cc @@ -903,7 +903,7 @@ class StringFindSplitWords : public testing::Test { str.c_str(), max_length, ' ', - reinterpret_cast(actual_word_info.data()), + reinterpret_cast(actual_word_info.data()), effective_max_words); /* Schrink actual array to an actual number of words, so we can compare * vectors as-is. */ diff --git a/source/blender/blenloader/intern/versioning_280.cc b/source/blender/blenloader/intern/versioning_280.cc index 3b943619d87..0952e26a6e2 100644 --- a/source/blender/blenloader/intern/versioning_280.cc +++ b/source/blender/blenloader/intern/versioning_280.cc @@ -2488,7 +2488,7 @@ void do_versions_after_linking_280(FileData *fd, Main *bmain) block->data = MEM_calloc_arrayN(new_count, __func__); float *oldptr = static_cast(old_data); - float(*newptr)[3] = static_cast(block->data); + float (*newptr)[3] = static_cast(block->data); LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) { if (nu->bezt) { diff --git a/source/blender/blenloader/intern/versioning_290.cc b/source/blender/blenloader/intern/versioning_290.cc index 642f5a67224..171f24c2afa 100644 --- a/source/blender/blenloader/intern/versioning_290.cc +++ b/source/blender/blenloader/intern/versioning_290.cc @@ -823,7 +823,7 @@ void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain) BKE_mesh_legacy_convert_polys_to_offsets(me); BKE_mesh_validate_arrays( me, - reinterpret_cast(me->vert_positions_for_write().data()), + reinterpret_cast(me->vert_positions_for_write().data()), me->verts_num, me->edges_for_write().data(), me->edges_num, diff --git a/source/blender/blenloader/intern/versioning_defaults.cc b/source/blender/blenloader/intern/versioning_defaults.cc index 02a65b6c6fc..858813c5b3d 100644 --- a/source/blender/blenloader/intern/versioning_defaults.cc +++ b/source/blender/blenloader/intern/versioning_defaults.cc @@ -472,7 +472,7 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene) {0.125, 0.50}, {0.375, 0.50}, {0.375, 0.75}, {0.125, 0.75}, {0.375, 0.50}, {0.625, 0.50}, {0.625, 0.75}, {0.375, 0.75}, {0.375, 0.25}, {0.625, 0.25}, {0.625, 0.50}, {0.375, 0.50}, }; - float(*uv_map)[2] = static_cast( + float (*uv_map)[2] = static_cast( CustomData_get_layer_for_write(&mesh->corner_data, CD_PROP_FLOAT2, mesh->corners_num)); memcpy(uv_map, uv_values, sizeof(float[2]) * mesh->corners_num); } diff --git a/source/blender/blentranslation/BLT_translation.hh b/source/blender/blentranslation/BLT_translation.hh index 2e23d4bd8c7..3ba243e12b6 100644 --- a/source/blender/blentranslation/BLT_translation.hh +++ b/source/blender/blentranslation/BLT_translation.hh @@ -166,10 +166,7 @@ struct BLT_i18n_contexts_descriptor { const char *value; }; -#define BLT_I18NCONTEXTS_ITEM(ctxt_id, py_id) \ - { \ - #ctxt_id, py_id, ctxt_id \ - } +#define BLT_I18NCONTEXTS_ITEM(ctxt_id, py_id) {#ctxt_id, py_id, ctxt_id} #define BLT_I18NCONTEXTS_DESC \ { \ diff --git a/source/blender/bmesh/bmesh_class.hh b/source/blender/bmesh/bmesh_class.hh index 41d90b35fb2..b9ad60f97e9 100644 --- a/source/blender/bmesh/bmesh_class.hh +++ b/source/blender/bmesh/bmesh_class.hh @@ -555,10 +555,10 @@ using BMLoopPairFilterFunc = bool (*)(const BMLoop *, const BMLoop *, void *user # define BM_ELEM_CD_GET_BOOL_P(ele, offset) \ (BLI_assert(offset != -1), \ _Generic(ele, \ - GENERIC_TYPE_ANY((bool *)POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_NONCONST), \ - GENERIC_TYPE_ANY((const bool *)POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_CONST))) + GENERIC_TYPE_ANY((bool *)POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_NONCONST), \ + GENERIC_TYPE_ANY((const bool *)POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_CONST))) #else # define BM_ELEM_CD_GET_BOOL_P(ele, offset) \ (BLI_assert(offset != -1), (bool *)((char *)(ele)->head.data + (offset))) @@ -568,9 +568,10 @@ using BMLoopPairFilterFunc = bool (*)(const BMLoop *, const BMLoop *, void *user # define BM_ELEM_CD_GET_VOID_P(ele, offset) \ (BLI_assert(offset != -1), \ _Generic(ele, \ - GENERIC_TYPE_ANY(POINTER_OFFSET((ele)->head.data, offset), _BM_GENERIC_TYPE_ELEM_NONCONST), \ - GENERIC_TYPE_ANY((const void *)POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_CONST))) + GENERIC_TYPE_ANY(POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_NONCONST), \ + GENERIC_TYPE_ANY((const void *)POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_CONST))) #else # define BM_ELEM_CD_GET_VOID_P(ele, offset) \ (BLI_assert(offset != -1), (void *)((char *)(ele)->head.data + (offset))) @@ -592,26 +593,26 @@ using BMLoopPairFilterFunc = bool (*)(const BMLoop *, const BMLoop *, void *user # define BM_ELEM_CD_GET_FLOAT_P(ele, offset) \ (BLI_assert(offset != -1), \ _Generic(ele, \ - GENERIC_TYPE_ANY((float *)POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_NONCONST), \ - GENERIC_TYPE_ANY((const float *)POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_CONST))) + GENERIC_TYPE_ANY((float *)POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_NONCONST), \ + GENERIC_TYPE_ANY((const float *)POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_CONST))) # define BM_ELEM_CD_GET_FLOAT2_P(ele, offset) \ (BLI_assert(offset != -1), \ _Generic(ele, \ - GENERIC_TYPE_ANY((float(*)[2])POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_NONCONST), \ - GENERIC_TYPE_ANY((const float(*)[2])POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_CONST))) + GENERIC_TYPE_ANY((float (*)[2])POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_NONCONST), \ + GENERIC_TYPE_ANY((const float (*)[2])POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_CONST))) # define BM_ELEM_CD_GET_FLOAT3_P(ele, offset) \ (BLI_assert(offset != -1), \ _Generic(ele, \ - GENERIC_TYPE_ANY((float(*)[3])POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_NONCONST), \ - GENERIC_TYPE_ANY((const float(*)[3])POINTER_OFFSET((ele)->head.data, offset), \ - _BM_GENERIC_TYPE_ELEM_CONST))) + GENERIC_TYPE_ANY((float (*)[3])POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_NONCONST), \ + GENERIC_TYPE_ANY((const float (*)[3])POINTER_OFFSET((ele)->head.data, offset), \ + _BM_GENERIC_TYPE_ELEM_CONST))) #else @@ -619,10 +620,10 @@ using BMLoopPairFilterFunc = bool (*)(const BMLoop *, const BMLoop *, void *user (BLI_assert(offset != -1), (float *)((char *)(ele)->head.data + (offset))) # define BM_ELEM_CD_GET_FLOAT2_P(ele, offset) \ - (BLI_assert(offset != -1), (float(*)[2])((char *)(ele)->head.data + (offset))) + (BLI_assert(offset != -1), (float (*)[2])((char *)(ele)->head.data + (offset))) # define BM_ELEM_CD_GET_FLOAT3_P(ele, offset) \ - (BLI_assert(offset != -1), (float(*)[3])((char *)(ele)->head.data + (offset))) + (BLI_assert(offset != -1), (float (*)[3])((char *)(ele)->head.data + (offset))) #endif diff --git a/source/blender/bmesh/intern/bmesh_core.cc b/source/blender/bmesh/intern/bmesh_core.cc index b91b7166898..9e9bb4aede4 100644 --- a/source/blender/bmesh/intern/bmesh_core.cc +++ b/source/blender/bmesh/intern/bmesh_core.cc @@ -1330,7 +1330,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del, /* handle multi-res data */ if (cd_loop_mdisp_offset != -1) { float f_center[3]; - float(*faces_center)[3] = BLI_array_alloca(faces_center, totface); + float (*faces_center)[3] = BLI_array_alloca(faces_center, totface); BM_face_calc_center_median(f_new, f_center); for (i = 0; i < totface; i++) { diff --git a/source/blender/bmesh/intern/bmesh_interp.cc b/source/blender/bmesh/intern/bmesh_interp.cc index bbb8c82f5b0..83f28e96324 100644 --- a/source/blender/bmesh/intern/bmesh_interp.cc +++ b/source/blender/bmesh/intern/bmesh_interp.cc @@ -173,7 +173,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *f_dst, const BMFace *f_src, con const void **blocks_v = do_vertex ? static_cast(BLI_array_alloca(blocks_v, f_src->len)) : nullptr; - float(*cos_2d)[2] = static_cast(BLI_array_alloca(cos_2d, f_src->len)); + float (*cos_2d)[2] = static_cast(BLI_array_alloca(cos_2d, f_src->len)); float axis_mat[3][3]; /* use normal to transform into 2d xy coords */ int i; @@ -496,7 +496,7 @@ void BM_loop_interp_multires_ex(BMesh * /*bm*/, md_dst->totdisp = md_src->totdisp; md_dst->level = md_src->level; if (md_dst->totdisp) { - md_dst->disps = static_cast( + md_dst->disps = static_cast( MEM_callocN(sizeof(float[3]) * md_dst->totdisp, __func__)); } else { @@ -691,7 +691,7 @@ void BM_loop_interp_from_face( static_cast(BLI_array_alloca(vblocks, f_src->len)) : nullptr; const void **blocks = static_cast(BLI_array_alloca(blocks, f_src->len)); - float(*cos_2d)[2] = static_cast(BLI_array_alloca(cos_2d, f_src->len)); + float (*cos_2d)[2] = static_cast(BLI_array_alloca(cos_2d, f_src->len)); float *w = static_cast(BLI_array_alloca(w, f_src->len)); float axis_mat[3][3]; /* use normal to transform into 2d xy coords */ float co[2]; @@ -742,7 +742,7 @@ void BM_vert_interp_from_face(BMesh *bm, BMVert *v_dst, const BMFace *f_src) BMLoop *l_iter; BMLoop *l_first; const void **blocks = static_cast(BLI_array_alloca(blocks, f_src->len)); - float(*cos_2d)[2] = static_cast(BLI_array_alloca(cos_2d, f_src->len)); + float (*cos_2d)[2] = static_cast(BLI_array_alloca(cos_2d, f_src->len)); float *w = static_cast(BLI_array_alloca(w, f_src->len)); float axis_mat[3][3]; /* use normal to transform into 2d xy coords */ float co[2]; diff --git a/source/blender/bmesh/intern/bmesh_mesh.hh b/source/blender/bmesh/intern/bmesh_mesh.hh index 95435c62195..b213f600fa5 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.hh +++ b/source/blender/bmesh/intern/bmesh_mesh.hh @@ -183,22 +183,23 @@ extern const BMAllocTemplate bm_mesh_allocsize_default; extern const BMAllocTemplate bm_mesh_chunksize_default; #define BMALLOC_TEMPLATE_FROM_BM(bm) \ - { \ - (CHECK_TYPE_INLINE(bm, BMesh *), (bm)->totvert), (bm)->totedge, (bm)->totloop, (bm)->totface \ - } + {(CHECK_TYPE_INLINE(bm, BMesh *), (bm)->totvert), (bm)->totedge, (bm)->totloop, (bm)->totface} #define _VA_BMALLOC_TEMPLATE_FROM_ME_1(me) \ { \ - (CHECK_TYPE_INLINE(me, Mesh *), (me)->verts_num), (me)->edges_num, (me)->corners_num, \ - (me)->faces_num, \ + (CHECK_TYPE_INLINE(me, Mesh *), (me)->verts_num), \ + (me)->edges_num, \ + (me)->corners_num, \ + (me)->faces_num, \ } #define _VA_BMALLOC_TEMPLATE_FROM_ME_2(me_a, me_b) \ { \ - (CHECK_TYPE_INLINE(me_a, Mesh *), \ - CHECK_TYPE_INLINE(me_b, Mesh *), \ - (me_a)->verts_num + (me_b)->verts_num), \ - (me_a)->edges_num + (me_b)->edges_num, (me_a)->corners_num + (me_b)->corners_num, \ - (me_a)->faces_num + (me_b)->faces_num, \ + (CHECK_TYPE_INLINE(me_a, Mesh *), \ + CHECK_TYPE_INLINE(me_b, Mesh *), \ + (me_a)->verts_num + (me_b)->verts_num), \ + (me_a)->edges_num + (me_b)->edges_num, \ + (me_a)->corners_num + (me_b)->corners_num, \ + (me_a)->faces_num + (me_b)->faces_num, \ } #define BMALLOC_TEMPLATE_FROM_ME(...) \ VA_NARGS_CALL_OVERLOAD(_VA_BMALLOC_TEMPLATE_FROM_ME_, __VA_ARGS__) diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc index 1ec4df0fd17..0360c5f1a09 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc @@ -219,7 +219,7 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams * const bool is_new = !(bm->totvert || (bm->vdata.totlayer || bm->edata.totlayer || bm->pdata.totlayer || bm->ldata.totlayer)); KeyBlock *actkey; - float(*keyco)[3] = nullptr; + float (*keyco)[3] = nullptr; CustomData_MeshMasks mask = CD_MASK_BMESH; CustomData_MeshMasks_update(&mask, ¶ms->cd_mask_extra); @@ -346,9 +346,9 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams * if (is_new == false) { tot_shape_keys = min_ii(tot_shape_keys, CustomData_number_of_layers(&bm->vdata, CD_SHAPEKEY)); } - const float(**shape_key_table)[3] = tot_shape_keys ? (const float(**)[3])BLI_array_alloca( - shape_key_table, tot_shape_keys) : - nullptr; + const float (**shape_key_table)[3] = tot_shape_keys ? (const float (**)[3])BLI_array_alloca( + shape_key_table, tot_shape_keys) : + nullptr; if ((params->active_shapekey != 0) && tot_shape_keys > 0) { actkey = static_cast(BLI_findlink(&mesh->key->block, params->active_shapekey - 1)); @@ -381,7 +381,7 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams * } if (actkey && actkey->totelem == mesh->verts_num) { - keyco = params->use_shapekey ? static_cast(actkey->data) : nullptr; + keyco = params->use_shapekey ? static_cast(actkey->data) : nullptr; if (is_new) { bm->shapenr = params->active_shapekey; } @@ -397,7 +397,7 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams * int j = CustomData_get_layer_index_n(&bm->vdata, CD_SHAPEKEY, i); bm->vdata.layers[j].uid = block->uid; } - shape_key_table[i] = static_cast(block->data); + shape_key_table[i] = static_cast(block->data); } } @@ -459,7 +459,7 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams * /* Set shape-key data. */ if (tot_shape_keys) { - float(*co_dst)[3] = (float(*)[3])BM_ELEM_CD_GET_VOID_P(v, cd_shape_key_offset); + float (*co_dst)[3] = (float (*)[3])BM_ELEM_CD_GET_VOID_P(v, cd_shape_key_offset); for (int j = 0; j < tot_shape_keys; j++, co_dst++) { copy_v3_v3(*co_dst, shape_key_table[j][i]); } @@ -795,7 +795,7 @@ static void bm_to_mesh_shape(BMesh *bm, const int cd_shape_keyindex_offset = CustomData_get_offset(&bm->vdata, CD_SHAPE_KEYINDEX); BMIter iter; BMVert *eve; - float(*ofs)[3] = nullptr; + float (*ofs)[3] = nullptr; std::optional> dependent; /* Editing the basis key updates others. */ @@ -816,7 +816,7 @@ static void bm_to_mesh_shape(BMesh *bm, const int cd_shape_offset = CustomData_get_n_offset(&bm->vdata, CD_SHAPEKEY, actkey_uuid); - ofs = static_cast(MEM_mallocN(sizeof(float[3]) * bm->totvert, __func__)); + ofs = static_cast(MEM_mallocN(sizeof(float[3]) * bm->totvert, __func__)); int i; BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, i) { const int keyi = BM_ELEM_CD_GET_INT(eve, cd_shape_keyindex_offset); @@ -862,7 +862,7 @@ static void bm_to_mesh_shape(BMesh *bm, int currkey_i; LISTBASE_FOREACH_INDEX (KeyBlock *, currkey, &key->block, currkey_i) { int keyi; - float(*currkey_data)[3]; + float (*currkey_data)[3]; const int currkey_uuid = bm_to_mesh_shape_layer_index_from_kb(bm, currkey); const int cd_shape_offset = (currkey_uuid == -1) ? @@ -880,7 +880,7 @@ static void bm_to_mesh_shape(BMesh *bm, currkey->data = MEM_reallocN(currkey->data, key->elemsize * bm->totvert); currkey->totelem = bm->totvert; } - currkey_data = (float(*)[3])currkey->data; + currkey_data = (float (*)[3])currkey->data; int i; BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, i) { @@ -927,7 +927,7 @@ static void bm_to_mesh_shape(BMesh *bm, "using basis shape-key data"); } - currkey_data = static_cast( + currkey_data = static_cast( MEM_mallocN(key->elemsize * bm->totvert, "currkey->data")); int i; @@ -942,7 +942,7 @@ static void bm_to_mesh_shape(BMesh *bm, * coordinates may be flushed back to the shape-key when exporting or rendering. * This is a last resort! If this branch is running as part of regular usage * it can be considered a bug. */ - const float(*oldkey)[3] = static_cast(currkey->data); + const float (*oldkey)[3] = static_cast(currkey->data); copy_v3_v3(currkey_data[i], oldkey[keyi]); } else { diff --git a/source/blender/bmesh/intern/bmesh_mesh_normals.cc b/source/blender/bmesh/intern/bmesh_mesh_normals.cc index ed909b7d578..683ee2bf976 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_normals.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_normals.cc @@ -539,10 +539,10 @@ static int bm_mesh_loops_calc_normals_for_loop(BMesh *bm, BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, l_curr_index, l_curr, true); if (has_clnors) { - const short(*clnor)[2] = clnors_data ? - &clnors_data[l_curr_index] : - static_cast( - BM_ELEM_CD_GET_VOID_P(l_curr, cd_loop_clnors_offset)); + const short (*clnor)[2] = clnors_data ? + &clnors_data[l_curr_index] : + static_cast( + BM_ELEM_CD_GET_VOID_P(l_curr, cd_loop_clnors_offset)); BKE_lnor_space_custom_data_to_normal(lnor_space, *clnor, r_lnos[l_curr_index]); } } @@ -576,7 +576,7 @@ static int bm_mesh_loops_calc_normals_for_loop(BMesh *bm, /* We validate clnors data on the fly - cheapest way to do! */ int clnors_avg[2] = {0, 0}; - const short(*clnor_ref)[2] = nullptr; + const short (*clnor_ref)[2] = nullptr; int clnors_count = 0; bool clnors_invalid = false; @@ -644,10 +644,10 @@ static int bm_mesh_loops_calc_normals_for_loop(BMesh *bm, if (has_clnors) { /* Accumulate all clnors, if they are not all equal we have to fix that! */ - const short(*clnor)[2] = clnors_data ? - &clnors_data[lfan_pivot_index] : - static_cast(BM_ELEM_CD_GET_VOID_P( - lfan_pivot, cd_loop_clnors_offset)); + const short (*clnor)[2] = clnors_data ? + &clnors_data[lfan_pivot_index] : + static_cast(BM_ELEM_CD_GET_VOID_P( + lfan_pivot, cd_loop_clnors_offset)); if (clnors_count) { clnors_invalid |= ((*clnor_ref)[0] != (*clnor)[0] || (*clnor_ref)[1] != (*clnor)[1]); } @@ -1001,7 +1001,7 @@ static void bm_mesh_loops_calc_normals_for_vert_without_clnors( BMVert *v) { const bool has_clnors = false; - const short(*clnors_data)[2] = nullptr; + const short (*clnors_data)[2] = nullptr; /* When false the caller must have already tagged the edges. */ const bool do_edge_tag = (split_angle_cos != EDGE_TAG_FROM_SPLIT_ANGLE_BYPASS); const int cd_loop_clnors_offset = -1; @@ -1601,10 +1601,10 @@ static void bm_mesh_loops_custom_normals_set(BMesh *bm, EDGE_TAG_FROM_SPLIT_ANGLE_BYPASS); /* Extract new normals from the data layer if necessary. */ - float(*custom_lnors)[3] = new_lnors; + float (*custom_lnors)[3] = new_lnors; if (new_lnors == nullptr) { - custom_lnors = static_cast( + custom_lnors = static_cast( MEM_mallocN(sizeof(*new_lnors) * bm->totloop, __func__)); BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { @@ -1836,7 +1836,7 @@ void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor) if (BM_ELEM_API_FLAG_TEST(l, BM_LNORSPACE_UPDATE) || bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL) { - short(*clnor)[2] = static_cast( + short (*clnor)[2] = static_cast( BM_ELEM_CD_GET_VOID_P(l, cd_loop_clnors_offset)); int l_index = BM_elem_index_get(l); @@ -1859,7 +1859,7 @@ void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor) bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL) { if (preserve_clnor) { - short(*clnor)[2] = static_cast( + short (*clnor)[2] = static_cast( BM_ELEM_CD_GET_VOID_P(l, cd_loop_clnors_offset)); int l_index = BM_elem_index_get(l); BKE_lnor_space_custom_normal_to_data( diff --git a/source/blender/bmesh/intern/bmesh_mesh_tessellate.cc b/source/blender/bmesh/intern/bmesh_mesh_tessellate.cc index 53f4a4cedf4..eea17f7374e 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_tessellate.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_tessellate.cc @@ -97,7 +97,7 @@ BLI_INLINE void bmesh_calc_tessellation_for_face_impl(std::array *l BMLoop **l_arr; float axis_mat[3][3]; - float(*projverts)[2]; + float (*projverts)[2]; uint(*tris)[3]; const int tris_len = efa->len - 2; @@ -109,7 +109,7 @@ BLI_INLINE void bmesh_calc_tessellation_for_face_impl(std::array *l tris = static_cast(BLI_memarena_alloc(pf_arena, sizeof(*tris) * tris_len)); l_arr = static_cast(BLI_memarena_alloc(pf_arena, sizeof(*l_arr) * efa->len)); - projverts = static_cast( + projverts = static_cast( BLI_memarena_alloc(pf_arena, sizeof(*projverts) * efa->len)); axis_dominant_v3_to_m3_negate(axis_mat, efa->no); @@ -492,14 +492,14 @@ static int bmesh_calc_tessellation_for_face_beauty(std::array *loop BMLoop **l_arr; float axis_mat[3][3]; - float(*projverts)[2]; + float (*projverts)[2]; uint(*tris)[3]; const int tris_len = efa->len - 2; tris = static_cast(BLI_memarena_alloc(pf_arena, sizeof(*tris) * tris_len)); l_arr = static_cast(BLI_memarena_alloc(pf_arena, sizeof(*l_arr) * efa->len)); - projverts = static_cast( + projverts = static_cast( BLI_memarena_alloc(pf_arena, sizeof(*projverts) * efa->len)); axis_dominant_v3_to_m3_negate(axis_mat, efa->no); diff --git a/source/blender/bmesh/intern/bmesh_operator_api.hh b/source/blender/bmesh/intern/bmesh_operator_api.hh index 428d5411ab4..1927456d537 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.hh +++ b/source/blender/bmesh/intern/bmesh_operator_api.hh @@ -275,7 +275,7 @@ struct BMOpSlot { #define BMO_SLOT_AS_INT(slot) ((slot)->data.i) #define BMO_SLOT_AS_FLOAT(slot) ((slot)->data.f) #define BMO_SLOT_AS_VECTOR(slot) ((slot)->data.vec) -#define BMO_SLOT_AS_MATRIX(slot) ((float(*)[4])((slot)->data.p)) +#define BMO_SLOT_AS_MATRIX(slot) ((float (*)[4])((slot)->data.p)) #define BMO_SLOT_AS_BUFFER(slot) ((slot)->data.buf) #define BMO_SLOT_AS_GHASH(slot) ((slot)->data.ghash) diff --git a/source/blender/bmesh/intern/bmesh_operators.cc b/source/blender/bmesh/intern/bmesh_operators.cc index eb886218a72..88fb81c63d0 100644 --- a/source/blender/bmesh/intern/bmesh_operators.cc +++ b/source/blender/bmesh/intern/bmesh_operators.cc @@ -356,15 +356,15 @@ void BMO_slot_mat_set(BMOperator *op, slot->data.p = BLI_memarena_alloc(op->arena, sizeof(float[4][4])); if (size == 4) { - copy_m4_m4(static_cast(slot->data.p), (const float(*)[4])mat); + copy_m4_m4(static_cast(slot->data.p), (const float (*)[4])mat); } else if (size == 3) { - copy_m4_m3(static_cast(slot->data.p), (const float(*)[3])mat); + copy_m4_m3(static_cast(slot->data.p), (const float (*)[3])mat); } else { fprintf(stderr, "%s: invalid size argument %d (bmesh internal error)\n", __func__, size); - zero_m4(static_cast(slot->data.p)); + zero_m4(static_cast(slot->data.p)); } } diff --git a/source/blender/bmesh/intern/bmesh_polygon.cc b/source/blender/bmesh/intern/bmesh_polygon.cc index e4c1068f9d3..584c8b1c067 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.cc +++ b/source/blender/bmesh/intern/bmesh_polygon.cc @@ -138,7 +138,7 @@ void BM_face_calc_tessellation(const BMFace *f, } else { float axis_mat[3][3]; - float(*projverts)[2] = BLI_array_alloca(projverts, f->len); + float (*projverts)[2] = BLI_array_alloca(projverts, f->len); int j; axis_dominant_v3_to_m3_negate(axis_mat, f->no); @@ -1022,7 +1022,7 @@ void BM_face_normal_flip(BMesh *bm, BMFace *f) bool BM_face_point_inside_test(const BMFace *f, const float co[3]) { float axis_mat[3][3]; - float(*projverts)[2] = BLI_array_alloca(projverts, f->len); + float (*projverts)[2] = BLI_array_alloca(projverts, f->len); float co_2d[2]; BMLoop *l_iter; @@ -1162,7 +1162,7 @@ void BM_face_triangulate(BMesh *bm, else { BMLoop *l_iter; float axis_mat[3][3]; - float(*projverts)[2] = BLI_array_alloca(projverts, f->len); + float (*projverts)[2] = BLI_array_alloca(projverts, f->len); axis_dominant_v3_to_m3_negate(axis_mat, f->no); @@ -1275,7 +1275,7 @@ void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int l blender::float2 out = {-FLT_MAX, -FLT_MAX}; float center[2] = {0.0f, 0.0f}; float axis_mat[3][3]; - float(*projverts)[2] = BLI_array_alloca(projverts, f->len); + float (*projverts)[2] = BLI_array_alloca(projverts, f->len); const float *(*edgeverts)[2] = BLI_array_alloca(edgeverts, len); BMLoop *l; int i, i_prev, j; diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.cc b/source/blender/bmesh/intern/bmesh_polygon_edgenet.cc index afdeec8f9dc..df46c3a5800 100644 --- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.cc +++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.cc @@ -572,7 +572,7 @@ bool BM_face_split_edgenet(BMesh *bm, /* See: #BM_loop_interp_from_face for similar logic. */ void **blocks = BLI_array_alloca(blocks, f->len); - float(*cos_2d)[2] = BLI_array_alloca(cos_2d, f->len); + float (*cos_2d)[2] = BLI_array_alloca(cos_2d, f->len); float *w = BLI_array_alloca(w, f->len); float axis_mat[3][3]; float co[2]; @@ -1352,7 +1352,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, /* Declare here because of `goto` below. */ BMEdge **edge_net_new = nullptr; BVHTree *bvhtree = nullptr; - float(*vert_coords_backup)[3] = nullptr; + float (*vert_coords_backup)[3] = nullptr; uint *verts_group_table = nullptr; BMVert **vert_arr = nullptr; uint vert_arr_len = 0; @@ -1403,11 +1403,11 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, * but we need to sort the groups before setting the vertex array order */ const float axis_value[2] = { #if SORT_AXIS == 0 - dot_m3_v3_row_x(axis_mat, v_iter->co), - dot_m3_v3_row_y(axis_mat, v_iter->co), + dot_m3_v3_row_x(axis_mat, v_iter->co), + dot_m3_v3_row_y(axis_mat, v_iter->co), #else - dot_m3_v3_row_y(axis_mat, v_iter->co), - dot_m3_v3_row_x(axis_mat, v_iter->co), + dot_m3_v3_row_y(axis_mat, v_iter->co), + dot_m3_v3_row_x(axis_mat, v_iter->co), #endif }; @@ -1442,7 +1442,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, verts_group_table = static_cast( BLI_memarena_alloc(mem_arena, sizeof(*verts_group_table) * vert_arr_len)); - vert_coords_backup = static_cast( + vert_coords_backup = static_cast( BLI_memarena_alloc(mem_arena, sizeof(*vert_coords_backup) * vert_arr_len)); { diff --git a/source/blender/bmesh/intern/bmesh_query.cc b/source/blender/bmesh/intern/bmesh_query.cc index 1dc0e66319b..0bc5d27075b 100644 --- a/source/blender/bmesh/intern/bmesh_query.cc +++ b/source/blender/bmesh/intern/bmesh_query.cc @@ -2120,7 +2120,7 @@ int BM_mesh_calc_face_groups(BMesh *bm, int group_index_len = 32; #endif - int(*group_index)[2] = static_cast( + int (*group_index)[2] = static_cast( MEM_mallocN(sizeof(*group_index) * group_index_len, __func__)); int *group_array = r_groups_array; @@ -2185,7 +2185,7 @@ int BM_mesh_calc_face_groups(BMesh *bm, /* manage arrays */ if (group_index_len == group_curr) { group_index_len *= 2; - group_index = static_cast( + group_index = static_cast( MEM_reallocN(group_index, sizeof(*group_index) * group_index_len)); } @@ -2252,7 +2252,7 @@ int BM_mesh_calc_face_groups(BMesh *bm, /* reduce alloc to required size */ if (group_index_len != group_curr) { - group_index = static_cast( + group_index = static_cast( MEM_reallocN(group_index, sizeof(*group_index) * group_curr)); } *r_group_index = group_index; @@ -2275,7 +2275,7 @@ int BM_mesh_calc_edge_groups(BMesh *bm, int group_index_len = 32; #endif - int(*group_index)[2] = static_cast( + int (*group_index)[2] = static_cast( MEM_mallocN(sizeof(*group_index) * group_index_len, __func__)); int *group_array = r_groups_array; @@ -2337,7 +2337,7 @@ int BM_mesh_calc_edge_groups(BMesh *bm, /* manage arrays */ if (group_index_len == group_curr) { group_index_len *= 2; - group_index = static_cast( + group_index = static_cast( MEM_reallocN(group_index, sizeof(*group_index) * group_index_len)); } @@ -2377,7 +2377,7 @@ int BM_mesh_calc_edge_groups(BMesh *bm, /* reduce alloc to required size */ if (group_index_len != group_curr) { - group_index = static_cast( + group_index = static_cast( MEM_reallocN(group_index, sizeof(*group_index) * group_curr)); } *r_group_index = group_index; @@ -2388,7 +2388,7 @@ int BM_mesh_calc_edge_groups(BMesh *bm, int BM_mesh_calc_edge_groups_as_arrays( BMesh *bm, BMVert **verts, BMEdge **edges, BMFace **faces, int (**r_groups)[3]) { - int(*groups)[3] = MEM_malloc_arrayN(bm->totvert, __func__); + int (*groups)[3] = MEM_malloc_arrayN(bm->totvert, __func__); STACK_DECLARE(groups); STACK_INIT(groups, bm->totvert); @@ -2465,7 +2465,7 @@ int BM_mesh_calc_edge_groups_as_arrays( MEM_freeN(stack); /* Reduce alloc to required size. */ - groups = static_cast(MEM_reallocN(groups, sizeof(*groups) * STACK_SIZE(groups))); + groups = static_cast(MEM_reallocN(groups, sizeof(*groups) * STACK_SIZE(groups))); *r_groups = groups; return STACK_SIZE(groups); } diff --git a/source/blender/bmesh/intern/bmesh_query_uv.cc b/source/blender/bmesh/intern/bmesh_query_uv.cc index dafd6d0986c..26471fdfd8d 100644 --- a/source/blender/bmesh/intern/bmesh_query_uv.cc +++ b/source/blender/bmesh/intern/bmesh_query_uv.cc @@ -129,7 +129,7 @@ float BM_face_uv_calc_cross(const BMFace *f, const int cd_loop_uv_offset) do { uvs[i++] = BM_ELEM_CD_GET_FLOAT2_P(l_iter, cd_loop_uv_offset); } while ((l_iter = l_iter->next) != l_first); - return cross_poly_v2(reinterpret_cast(uvs.data()), f->len); + return cross_poly_v2(reinterpret_cast(uvs.data()), f->len); } void BM_face_uv_minmax(const BMFace *f, float min[2], float max[2], const int cd_loop_uv_offset) @@ -207,5 +207,5 @@ bool BM_face_uv_point_inside_test(const BMFace *f, const float co[2], const int projverts[i] = BM_ELEM_CD_GET_FLOAT2_P(l_iter, cd_loop_uv_offset); } - return isect_point_poly_v2(co, reinterpret_cast(projverts.data()), f->len); + return isect_point_poly_v2(co, reinterpret_cast(projverts.data()), f->len); } diff --git a/source/blender/bmesh/operators/bmo_fill_grid.cc b/source/blender/bmesh/operators/bmo_fill_grid.cc index 6165bc68fd1..5cc9263c7cb 100644 --- a/source/blender/bmesh/operators/bmo_fill_grid.cc +++ b/source/blender/bmesh/operators/bmo_fill_grid.cc @@ -205,7 +205,7 @@ static void bm_grid_fill_array(BMesh *bm, /* for use_loop_interp */ BMLoop *(*larr_x_a)[2], *(*larr_x_b)[2], *(*larr_y_a)[2], *(*larr_y_b)[2]; - float(*weight_table)[4]; + float (*weight_table)[4]; #define XY(_x, _y) ((_x) + ((_y) * (xtot))) @@ -234,7 +234,7 @@ static void bm_grid_fill_array(BMesh *bm, #endif if (use_interp_simple || use_vert_interp || use_loop_interp) { - weight_table = static_cast( + weight_table = static_cast( MEM_mallocN(sizeof(*weight_table) * size_t(xtot * ytot), __func__)); barycentric_weights_v2_grid_cache(xtot, ytot, weight_table); } diff --git a/source/blender/bmesh/operators/bmo_hull.cc b/source/blender/bmesh/operators/bmo_hull.cc index 85f11089b12..7f02729a06a 100644 --- a/source/blender/bmesh/operators/bmo_hull.cc +++ b/source/blender/bmesh/operators/bmo_hull.cc @@ -429,7 +429,7 @@ static BMVert **hull_input_verts_copy(BMOperator *op, const int num_input_verts) static float (*hull_verts_for_bullet(BMVert **input_verts, const int num_input_verts))[3] { - float(*coords)[3] = static_cast( + float (*coords)[3] = static_cast( MEM_callocN(sizeof(*coords) * num_input_verts, __func__)); int i; @@ -467,7 +467,7 @@ static BMVert **hull_verts_from_bullet(plConvexHull hull, static void hull_from_bullet(BMesh *bm, BMOperator *op, BLI_mempool *hull_triangles) { BMVert **input_verts; - float(*coords)[3]; + float (*coords)[3]; BMVert **hull_verts; plConvexHull hull; diff --git a/source/blender/bmesh/operators/bmo_inset.cc b/source/blender/bmesh/operators/bmo_inset.cc index 90fbb146f28..41e56ef6242 100644 --- a/source/blender/bmesh/operators/bmo_inset.cc +++ b/source/blender/bmesh/operators/bmo_inset.cc @@ -61,21 +61,21 @@ static void bm_interp_face_store(InterpFace *iface, BMesh *bm, BMFace *f, MemAre BLI_memarena_alloc(interp_arena, sizeof(*iface->blocks_l) * f->len)); void **blocks_v = iface->blocks_v = static_cast( BLI_memarena_alloc(interp_arena, sizeof(*iface->blocks_v) * f->len)); - float(*cos_2d)[2] = iface->cos_2d = static_cast( + float (*cos_2d)[2] = iface->cos_2d = static_cast( BLI_memarena_alloc(interp_arena, sizeof(*iface->cos_2d) * f->len)); void *axis_mat = iface->axis_mat; int i; BLI_assert(BM_face_is_normal_valid(f)); - axis_dominant_v3_to_m3(static_cast(axis_mat), f->no); + axis_dominant_v3_to_m3(static_cast(axis_mat), f->no); iface->f = f; i = 0; l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { - mul_v2_m3v3(cos_2d[i], static_cast(axis_mat), l_iter->v->co); + mul_v2_m3v3(cos_2d[i], static_cast(axis_mat), l_iter->v->co); blocks_l[i] = nullptr; CustomData_bmesh_copy_block(bm->ldata, l_iter->head.data, &blocks_l[i]); /* if we were not modifying the loops later we would do... */ @@ -270,8 +270,8 @@ static void bmo_face_inset_individual(BMesh *bm, /* stores verts split away from the face (aligned with face verts) */ BMVert **verts = BLI_array_alloca(verts, f->len); /* store edge normals (aligned with face-loop-edges) */ - float(*edge_nors)[3] = BLI_array_alloca(edge_nors, f->len); - float(*coords)[3] = BLI_array_alloca(coords, f->len); + float (*edge_nors)[3] = BLI_array_alloca(edge_nors, f->len); + float (*coords)[3] = BLI_array_alloca(coords, f->len); BMLoop *l_iter, *l_first; BMLoop *l_other; @@ -1314,7 +1314,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op) /* cheap feature to add depth to the inset */ if (depth != 0.0f) { - float(*varr_co)[3]; + float (*varr_co)[3]; BMOIter oiter; /* We need to re-calculate tagged normals, diff --git a/source/blender/bmesh/operators/bmo_normals.cc b/source/blender/bmesh/operators/bmo_normals.cc index a5d09ca05aa..4bd0d34ef11 100644 --- a/source/blender/bmesh/operators/bmo_normals.cc +++ b/source/blender/bmesh/operators/bmo_normals.cc @@ -259,7 +259,7 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op) BMFace **faces_grp = static_cast( MEM_mallocN(sizeof(*faces_grp) * bm->totface, __func__)); - int(*group_index)[2]; + int (*group_index)[2]; const int group_tot = BM_mesh_calc_face_groups(bm, groups_array, &group_index, diff --git a/source/blender/bmesh/operators/bmo_offset_edgeloops.cc b/source/blender/bmesh/operators/bmo_offset_edgeloops.cc index cf96ba84cc0..183d6e1d4e2 100644 --- a/source/blender/bmesh/operators/bmo_offset_edgeloops.cc +++ b/source/blender/bmesh/operators/bmo_offset_edgeloops.cc @@ -36,7 +36,7 @@ static BMFace *bm_face_split_walk_back(BMesh *bm, BMLoop *l_src, BMLoop **r_l) { - float(*cos)[3]; + float (*cos)[3]; BMLoop *l_dst; BMFace *f; int num, i; diff --git a/source/blender/bmesh/operators/bmo_planar_faces.cc b/source/blender/bmesh/operators/bmo_planar_faces.cc index b96ce2a97a4..682b492ff83 100644 --- a/source/blender/bmesh/operators/bmo_planar_faces.cc +++ b/source/blender/bmesh/operators/bmo_planar_faces.cc @@ -39,10 +39,10 @@ void bmo_planar_faces_exec(BMesh *bm, BMOperator *op) BMFace *f; BLI_mempool *vert_accum_pool; GHash *vaccum_map; - float(*faces_center)[3]; + float (*faces_center)[3]; int i, iter_step, shared_vert_num; - faces_center = static_cast( + faces_center = static_cast( MEM_mallocN(sizeof(*faces_center) * faces_num, __func__)); shared_vert_num = 0; diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.cc b/source/blender/bmesh/operators/bmo_smooth_laplacian.cc index d81ec32a0a0..c951e3fb998 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.cc +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.cc @@ -104,7 +104,7 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numLoops, in return nullptr; } - sys->fweights = static_cast( + sys->fweights = static_cast( MEM_callocN(sizeof(float[3]) * sys->numLoops, "ModLaplSmoothFWeight")); if (!sys->fweights) { delete_laplacian_system(sys); diff --git a/source/blender/bmesh/operators/bmo_subdivide_edgering.cc b/source/blender/bmesh/operators/bmo_subdivide_edgering.cc index ac1257e7b2a..ea3a507e919 100644 --- a/source/blender/bmesh/operators/bmo_subdivide_edgering.cc +++ b/source/blender/bmesh/operators/bmo_subdivide_edgering.cc @@ -459,15 +459,15 @@ static LoopPairStore *bm_edgering_pair_store_create(BMesh *bm, BMEdgeLoopStore *el_store_pair[2] = {el_store_a, el_store_b}; uint side_index; - float(*nors_pair[2])[3]; + float (*nors_pair[2])[3]; GHash *nors_gh_pair[2]; BM_edgeloop_edges_get(el_store_a, e_arr_a); BM_edgeloop_edges_get(el_store_b, e_arr_b); - lpair->nors_a = static_cast( + lpair->nors_a = static_cast( MEM_mallocN(sizeof(*lpair->nors_a) * len_a, __func__)); - lpair->nors_b = static_cast( + lpair->nors_b = static_cast( MEM_mallocN(sizeof(*lpair->nors_b) * len_b, __func__)); nors_pair[0] = lpair->nors_a; @@ -495,7 +495,7 @@ static LoopPairStore *bm_edgering_pair_store_create(BMesh *bm, BMEdgeLoopStore *el_store = el_store_pair[side_index]; ListBase *lb = BM_edgeloop_verts_get(el_store); GHash *nors_gh_iter = nors_gh_pair[side_index]; - float(*nor)[3] = nors_pair[side_index]; + float (*nor)[3] = nors_pair[side_index]; LinkData *v_iter; @@ -556,7 +556,7 @@ static void bm_edgering_pair_interpolate(BMesh *bm, BMEdgeLoopStore *el_store_ring; - float(*coord_array_main)[3] = nullptr; + float (*coord_array_main)[3] = nullptr; BM_edgeloop_calc_center(bm, el_store_a); BM_edgeloop_calc_center(bm, el_store_b); @@ -610,7 +610,7 @@ static void bm_edgering_pair_interpolate(BMesh *bm, add_v3_v3(handle_a, el_store_a_co); add_v3_v3(handle_b, el_store_b_co); - coord_array_main = static_cast( + coord_array_main = static_cast( MEM_mallocN(dims * (resolu) * sizeof(float), __func__)); for (i = 0; i < dims; i++) { @@ -627,7 +627,7 @@ static void bm_edgering_pair_interpolate(BMesh *bm, switch (interp_mode) { case SUBD_RING_INTERP_LINEAR: { if (falloff_cache) { - float(*coord_array)[3] = static_cast( + float (*coord_array)[3] = static_cast( MEM_mallocN(dims * (resolu) * sizeof(float), __func__)); for (i = 0; i < resolu; i++) { interp_v3_v3v3( @@ -661,13 +661,13 @@ static void bm_edgering_pair_interpolate(BMesh *bm, break; } case SUBD_RING_INTERP_PATH: { - float(*direction_array)[3] = static_cast( + float (*direction_array)[3] = static_cast( MEM_mallocN(dims * (resolu) * sizeof(float), __func__)); - float(*quat_array)[4] = static_cast( + float (*quat_array)[4] = static_cast( MEM_mallocN(resolu * sizeof(*quat_array), __func__)); - float(*tri_array)[3][3] = static_cast( + float (*tri_array)[3][3] = static_cast( MEM_mallocN(resolu * sizeof(*tri_array), __func__)); - float(*tri_sta)[3], (*tri_end)[3], (*tri_tmp)[3]; + float (*tri_sta)[3], (*tri_end)[3], (*tri_tmp)[3]; /* very similar to make_bevel_list_3D_minimum_twist */ @@ -755,7 +755,7 @@ static void bm_edgering_pair_interpolate(BMesh *bm, break; } case SUBD_RING_INTERP_SURF: { - float(*coord_array)[3] = static_cast( + float (*coord_array)[3] = static_cast( MEM_mallocN(dims * (resolu) * sizeof(float), __func__)); /* calculate a bezier handle per edge ring */ diff --git a/source/blender/bmesh/operators/bmo_utils.cc b/source/blender/bmesh/operators/bmo_utils.cc index 4bf6d9d4fbf..f6fbf9f5f4b 100644 --- a/source/blender/bmesh/operators/bmo_utils.cc +++ b/source/blender/bmesh/operators/bmo_utils.cc @@ -60,7 +60,8 @@ void bmo_transform_exec(BMesh *bm, BMOperator *op) mul_m4_v3(mat, v->co); if (shape_keys_len != 0) { - float(*co_dst)[3] = static_cast(BM_ELEM_CD_GET_VOID_P(v, cd_shape_key_offset)); + float (*co_dst)[3] = static_cast( + BM_ELEM_CD_GET_VOID_P(v, cd_shape_key_offset)); for (int i = 0; i < shape_keys_len; i++, co_dst++) { mul_m4_v3(mat, *co_dst); } @@ -402,7 +403,7 @@ void bmo_smooth_vert_exec(BMesh * /*bm*/, BMOperator *op) BMIter iter; BMVert *v; BMEdge *e; - float(*cos)[3] = static_cast( + float (*cos)[3] = static_cast( MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_len(op->slots_in, "verts"), __func__)); float *co, *co2, clip_dist = BMO_slot_float_get(op->slots_in, "clip_dist"); const float fac = BMO_slot_float_get(op->slots_in, "factor"); @@ -546,7 +547,7 @@ static void bm_face_reverse_uvs(BMFace *f, const int cd_loop_uv_offset) BMLoop *l; int i; - float(*uvs)[2] = BLI_array_alloca(uvs, f->len); + float (*uvs)[2] = BLI_array_alloca(uvs, f->len); BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) { float *luv = BM_ELEM_CD_GET_FLOAT_P(l, cd_loop_uv_offset); diff --git a/source/blender/bmesh/tools/bmesh_bevel.cc b/source/blender/bmesh/tools/bmesh_bevel.cc index b94f42e1c1e..b95f953d409 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.cc +++ b/source/blender/bmesh/tools/bmesh_bevel.cc @@ -1211,7 +1211,7 @@ static void math_layer_info_init(BevelParams *bp, BMesh *bm) static BMFace *choose_rep_face(BevelParams *bp, BMFace **face, int nfaces) { #define VEC_VALUE_LEN 6 - float(*value_vecs)[VEC_VALUE_LEN] = nullptr; + float (*value_vecs)[VEC_VALUE_LEN] = nullptr; int num_viable = 0; value_vecs = BLI_array_alloca(value_vecs, nfaces); @@ -4969,7 +4969,7 @@ static float projected_boundary_area(BevVert *bv, BMFace *f) { BMEdge *e1, *e2; VMesh *vm = bv->vmesh; - float(*proj_co)[2] = BLI_array_alloca(proj_co, vm->count); + float (*proj_co)[2] = BLI_array_alloca(proj_co, vm->count); float axis_mat[3][3]; axis_dominant_v3_to_m3(axis_mat, f->no); get_incident_edges(f, bv->v, &e1, &e2); diff --git a/source/blender/bmesh/tools/bmesh_intersect.cc b/source/blender/bmesh/tools/bmesh_intersect.cc index 865fb0643f9..575c78106e8 100644 --- a/source/blender/bmesh/tools/bmesh_intersect.cc +++ b/source/blender/bmesh/tools/bmesh_intersect.cc @@ -1512,7 +1512,7 @@ bool BM_mesh_intersect(BMesh *bm, /* group vars */ int *groups_array; - int(*group_index)[2]; + int (*group_index)[2]; int group_tot; int i; BMFace **ftable; diff --git a/source/blender/bmesh/tools/bmesh_intersect_edges.cc b/source/blender/bmesh/tools/bmesh_intersect_edges.cc index 6ad93f98c48..4c22c24f6ba 100644 --- a/source/blender/bmesh/tools/bmesh_intersect_edges.cc +++ b/source/blender/bmesh/tools/bmesh_intersect_edges.cc @@ -96,7 +96,7 @@ static bool bm_vert_pair_share_splittable_face_cb(BMFace * /*f*/, BMLoop *l_b, void *userdata) { - float(*data)[3] = static_cast(userdata); + float (*data)[3] = static_cast(userdata); float *v_a_co = data[0]; float *v_a_b_dir = data[1]; const float range_min = -FLT_EPSILON; diff --git a/source/blender/compositor/intern/operation.cc b/source/blender/compositor/intern/operation.cc index 1b176d24fc5..a5ca2925ad9 100644 --- a/source/blender/compositor/intern/operation.cc +++ b/source/blender/compositor/intern/operation.cc @@ -133,7 +133,7 @@ void Operation::add_and_evaluate_input_processor(StringRef identifier, SimpleOpe processor->evaluate(); } -void Operation::compute_preview(){}; +void Operation::compute_preview() {}; Result &Operation::get_input(StringRef identifier) const { diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index 8d49a96351b..8635369b856 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -129,7 +129,7 @@ static int deg_debug_node_color_index(const Node *node) #endif #ifdef COLOR_SCHEME_NODE_TYPE - const int(*pair)[2]; + const int (*pair)[2]; for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) { if ((*pair)[0] == node->type) { return (*pair)[1]; @@ -179,7 +179,7 @@ static void deg_debug_graphviz_legend(DotExportContext &ctx) #endif #ifdef COLOR_SCHEME_NODE_TYPE - const int(*pair)[2]; + const int (*pair)[2]; for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) { DepsNodeFactory *nti = type_get_factory((NodeType)(*pair)[0]); deg_debug_graphviz_legend_color( diff --git a/source/blender/draw/engines/compositor/compositor_engine.cc b/source/blender/draw/engines/compositor/compositor_engine.cc index 302b78cfa4f..7fc38094854 100644 --- a/source/blender/draw/engines/compositor/compositor_engine.cc +++ b/source/blender/draw/engines/compositor/compositor_engine.cc @@ -212,11 +212,11 @@ class Instance : public DrawEngine { return "Compositor"; } - void init() final{}; - void begin_sync() final{}; + void init() final {}; + void begin_sync() final {}; void object_sync(blender::draw::ObjectRef & /*ob_ref*/, - blender::draw::Manager & /*manager*/) final{}; - void end_sync() final{}; + blender::draw::Manager & /*manager*/) final {}; + void end_sync() final {}; void draw(Manager & /*manager*/) final { diff --git a/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh b/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh index 38d78e72bfd..70dc45b50e6 100644 --- a/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh +++ b/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh @@ -40,8 +40,8 @@ class AmbientOcclusion { PassSimple render_pass_ps_ = {"AO Render Pass"}; public: - AmbientOcclusion(Instance &inst, AOData &data) : inst_(inst), data_(data){}; - ~AmbientOcclusion(){}; + AmbientOcclusion(Instance &inst, AOData &data) : inst_(inst), data_(data) {}; + ~AmbientOcclusion() {}; void init(); diff --git a/source/blender/draw/engines/eevee/eevee_camera.hh b/source/blender/draw/engines/eevee/eevee_camera.hh index 633b1e6313a..ab6f8934695 100644 --- a/source/blender/draw/engines/eevee/eevee_camera.hh +++ b/source/blender/draw/engines/eevee/eevee_camera.hh @@ -114,8 +114,8 @@ class Camera { bool camera_changed_ = false; public: - Camera(Instance &inst, CameraData &data) : inst_(inst), data_(data){}; - ~Camera(){}; + Camera(Instance &inst, CameraData &data) : inst_(inst), data_(data) {}; + ~Camera() {}; void init(); void sync(); diff --git a/source/blender/draw/engines/eevee/eevee_camera_shared.hh b/source/blender/draw/engines/eevee/eevee_camera_shared.hh index a8daaf7258c..b17ab1161a2 100644 --- a/source/blender/draw/engines/eevee/eevee_camera_shared.hh +++ b/source/blender/draw/engines/eevee/eevee_camera_shared.hh @@ -59,7 +59,7 @@ struct CameraData { #ifdef __cplusplus /* Small constructor to allow detecting new buffers. */ - CameraData() : initialized(false){}; + CameraData() : initialized(false) {}; #endif }; BLI_STATIC_ASSERT_ALIGN(CameraData, 16) diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.hh b/source/blender/draw/engines/eevee/eevee_cryptomatte.hh index 465a3c7601b..4da17e3a855 100644 --- a/source/blender/draw/engines/eevee/eevee_cryptomatte.hh +++ b/source/blender/draw/engines/eevee/eevee_cryptomatte.hh @@ -54,7 +54,7 @@ class Cryptomatte { CryptomatteObjectBuf cryptomatte_object_buf; public: - Cryptomatte(Instance &inst) : inst_(inst){}; + Cryptomatte(Instance &inst) : inst_(inst) {}; void begin_sync(); void sync_object(Object *ob, ResourceHandleRange res_handle); diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.hh b/source/blender/draw/engines/eevee/eevee_depth_of_field.hh index fbb343cdaf3..cd71c768e31 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.hh +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.hh @@ -161,8 +161,8 @@ class DepthOfField { bool enabled_ = false; public: - DepthOfField(Instance &inst) : inst_(inst){}; - ~DepthOfField(){}; + DepthOfField(Instance &inst) : inst_(inst) {}; + ~DepthOfField() {}; void init(); diff --git a/source/blender/draw/engines/eevee/eevee_film.hh b/source/blender/draw/engines/eevee/eevee_film.hh index 9f9f5624048..ca1dc3c0145 100644 --- a/source/blender/draw/engines/eevee/eevee_film.hh +++ b/source/blender/draw/engines/eevee/eevee_film.hh @@ -112,8 +112,8 @@ class Film { bool is_valid_render_extent_ = true; public: - Film(Instance &inst, FilmData &data) : inst_(inst), data_(data){}; - ~Film(){}; + Film(Instance &inst, FilmData &data) : inst_(inst), data_(data) {}; + ~Film() {}; void init(const int2 &full_extent, const rcti *output_rect); diff --git a/source/blender/draw/engines/eevee/eevee_instance.hh b/source/blender/draw/engines/eevee/eevee_instance.hh index ec64ba14939..b38c50d828a 100644 --- a/source/blender/draw/engines/eevee/eevee_instance.hh +++ b/source/blender/draw/engines/eevee/eevee_instance.hh @@ -201,8 +201,8 @@ class Instance : public DrawEngine { planar_probes(*this), volume_probes(*this), light_probes(*this), - volume(*this, uniform_data.data.volumes){}; - ~Instance(){}; + volume(*this, uniform_data.data.volumes) {}; + ~Instance() {}; blender::StringRefNull name_get() final { diff --git a/source/blender/draw/engines/eevee/eevee_light.hh b/source/blender/draw/engines/eevee/eevee_light.hh index ce31aed96df..44df0b98b72 100644 --- a/source/blender/draw/engines/eevee/eevee_light.hh +++ b/source/blender/draw/engines/eevee/eevee_light.hh @@ -175,7 +175,7 @@ class LightModule { PassSimple debug_draw_ps_ = {"LightCulling.Debug"}; public: - LightModule(Instance &inst) : inst_(inst){}; + LightModule(Instance &inst) : inst_(inst) {}; ~LightModule(); void begin_sync(); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobe.hh b/source/blender/draw/engines/eevee/eevee_lightprobe.hh index 5976d5b8797..ad20e49b011 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobe.hh +++ b/source/blender/draw/engines/eevee/eevee_lightprobe.hh @@ -231,7 +231,7 @@ class LightProbeModule { public: LightProbeModule(Instance &inst); - ~LightProbeModule(){}; + ~LightProbeModule() {}; void init(); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobe_sphere.hh b/source/blender/draw/engines/eevee/eevee_lightprobe_sphere.hh index 7fce511fb59..2b9e7be1185 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobe_sphere.hh +++ b/source/blender/draw/engines/eevee/eevee_lightprobe_sphere.hh @@ -112,7 +112,7 @@ class SphereProbeModule { PassSimple viewport_display_ps_ = {"ProbeSphereModule.Viewport Display"}; public: - SphereProbeModule(Instance &instance) : instance_(instance){}; + SphereProbeModule(Instance &instance) : instance_(instance) {}; void init(); void begin_sync(); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobe_volume.cc b/source/blender/draw/engines/eevee/eevee_lightprobe_volume.cc index 480add376d1..1dc40cdfa10 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobe_volume.cc +++ b/source/blender/draw/engines/eevee/eevee_lightprobe_volume.cc @@ -1335,7 +1335,7 @@ void IrradianceBake::read_virtual_offset(LightProbeGridCacheFrame *cache_frame) GPU_memory_barrier(GPU_BARRIER_TEXTURE_UPDATE); - cache_frame->baking.virtual_offset = (float(*)[4])virtual_offset_tx_.read( + cache_frame->baking.virtual_offset = (float (*)[4])virtual_offset_tx_.read( GPU_DATA_FLOAT); } @@ -1352,10 +1352,10 @@ LightProbeGridCacheFrame *IrradianceBake::read_result_unpacked() GPU_memory_barrier(GPU_BARRIER_TEXTURE_UPDATE); - cache_frame->baking.L0 = (float(*)[4])irradiance_L0_tx_.read(GPU_DATA_FLOAT); - cache_frame->baking.L1_a = (float(*)[4])irradiance_L1_a_tx_.read(GPU_DATA_FLOAT); - cache_frame->baking.L1_b = (float(*)[4])irradiance_L1_b_tx_.read(GPU_DATA_FLOAT); - cache_frame->baking.L1_c = (float(*)[4])irradiance_L1_c_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L0 = (float (*)[4])irradiance_L0_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L1_a = (float (*)[4])irradiance_L1_a_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L1_b = (float (*)[4])irradiance_L1_b_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L1_c = (float (*)[4])irradiance_L1_c_tx_.read(GPU_DATA_FLOAT); cache_frame->baking.validity = (float *)validity_tx_.read(GPU_DATA_FLOAT); return cache_frame; @@ -1374,20 +1374,20 @@ LightProbeGridCacheFrame *IrradianceBake::read_result_packed() GPU_memory_barrier(GPU_BARRIER_TEXTURE_UPDATE); - cache_frame->baking.L0 = (float(*)[4])irradiance_L0_tx_.read(GPU_DATA_FLOAT); - cache_frame->baking.L1_a = (float(*)[4])irradiance_L1_a_tx_.read(GPU_DATA_FLOAT); - cache_frame->baking.L1_b = (float(*)[4])irradiance_L1_b_tx_.read(GPU_DATA_FLOAT); - cache_frame->baking.L1_c = (float(*)[4])irradiance_L1_c_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L0 = (float (*)[4])irradiance_L0_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L1_a = (float (*)[4])irradiance_L1_a_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L1_b = (float (*)[4])irradiance_L1_b_tx_.read(GPU_DATA_FLOAT); + cache_frame->baking.L1_c = (float (*)[4])irradiance_L1_c_tx_.read(GPU_DATA_FLOAT); cache_frame->baking.validity = (float *)validity_tx_.read(GPU_DATA_FLOAT); int64_t sample_count = int64_t(irradiance_L0_tx_.width()) * irradiance_L0_tx_.height() * irradiance_L0_tx_.depth(); size_t coefficient_texture_size = sizeof(*cache_frame->irradiance.L0) * sample_count; size_t validity_texture_size = sizeof(*cache_frame->connectivity.validity) * sample_count; - cache_frame->irradiance.L0 = (float(*)[3])MEM_mallocN(coefficient_texture_size, __func__); - cache_frame->irradiance.L1_a = (float(*)[3])MEM_mallocN(coefficient_texture_size, __func__); - cache_frame->irradiance.L1_b = (float(*)[3])MEM_mallocN(coefficient_texture_size, __func__); - cache_frame->irradiance.L1_c = (float(*)[3])MEM_mallocN(coefficient_texture_size, __func__); + cache_frame->irradiance.L0 = (float (*)[3])MEM_mallocN(coefficient_texture_size, __func__); + cache_frame->irradiance.L1_a = (float (*)[3])MEM_mallocN(coefficient_texture_size, __func__); + cache_frame->irradiance.L1_b = (float (*)[3])MEM_mallocN(coefficient_texture_size, __func__); + cache_frame->irradiance.L1_c = (float (*)[3])MEM_mallocN(coefficient_texture_size, __func__); cache_frame->connectivity.validity = (uint8_t *)MEM_mallocN(validity_texture_size, __func__); size_t visibility_texture_size = sizeof(*cache_frame->irradiance.L0) * sample_count; diff --git a/source/blender/draw/engines/eevee/eevee_lightprobe_volume.hh b/source/blender/draw/engines/eevee/eevee_lightprobe_volume.hh index 9aae70df619..25be0f716fb 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobe_volume.hh +++ b/source/blender/draw/engines/eevee/eevee_lightprobe_volume.hh @@ -139,7 +139,7 @@ class IrradianceBake { bool do_break_ = false; public: - IrradianceBake(Instance &inst) : inst_(inst){}; + IrradianceBake(Instance &inst) : inst_(inst) {}; void init(const Object &probe_object); void sync(); @@ -233,8 +233,8 @@ class VolumeProbeModule { bool do_update_world_ = true; public: - VolumeProbeModule(Instance &inst) : bake(inst), inst_(inst){}; - ~VolumeProbeModule(){}; + VolumeProbeModule(Instance &inst) : bake(inst), inst_(inst) {}; + ~VolumeProbeModule() {}; void init(); void sync(); diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.hh b/source/blender/draw/engines/eevee/eevee_motion_blur.hh index 78ec6c199e4..ecfb7437d49 100644 --- a/source/blender/draw/engines/eevee/eevee_motion_blur.hh +++ b/source/blender/draw/engines/eevee/eevee_motion_blur.hh @@ -110,8 +110,8 @@ class MotionBlurModule { int3 dispatch_gather_size_ = int3(0); public: - MotionBlurModule(Instance &inst) : inst_(inst){}; - ~MotionBlurModule(){}; + MotionBlurModule(Instance &inst) : inst_(inst) {}; + ~MotionBlurModule() {}; void init(); diff --git a/source/blender/draw/engines/eevee/eevee_pipeline.hh b/source/blender/draw/engines/eevee/eevee_pipeline.hh index dddc8d47569..72b14ba598e 100644 --- a/source/blender/draw/engines/eevee/eevee_pipeline.hh +++ b/source/blender/draw/engines/eevee/eevee_pipeline.hh @@ -43,7 +43,7 @@ class BackgroundPipeline { PassSimple world_ps_ = {"World.Background"}; public: - BackgroundPipeline(Instance &inst) : inst_(inst){}; + BackgroundPipeline(Instance &inst) : inst_(inst) {}; void sync(GPUMaterial *gpumat, float background_opacity, float background_blur); void clear(View &view); @@ -71,7 +71,7 @@ class WorldPipeline { PassSimple cubemap_face_ps_ = {"World.Probe"}; public: - WorldPipeline(Instance &inst) : inst_(inst){}; + WorldPipeline(Instance &inst) : inst_(inst) {}; void sync(GPUMaterial *gpumat); void render(View &view); @@ -93,7 +93,7 @@ class WorldVolumePipeline { PassSimple world_ps_ = {"World.Volume"}; public: - WorldVolumePipeline(Instance &inst) : inst_(inst){}; + WorldVolumePipeline(Instance &inst) : inst_(inst) {}; void sync(GPUMaterial *gpumat); void render(View &view); @@ -117,7 +117,7 @@ class ShadowPipeline { PassMain::Sub *surface_single_sided_ps_ = nullptr; public: - ShadowPipeline(Instance &inst) : inst_(inst){}; + ShadowPipeline(Instance &inst) : inst_(inst) {}; PassMain::Sub *surface_material_add(::Material *material, GPUMaterial *gpumat); @@ -155,7 +155,7 @@ class ForwardPipeline { bool has_transparent_ = false; public: - ForwardPipeline(Instance &inst) : inst_(inst){}; + ForwardPipeline(Instance &inst) : inst_(inst) {}; void sync(); @@ -363,7 +363,7 @@ class DeferredPipeline { public: DeferredPipeline(Instance &inst) - : opaque_layer_(inst), refraction_layer_(inst), volumetric_layer_(inst){}; + : opaque_layer_(inst), refraction_layer_(inst), volumetric_layer_(inst) {}; void begin_sync(); void end_sync(); @@ -488,7 +488,7 @@ class VolumePipeline { bool has_absorption_ = false; public: - VolumePipeline(Instance &inst) : inst_(inst){}; + VolumePipeline(Instance &inst) : inst_(inst) {}; void sync(); void render(View &view, Texture &occupancy_tx); @@ -539,7 +539,7 @@ class DeferredProbePipeline { PassSimple eval_light_ps_ = {"EvalLights"}; public: - DeferredProbePipeline(Instance &inst) : inst_(inst){}; + DeferredProbePipeline(Instance &inst) : inst_(inst) {}; void begin_sync(); void end_sync(); @@ -585,7 +585,7 @@ class PlanarProbePipeline : DeferredLayerBase { PassSimple eval_light_ps_ = {"EvalLights"}; public: - PlanarProbePipeline(Instance &inst) : inst_(inst){}; + PlanarProbePipeline(Instance &inst) : inst_(inst) {}; void begin_sync(); void end_sync(); @@ -614,7 +614,7 @@ class CapturePipeline { PassMain surface_ps_ = {"Capture.Surface"}; public: - CapturePipeline(Instance &inst) : inst_(inst){}; + CapturePipeline(Instance &inst) : inst_(inst) {}; PassMain::Sub *surface_material_add(::Material *blender_mat, GPUMaterial *gpumat); @@ -735,7 +735,7 @@ class PipelineModule { shadow(inst), volume(inst), capture(inst), - data(data){}; + data(data) {}; void begin_sync() { diff --git a/source/blender/draw/engines/eevee/eevee_raytrace.hh b/source/blender/draw/engines/eevee/eevee_raytrace.hh index caae1ffe307..0a9855d43be 100644 --- a/source/blender/draw/engines/eevee/eevee_raytrace.hh +++ b/source/blender/draw/engines/eevee/eevee_raytrace.hh @@ -97,9 +97,9 @@ class RayTraceResultTexture { public: RayTraceResultTexture() = default; - RayTraceResultTexture(TextureFromPool &result) : result_(result.ptr()), tx_(result){}; + RayTraceResultTexture(TextureFromPool &result) : result_(result.ptr()), tx_(result) {}; RayTraceResultTexture(TextureFromPool &result, Texture &history) - : result_(result.ptr()), tx_(result), history_(history.ptr()){}; + : result_(result.ptr()), tx_(result), history_(history.ptr()) {}; operator gpu::Texture *() const { @@ -238,7 +238,7 @@ class RayTraceModule { RayTraceData &data_; public: - RayTraceModule(Instance &inst, RayTraceData &data) : inst_(inst), data_(data){}; + RayTraceModule(Instance &inst, RayTraceData &data) : inst_(inst), data_(data) {}; void init(); diff --git a/source/blender/draw/engines/eevee/eevee_renderbuffers.hh b/source/blender/draw/engines/eevee/eevee_renderbuffers.hh index ae66e28cdab..b8f92dd0cb1 100644 --- a/source/blender/draw/engines/eevee/eevee_renderbuffers.hh +++ b/source/blender/draw/engines/eevee/eevee_renderbuffers.hh @@ -43,7 +43,7 @@ class RenderBuffers { int2 extent_; public: - RenderBuffers(Instance &inst, RenderBuffersInfoData &data) : data(data), inst_(inst){}; + RenderBuffers(Instance &inst, RenderBuffersInfoData &data) : data(data), inst_(inst) {}; /** WARNING: RenderBuffers and Film use different storage types for AO and Shadow. */ static ePassStorageType pass_storage_type(eViewLayerEEVEEPassType pass_type) diff --git a/source/blender/draw/engines/eevee/eevee_sampling.hh b/source/blender/draw/engines/eevee/eevee_sampling.hh index b0fca8068ee..1a11ebe5581 100644 --- a/source/blender/draw/engines/eevee/eevee_sampling.hh +++ b/source/blender/draw/engines/eevee/eevee_sampling.hh @@ -69,8 +69,8 @@ class Sampling { ClampData &clamp_data_; public: - Sampling(Instance &inst, ClampData &clamp_data) : inst_(inst), clamp_data_(clamp_data){}; - ~Sampling(){}; + Sampling(Instance &inst, ClampData &clamp_data) : inst_(inst), clamp_data_(clamp_data) {}; + ~Sampling() {}; void init(const Scene *scene); void init(const Object &probe_object); diff --git a/source/blender/draw/engines/eevee/eevee_shadow.cc b/source/blender/draw/engines/eevee/eevee_shadow.cc index 8cf77d8ad4f..173ec6813dc 100644 --- a/source/blender/draw/engines/eevee/eevee_shadow.cc +++ b/source/blender/draw/engines/eevee/eevee_shadow.cc @@ -1378,7 +1378,7 @@ void ShadowModule::set_view(View &view, int2 extent) } GPU_framebuffer_multi_viewports_set(render_fb_, - reinterpret_cast(multi_viewports_.data())); + reinterpret_cast(multi_viewports_.data())); inst_.pipelines.shadow.render(shadow_multi_view_); diff --git a/source/blender/draw/engines/eevee/eevee_shadow.hh b/source/blender/draw/engines/eevee/eevee_shadow.hh index fa5a32e915f..3a2e43b5368 100644 --- a/source/blender/draw/engines/eevee/eevee_shadow.hh +++ b/source/blender/draw/engines/eevee/eevee_shadow.hh @@ -433,9 +433,9 @@ class ShadowPunctual : public NonCopyable, NonMovable { Vector tilemaps_; public: - ShadowPunctual(ShadowModule &module) : shadows_(module){}; + ShadowPunctual(ShadowModule &module) : shadows_(module) {}; ShadowPunctual(ShadowPunctual &&other) - : shadows_(other.shadows_), tilemaps_(std::move(other.tilemaps_)){}; + : shadows_(other.shadows_), tilemaps_(std::move(other.tilemaps_)) {}; ~ShadowPunctual() { @@ -462,9 +462,9 @@ class ShadowDirectional : public NonCopyable, NonMovable { IndexRange levels_range = IndexRange(0); public: - ShadowDirectional(ShadowModule &module) : shadows_(module){}; + ShadowDirectional(ShadowModule &module) : shadows_(module) {}; ShadowDirectional(ShadowDirectional &&other) - : shadows_(other.shadows_), tilemaps_(std::move(other.tilemaps_)){}; + : shadows_(other.shadows_), tilemaps_(std::move(other.tilemaps_)) {}; ~ShadowDirectional() { diff --git a/source/blender/draw/engines/eevee/eevee_subsurface.hh b/source/blender/draw/engines/eevee/eevee_subsurface.hh index ef29a81ed50..18a0c33c046 100644 --- a/source/blender/draw/engines/eevee/eevee_subsurface.hh +++ b/source/blender/draw/engines/eevee/eevee_subsurface.hh @@ -62,7 +62,7 @@ struct SubsurfaceModule { data_.sample_len = -1; }; - ~SubsurfaceModule(){}; + ~SubsurfaceModule() {}; void end_sync(); diff --git a/source/blender/draw/engines/eevee/eevee_sync.hh b/source/blender/draw/engines/eevee/eevee_sync.hh index b31727af2f6..fa7aceafa49 100644 --- a/source/blender/draw/engines/eevee/eevee_sync.hh +++ b/source/blender/draw/engines/eevee/eevee_sync.hh @@ -49,8 +49,8 @@ class SyncModule { Map ob_handles = {}; public: - SyncModule(Instance &inst) : inst_(inst){}; - ~SyncModule(){}; + SyncModule(Instance &inst) : inst_(inst) {}; + ~SyncModule() {}; ObjectHandle &sync_object(const ObjectRef &ob_ref); WorldHandle sync_world(const ::World &world); diff --git a/source/blender/draw/engines/eevee/eevee_velocity_shared.hh b/source/blender/draw/engines/eevee/eevee_velocity_shared.hh index 045450922b7..f344c777d28 100644 --- a/source/blender/draw/engines/eevee/eevee_velocity_shared.hh +++ b/source/blender/draw/engines/eevee/eevee_velocity_shared.hh @@ -29,7 +29,7 @@ struct VelocityObjectIndex { uint resource_id; #ifndef GPU_SHADER - VelocityObjectIndex() : ofs(-1, -1, -1), resource_id(-1){}; + VelocityObjectIndex() : ofs(-1, -1, -1), resource_id(-1) {}; #endif }; BLI_STATIC_ASSERT_ALIGN(VelocityObjectIndex, 16) @@ -48,7 +48,7 @@ struct VelocityGeometryIndex { int _pad0; #ifndef GPU_SHADER - VelocityGeometryIndex() : ofs(-1, -1, -1), do_deform(false), len(-1, -1, -1), _pad0(1){}; + VelocityGeometryIndex() : ofs(-1, -1, -1), do_deform(false), len(-1, -1, -1), _pad0(1) {}; #endif }; BLI_STATIC_ASSERT_ALIGN(VelocityGeometryIndex, 16) diff --git a/source/blender/draw/engines/eevee/eevee_view.hh b/source/blender/draw/engines/eevee/eevee_view.hh index c4e898c61c3..6ef2aa4b829 100644 --- a/source/blender/draw/engines/eevee/eevee_view.hh +++ b/source/blender/draw/engines/eevee/eevee_view.hh @@ -69,9 +69,9 @@ class ShadingView { public: ShadingView(Instance &inst, const char *name, const float4x4 &face_matrix) - : inst_(inst), name_(name), face_matrix_(face_matrix), render_view_(name){}; + : inst_(inst), name_(name), face_matrix_(face_matrix), render_view_(name) {}; - ~ShadingView(){}; + ~ShadingView() {}; void init(); diff --git a/source/blender/draw/engines/eevee/eevee_world.hh b/source/blender/draw/engines/eevee/eevee_world.hh index b3f967c2ec0..427c683cffc 100644 --- a/source/blender/draw/engines/eevee/eevee_world.hh +++ b/source/blender/draw/engines/eevee/eevee_world.hh @@ -60,7 +60,7 @@ class World { LookdevWorld lookdev_world_; public: - World(Instance &inst) : inst_(inst){}; + World(Instance &inst) : inst_(inst) {}; ~World(); /* Setup and request the background shader. */ diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_data.cc b/source/blender/draw/engines/gpencil/gpencil_draw_data.cc index 7ccb4be1df2..28cc01daba7 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_data.cc +++ b/source/blender/draw/engines/gpencil/gpencil_draw_data.cc @@ -268,7 +268,7 @@ MaterialPool *gpencil_material_pool_create(Instance *inst, gpencil_uv_transform_get(gp_style->texture_offset, gp_style->texture_scale, gp_style->texture_angle, - reinterpret_cast(&mat_data->fill_uv_rot_scale), + reinterpret_cast(&mat_data->fill_uv_rot_scale), mat_data->fill_uv_offset); copy_v4_v4(mat_data->fill_color, gp_style->fill_rgba); mat_data->fill_texture_mix = 1.0f - gp_style->mix_factor; @@ -281,7 +281,7 @@ MaterialPool *gpencil_material_pool_create(Instance *inst, gpencil_uv_transform_get(gp_style->texture_offset, gp_style->texture_scale, gp_style->texture_angle, - reinterpret_cast(&mat_data->fill_uv_rot_scale), + reinterpret_cast(&mat_data->fill_uv_rot_scale), mat_data->fill_uv_offset); copy_v4_v4(mat_data->fill_color, gp_style->fill_rgba); copy_v4_v4(mat_data->fill_mix_color, gp_style->mix_rgba); @@ -379,7 +379,7 @@ void gpencil_light_pool_populate(LightPool *lightpool, Object *ob) } gpLight *gp_light = &lightpool->light_data[lightpool->light_used]; - float(*mat)[4] = reinterpret_cast(&gp_light->right); + float (*mat)[4] = reinterpret_cast(&gp_light->right); if (light.type == LA_SPOT) { copy_m4_m4(mat, ob->world_to_object().ptr()); diff --git a/source/blender/draw/engines/overlay/overlay_armature.cc b/source/blender/draw/engines/overlay/overlay_armature.cc index d8205bb132e..3bdef58588f 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.cc +++ b/source/blender/draw/engines/overlay/overlay_armature.cc @@ -938,9 +938,9 @@ static void draw_bone_update_disp_matrix_default(UnifiedBonePtr bone) { float ebmat[4][4]; float bone_scale[3]; - float(*bone_mat)[4]; - float(*disp_mat)[4] = bone.disp_mat(); - float(*disp_tail_mat)[4] = bone.disp_tail_mat(); + float (*bone_mat)[4]; + float (*disp_mat)[4] = bone.disp_mat(); + float (*disp_tail_mat)[4] = bone.disp_tail_mat(); /* TODO: This should be moved to depsgraph or armature refresh * and not be tied to the draw pass creation. @@ -968,9 +968,9 @@ static void draw_bone_update_disp_matrix_default(UnifiedBonePtr bone) static void draw_bone_update_disp_matrix_custom_shape(UnifiedBonePtr bone) { float bone_scale[3]; - float(*bone_mat)[4]; - float(*disp_mat)[4]; - float(*disp_tail_mat)[4]; + float (*bone_mat)[4]; + float (*disp_mat)[4]; + float (*disp_tail_mat)[4]; float rot_mat[3][3]; /* Custom bone shapes are only supported in pose mode for now. */ @@ -1132,7 +1132,7 @@ static void draw_bone_update_disp_matrix_bbone(UnifiedBonePtr bone) { float s[4][4], ebmat[4][4]; float length, xwidth, zwidth; - float(*bone_mat)[4]; + float (*bone_mat)[4]; short bbone_segments; /* TODO: This should be moved to depsgraph or armature refresh @@ -1181,7 +1181,7 @@ static void draw_bone_update_disp_matrix_bbone(UnifiedBonePtr bone) } else { EditBone *eBone = bone.as_editbone(); - float(*bbones_mat)[4][4] = eBone->disp_bbone_mat; + float (*bbones_mat)[4][4] = eBone->disp_bbone_mat; if (bbone_segments > 1) { ebone_spline_preview(eBone, bbones_mat); @@ -1325,7 +1325,7 @@ static void bone_draw_custom_shape(const Armatures::DrawContext *ctx, const float *col_solid = get_bone_solid_color(ctx, boneflag); const float *col_wire = get_bone_wire_color(ctx, boneflag); const float *col_hint = get_bone_hint_color(ctx, boneflag); - const float(*disp_mat)[4] = bone.disp_mat(); + const float (*disp_mat)[4] = bone.disp_mat(); auto sel_id = ctx->res->select_id(*ctx->ob_ref, select_id | BONESEL_BONE); diff --git a/source/blender/draw/engines/overlay/overlay_armature.hh b/source/blender/draw/engines/overlay/overlay_armature.hh index 3c685921ce7..5d8ae81e0e6 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.hh +++ b/source/blender/draw/engines/overlay/overlay_armature.hh @@ -135,14 +135,14 @@ class Armatures : Overlay { }); } - BoneBuffers(const SelectionType selection_type) : selection_type_(selection_type){}; + BoneBuffers(const SelectionType selection_type) : selection_type_(selection_type) {}; }; BoneBuffers opaque_ = {selection_type_}; BoneBuffers transparent_ = {selection_type_}; public: - Armatures(const SelectionType selection_type) : selection_type_(selection_type){}; + Armatures(const SelectionType selection_type) : selection_type_(selection_type) {}; void begin_sync(Resources &res, const State &state) final { diff --git a/source/blender/draw/engines/overlay/overlay_base.hh b/source/blender/draw/engines/overlay/overlay_base.hh index 7680ecfe3fc..885e28e30c3 100644 --- a/source/blender/draw/engines/overlay/overlay_base.hh +++ b/source/blender/draw/engines/overlay/overlay_base.hh @@ -63,7 +63,7 @@ struct Overlay { virtual void object_sync(Manager & /*manager*/, const ObjectRef & /*ob_ref*/, Resources & /*res*/, - const State & /*state*/){}; + const State & /*state*/) {}; /** * Fills passes or buffers for each object in edit mode. @@ -74,20 +74,20 @@ struct Overlay { virtual void edit_object_sync(Manager & /*manager*/, const ObjectRef & /*ob_ref*/, Resources & /*res*/, - const State & /*state*/){}; + const State & /*state*/) {}; /** * Finalize passes or buffers used for object sync. * Runs once at the start of the sync cycle. */ - virtual void end_sync(Resources & /*res*/, const State & /*state*/){}; + virtual void end_sync(Resources & /*res*/, const State & /*state*/) {}; /** * Warms #PassMain and #PassSortable to avoid overhead of pipeline switching. * Should only contains calls to `generate_commands`. * NOTE: `view` is guaranteed to be the same view that will be passed to the draw functions. */ - virtual void pre_draw(Manager & /*manager*/, View & /*view*/){}; + virtual void pre_draw(Manager & /*manager*/, View & /*view*/) {}; /** * Drawing can be split into multiple passes. Each callback draws onto a specific frame-buffer. @@ -96,12 +96,13 @@ struct Overlay { * resolving to the given frame-buffer. */ - virtual void draw_on_render(gpu::FrameBuffer * /*fb*/, Manager & /*manager*/, View & /*view*/){}; - virtual void draw(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/){}; - virtual void draw_line(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/){}; - virtual void draw_line_only(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/){}; - virtual void draw_color_only(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/){}; - virtual void draw_output(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/){}; + virtual void draw_on_render(gpu::FrameBuffer * /*fb*/, Manager & /*manager*/, View & /*view*/) { + }; + virtual void draw(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/) {}; + virtual void draw_line(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/) {}; + virtual void draw_line_only(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/) {}; + virtual void draw_color_only(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/) {}; + virtual void draw_output(Framebuffer & /*fb*/, Manager & /*manager*/, View & /*view*/) {}; }; } // namespace blender::draw::overlay diff --git a/source/blender/draw/engines/overlay/overlay_camera.hh b/source/blender/draw/engines/overlay/overlay_camera.hh index c0e5ed3e730..292043ec224 100644 --- a/source/blender/draw/engines/overlay/overlay_camera.hh +++ b/source/blender/draw/engines/overlay/overlay_camera.hh @@ -44,7 +44,7 @@ struct CameraInstanceData : public ExtraInstanceData { } CameraInstanceData(const float4x4 &p_matrix, const float4 &color) - : ExtraInstanceData(p_matrix, color, 1.0f){}; + : ExtraInstanceData(p_matrix, color, 1.0f) {}; }; /** diff --git a/source/blender/draw/engines/overlay/overlay_fluid.hh b/source/blender/draw/engines/overlay/overlay_fluid.hh index 2b9972bb27e..70342f8bdc5 100644 --- a/source/blender/draw/engines/overlay/overlay_fluid.hh +++ b/source/blender/draw/engines/overlay/overlay_fluid.hh @@ -37,7 +37,7 @@ class Fluids : Overlay { int dominant_axis = -1; public: - Fluids(const SelectionType selection_type) : selection_type_(selection_type){}; + Fluids(const SelectionType selection_type) : selection_type_(selection_type) {}; void begin_sync(Resources &res, const State &state) final { diff --git a/source/blender/draw/engines/overlay/overlay_instance.hh b/source/blender/draw/engines/overlay/overlay_instance.hh index f05a93684c6..fbf50b1e596 100644 --- a/source/blender/draw/engines/overlay/overlay_instance.hh +++ b/source/blender/draw/engines/overlay/overlay_instance.hh @@ -112,8 +112,8 @@ class Instance : public DrawEngine { AntiAliasing anti_aliasing; XrayFade xray_fade; - Instance() : selection_type_(select::SelectionType::DISABLED){}; - Instance(const SelectionType selection_type) : selection_type_(selection_type){}; + Instance() : selection_type_(select::SelectionType::DISABLED) {}; + Instance(const SelectionType selection_type) : selection_type_(selection_type) {}; ~Instance() { DRW_text_cache_destroy(state.dt); diff --git a/source/blender/draw/engines/overlay/overlay_light.hh b/source/blender/draw/engines/overlay/overlay_light.hh index 5841963b812..75a5697fcf2 100644 --- a/source/blender/draw/engines/overlay/overlay_light.hh +++ b/source/blender/draw/engines/overlay/overlay_light.hh @@ -41,7 +41,7 @@ class Lights : Overlay { } call_buffers_{selection_type_}; public: - Lights(const SelectionType selection_type) : selection_type_(selection_type){}; + Lights(const SelectionType selection_type) : selection_type_(selection_type) {}; void begin_sync(Resources & /*res*/, const State &state) final { diff --git a/source/blender/draw/engines/overlay/overlay_lightprobe.hh b/source/blender/draw/engines/overlay/overlay_lightprobe.hh index 33266032722..a7e5fb8efe1 100644 --- a/source/blender/draw/engines/overlay/overlay_lightprobe.hh +++ b/source/blender/draw/engines/overlay/overlay_lightprobe.hh @@ -43,7 +43,7 @@ class LightProbes : Overlay { } call_buffers_{selection_type_}; public: - LightProbes(const SelectionType selection_type) : selection_type_(selection_type){}; + LightProbes(const SelectionType selection_type) : selection_type_(selection_type) {}; void begin_sync(Resources &res, const State &state) final { diff --git a/source/blender/draw/engines/overlay/overlay_metaball.hh b/source/blender/draw/engines/overlay/overlay_metaball.hh index 5ced4d108bf..114051a0efc 100644 --- a/source/blender/draw/engines/overlay/overlay_metaball.hh +++ b/source/blender/draw/engines/overlay/overlay_metaball.hh @@ -30,7 +30,7 @@ class Metaballs : Overlay { SphereOutlineInstanceBuf circle_buf_ = {selection_type_, "metaball_data_buf"}; public: - Metaballs(const SelectionType selection_type) : selection_type_(selection_type){}; + Metaballs(const SelectionType selection_type) : selection_type_(selection_type) {}; void begin_sync(Resources & /*res*/, const State & /*state*/) final { diff --git a/source/blender/draw/engines/overlay/overlay_private.hh b/source/blender/draw/engines/overlay/overlay_private.hh index 931357539eb..5380a57ad74 100644 --- a/source/blender/draw/engines/overlay/overlay_private.hh +++ b/source/blender/draw/engines/overlay/overlay_private.hh @@ -568,7 +568,7 @@ class ShaderModule { private: ShaderModule(const SelectionType selection_type, const bool clipping_enabled) - : selection_type_(selection_type), clipping_enabled_(clipping_enabled){}; + : selection_type_(selection_type), clipping_enabled_(clipping_enabled) {}; StaticShader shader_clippable(const char *create_info_name); StaticShader shader_selectable(const char *create_info_name); @@ -671,7 +671,7 @@ struct Resources : public select::SelectMap { const ShapeCache &shapes; Resources(const SelectionType selection_type_, const ShapeCache &shapes_) - : select::SelectMap(selection_type_), shapes(shapes_){}; + : select::SelectMap(selection_type_), shapes(shapes_) {}; ~Resources() { @@ -1044,7 +1044,7 @@ template struct ShapeInstanceBuf : private select::Selec StorageVectorBuffer data_buf; ShapeInstanceBuf(const SelectionType selection_type, const char *name = nullptr) - : select::SelectBuf(selection_type), data_buf(name){}; + : select::SelectBuf(selection_type), data_buf(name) {}; void clear() { @@ -1091,7 +1091,7 @@ struct VertexPrimitiveBuf { int color_id = 0; VertexPrimitiveBuf(const SelectionType selection_type, const char *name = nullptr) - : select_buf(selection_type), data_buf(name){}; + : select_buf(selection_type), data_buf(name) {}; void append(const float3 &position, const float4 &color) { diff --git a/source/blender/draw/engines/overlay/overlay_shader_shared.hh b/source/blender/draw/engines/overlay/overlay_shader_shared.hh index d23542d4e55..dc7848bd58c 100644 --- a/source/blender/draw/engines/overlay/overlay_shader_shared.hh +++ b/source/blender/draw/engines/overlay/overlay_shader_shared.hh @@ -404,7 +404,7 @@ struct BoneEnvelopeData { tail_sphere(tail_sphere), bone_color_and_wire_width(bone_color, 0.0f), state_color(state_color, 0.0f), - x_axis(x_axis, 0.0f){}; + x_axis(x_axis, 0.0f) {}; /* For bone outlines. */ BoneEnvelopeData(float4 &head_sphere, @@ -414,11 +414,11 @@ struct BoneEnvelopeData { : head_sphere(head_sphere), tail_sphere(tail_sphere), bone_color_and_wire_width(color_and_wire_width), - x_axis(x_axis, 0.0f){}; + x_axis(x_axis, 0.0f) {}; /* For bone distance volumes. */ BoneEnvelopeData(float4 &head_sphere, float4 &tail_sphere, float3 &x_axis) - : head_sphere(head_sphere), tail_sphere(tail_sphere), x_axis(x_axis, 0.0f){}; + : head_sphere(head_sphere), tail_sphere(tail_sphere), x_axis(x_axis, 0.0f) {}; #endif }; BLI_STATIC_ASSERT_ALIGN(BoneEnvelopeData, 16) @@ -446,7 +446,7 @@ struct BoneStickData { wire_color(wire_color), bone_color(bone_color), head_color(head_color), - tail_color(tail_color){}; + tail_color(tail_color) {}; #endif }; BLI_STATIC_ASSERT_ALIGN(BoneStickData, 16) diff --git a/source/blender/draw/engines/overlay/overlay_shape.cc b/source/blender/draw/engines/overlay/overlay_shape.cc index 6e6a6ba8990..8d82e6ee32d 100644 --- a/source/blender/draw/engines/overlay/overlay_shape.cc +++ b/source/blender/draw/engines/overlay/overlay_shape.cc @@ -770,14 +770,14 @@ ShapeCache::ShapeCache() float2(-1.0f, -1.0f) * axis_marker_scale, float2(-1.0f, 1.0f) * axis_marker_scale, #else /* diamond */ - float2(-1.0f, 0.0f) * axis_marker_scale, - float2(0.0f, 1.0f) * axis_marker_scale, - float2(0.0f, 1.0f) * axis_marker_scale, - float2(1.0f, 0.0f) * axis_marker_scale, - float2(1.0f, 0.0f) * axis_marker_scale, - float2(0.0f, -1.0f) * axis_marker_scale, - float2(0.0f, -1.0f) * axis_marker_scale, - float2(-1.0f, 0.0f) * axis_marker_scale, + float2(-1.0f, 0.0f) * axis_marker_scale, + float2(0.0f, 1.0f) * axis_marker_scale, + float2(0.0f, 1.0f) * axis_marker_scale, + float2(1.0f, 0.0f) * axis_marker_scale, + float2(1.0f, 0.0f) * axis_marker_scale, + float2(0.0f, -1.0f) * axis_marker_scale, + float2(0.0f, -1.0f) * axis_marker_scale, + float2(-1.0f, 0.0f) * axis_marker_scale, #endif }; diff --git a/source/blender/draw/engines/overlay/overlay_speaker.hh b/source/blender/draw/engines/overlay/overlay_speaker.hh index 43d4e07e2fd..3b3afa9235f 100644 --- a/source/blender/draw/engines/overlay/overlay_speaker.hh +++ b/source/blender/draw/engines/overlay/overlay_speaker.hh @@ -28,7 +28,7 @@ class Speakers : Overlay { SpeakerInstanceBuf speaker_buf_ = {selection_type_, "speaker_data_buf"}; public: - Speakers(const SelectionType selection_type) : selection_type_(selection_type){}; + Speakers(const SelectionType selection_type) : selection_type_(selection_type) {}; void begin_sync(Resources & /*res*/, const State &state) final { diff --git a/source/blender/draw/engines/select/select_debug_engine.cc b/source/blender/draw/engines/select/select_debug_engine.cc index 7e770ad7828..3a9d98b43e7 100644 --- a/source/blender/draw/engines/select/select_debug_engine.cc +++ b/source/blender/draw/engines/select/select_debug_engine.cc @@ -55,11 +55,11 @@ class Instance : public DrawEngine { return "Select ID Debug"; } - void init() final{}; - void begin_sync() final{}; + void init() final {}; + void begin_sync() final {}; void object_sync(blender::draw::ObjectRef & /*ob_ref*/, - blender::draw::Manager & /*manager*/) final{}; - void end_sync() final{}; + blender::draw::Manager & /*manager*/) final {}; + void end_sync() final {}; void draw(blender::draw::Manager &manager) final { diff --git a/source/blender/draw/engines/select/select_instance.cc b/source/blender/draw/engines/select/select_instance.cc index f28b9cc1e72..72a4e27aef7 100644 --- a/source/blender/draw/engines/select/select_instance.cc +++ b/source/blender/draw/engines/select/select_instance.cc @@ -17,7 +17,7 @@ namespace blender::draw::select { class Instance : public overlay::Instance { public: - Instance() : overlay::Instance(SelectionType::ENABLED){}; + Instance() : overlay::Instance(SelectionType::ENABLED) {}; }; DrawEngine *Engine::create_instance() diff --git a/source/blender/draw/engines/select/select_instance.hh b/source/blender/draw/engines/select/select_instance.hh index f68404f21d9..c34844afba1 100644 --- a/source/blender/draw/engines/select/select_instance.hh +++ b/source/blender/draw/engines/select/select_instance.hh @@ -35,7 +35,7 @@ class ID { uint32_t value; /* Add type safety to selection ID. Only the select types should provide them. */ - ID(uint32_t value) : value(value){}; + ID(uint32_t value) : value(value) {}; friend struct SelectBuf; friend struct SelectMap; @@ -56,7 +56,7 @@ struct SelectBuf { StorageVectorBuffer select_buf = {"select_buf"}; - SelectBuf(const SelectionType selection_type) : selection_type(selection_type){}; + SelectBuf(const SelectionType selection_type) : selection_type(selection_type) {}; void select_clear() { @@ -105,7 +105,7 @@ struct SelectMap { /** If clipping is enabled, this is the number of clip planes to enable. */ int clipping_plane_count = 0; - SelectMap(const SelectionType selection_type) : selection_type(selection_type){}; + SelectMap(const SelectionType selection_type) : selection_type(selection_type) {}; /* TODO(fclem): The sub_object_id id should eventually become some enum or take a sub-object * reference directly. This would isolate the selection logic to this class. */ diff --git a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc index 45c65b5d72a..f4de809aec1 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc +++ b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc @@ -13,7 +13,7 @@ namespace blender::workbench { class TaaSamples { void init_samples(MutableSpan samples) { - BLI_jitter_init(reinterpret_cast(samples.data()), samples.size()); + BLI_jitter_init(reinterpret_cast(samples.data()), samples.size()); /* Find closest element to center */ int closest_index = 0; diff --git a/source/blender/draw/engines/workbench/workbench_engine.cc b/source/blender/draw/engines/workbench/workbench_engine.cc index 41cb811f651..68d1a115ab2 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.cc +++ b/source/blender/draw/engines/workbench/workbench_engine.cc @@ -478,7 +478,7 @@ class Instance : public DrawEngine { id_attachment); resources_.clear_fb.bind(); float4 clear_colors[2] = {scene_state_.background_color, float4(0.0f)}; - GPU_framebuffer_multi_clear(resources_.clear_fb, reinterpret_cast(clear_colors)); + GPU_framebuffer_multi_clear(resources_.clear_fb, reinterpret_cast(clear_colors)); GPU_framebuffer_clear_depth_stencil(resources_.clear_fb, 1.0f, 0x00); opaque_ps_.draw( diff --git a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc index 2dce916b770..681509fc1a3 100644 --- a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc +++ b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc @@ -10,7 +10,7 @@ namespace blender::workbench { /** \name MeshPass * \{ */ -MeshPass::MeshPass(const char *name) : PassMain(name){}; +MeshPass::MeshPass(const char *name) : PassMain(name) {}; bool MeshPass::is_empty() const { diff --git a/source/blender/draw/engines/workbench/workbench_private.hh b/source/blender/draw/engines/workbench/workbench_private.hh index ca6d2c83d78..c2b8770327c 100644 --- a/source/blender/draw/engines/workbench/workbench_private.hh +++ b/source/blender/draw/engines/workbench/workbench_private.hh @@ -398,7 +398,7 @@ class ShadowPass { VisibilityBuf fail_visibility_buf_ = {}; public: - ShadowView() : View("ShadowPass.View"){}; + ShadowView() : View("ShadowPass.View") {}; void setup(View &view, float3 light_direction, bool force_fail_method); bool debug_object_culling(Object *ob); diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 93eca474887..cf2724ae64c 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -416,7 +416,7 @@ class StorageVectorBuffer : public StorageArrayBuffer { int64_t item_len_ = 0; public: - StorageVectorBuffer(const char *name = nullptr) : StorageArrayBuffer(name){}; + StorageVectorBuffer(const char *name = nullptr) : StorageArrayBuffer(name) {}; ~StorageVectorBuffer() = default; /** @@ -1065,7 +1065,7 @@ class Texture : NonCopyable { class TextureFromPool : public Texture, NonMovable { public: - TextureFromPool(const char *name = "gpu::Texture") : Texture(name){}; + TextureFromPool(const char *name = "gpu::Texture") : Texture(name) {}; /* Always use `release()` after rendering. */ void acquire(int2 extent, @@ -1205,8 +1205,8 @@ class Framebuffer : NonCopyable { const char *name_; public: - Framebuffer() : name_(""){}; - Framebuffer(const char *name) : name_(name){}; + Framebuffer() : name_("") {}; + Framebuffer(const char *name) : name_(name) {}; ~Framebuffer() { diff --git a/source/blender/draw/intern/draw_cache_impl_particles.cc b/source/blender/draw/intern/draw_cache_impl_particles.cc index e85c8e6f903..52fc617a6d9 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.cc +++ b/source/blender/draw/intern/draw_cache_impl_particles.cc @@ -607,7 +607,7 @@ static int particle_batch_cache_fill_segments(ParticleSystem *psys, const bool is_child = (particle_source == PARTICLE_SOURCE_CHILDREN); if (is_simple && *r_parent_uvs == nullptr) { /* TODO(sergey): For edit mode it should be edit->totcached. */ - *r_parent_uvs = static_cast( + *r_parent_uvs = static_cast( MEM_callocN(sizeof(*r_parent_uvs) * psys->totpart, "Parent particle UVs")); } if (is_simple && *r_parent_mcol == nullptr) { @@ -621,7 +621,7 @@ static int particle_batch_cache_fill_segments(ParticleSystem *psys, continue; } float tangent[3]; - float(*uv)[2] = nullptr; + float (*uv)[2] = nullptr; MCol *mcol = nullptr; particle_calculate_mcol(psys, psmd, @@ -786,7 +786,7 @@ static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit, int active_col = 0; const MTFace **mtfaces = nullptr; const MCol **mcols = nullptr; - float(**parent_uvs)[2] = nullptr; + float (**parent_uvs)[2] = nullptr; MCol **parent_mcol = nullptr; if (psmd != nullptr) { diff --git a/source/blender/draw/intern/draw_command.cc b/source/blender/draw/intern/draw_command.cc index 1d33cbc3ac6..59c7dcb1a34 100644 --- a/source/blender/draw/intern/draw_command.cc +++ b/source/blender/draw/intern/draw_command.cc @@ -291,7 +291,7 @@ void Clear::execute() const void ClearMulti::execute() const { gpu::FrameBuffer *fb = GPU_framebuffer_active_get(); - GPU_framebuffer_multi_clear(fb, (const float(*)[4])colors); + GPU_framebuffer_multi_clear(fb, (const float (*)[4])colors); } void StateSet::execute(RecordingState &recording_state) const diff --git a/source/blender/draw/intern/draw_command.hh b/source/blender/draw/intern/draw_command.hh index 57903f9609c..e9687d26008 100644 --- a/source/blender/draw/intern/draw_command.hh +++ b/source/blender/draw/intern/draw_command.hh @@ -193,37 +193,37 @@ struct ResourceBind { ResourceBind() = default; ResourceBind(int slot_, gpu::UniformBuf *res) - : slot(slot_), is_reference(false), type(Type::UniformBuf), uniform_buf(res){}; + : slot(slot_), is_reference(false), type(Type::UniformBuf), uniform_buf(res) {}; ResourceBind(int slot_, gpu::UniformBuf **res) - : slot(slot_), is_reference(true), type(Type::UniformBuf), uniform_buf_ref(res){}; + : slot(slot_), is_reference(true), type(Type::UniformBuf), uniform_buf_ref(res) {}; ResourceBind(int slot_, gpu::StorageBuf *res) - : slot(slot_), is_reference(false), type(Type::StorageBuf), storage_buf(res){}; + : slot(slot_), is_reference(false), type(Type::StorageBuf), storage_buf(res) {}; ResourceBind(int slot_, gpu::StorageBuf **res) - : slot(slot_), is_reference(true), type(Type::StorageBuf), storage_buf_ref(res){}; + : slot(slot_), is_reference(true), type(Type::StorageBuf), storage_buf_ref(res) {}; ResourceBind(int slot_, gpu::UniformBuf *res, Type /*type*/) - : slot(slot_), is_reference(false), type(Type::UniformAsStorageBuf), uniform_buf(res){}; + : slot(slot_), is_reference(false), type(Type::UniformAsStorageBuf), uniform_buf(res) {}; ResourceBind(int slot_, gpu::UniformBuf **res, Type /*type*/) - : slot(slot_), is_reference(true), type(Type::UniformAsStorageBuf), uniform_buf_ref(res){}; + : slot(slot_), is_reference(true), type(Type::UniformAsStorageBuf), uniform_buf_ref(res) {}; ResourceBind(int slot_, gpu::VertBuf *res, Type /*type*/) - : slot(slot_), is_reference(false), type(Type::VertexAsStorageBuf), vertex_buf(res){}; + : slot(slot_), is_reference(false), type(Type::VertexAsStorageBuf), vertex_buf(res) {}; ResourceBind(int slot_, gpu::VertBuf **res, Type /*type*/) - : slot(slot_), is_reference(true), type(Type::VertexAsStorageBuf), vertex_buf_ref(res){}; + : slot(slot_), is_reference(true), type(Type::VertexAsStorageBuf), vertex_buf_ref(res) {}; ResourceBind(int slot_, gpu::IndexBuf *res, Type /*type*/) - : slot(slot_), is_reference(false), type(Type::IndexAsStorageBuf), index_buf(res){}; + : slot(slot_), is_reference(false), type(Type::IndexAsStorageBuf), index_buf(res) {}; ResourceBind(int slot_, gpu::IndexBuf **res, Type /*type*/) - : slot(slot_), is_reference(true), type(Type::IndexAsStorageBuf), index_buf_ref(res){}; + : slot(slot_), is_reference(true), type(Type::IndexAsStorageBuf), index_buf_ref(res) {}; ResourceBind(int slot_, draw::Image *res) - : slot(slot_), is_reference(false), type(Type::Image), texture(draw::as_texture(res)){}; + : slot(slot_), is_reference(false), type(Type::Image), texture(draw::as_texture(res)) {}; ResourceBind(int slot_, draw::Image **res) - : slot(slot_), is_reference(true), type(Type::Image), texture_ref(draw::as_texture(res)){}; + : slot(slot_), is_reference(true), type(Type::Image), texture_ref(draw::as_texture(res)) {}; ResourceBind(int slot_, gpu::Texture *res, GPUSamplerState state) - : sampler(state), slot(slot_), is_reference(false), type(Type::Sampler), texture(res){}; + : sampler(state), slot(slot_), is_reference(false), type(Type::Sampler), texture(res) {}; ResourceBind(int slot_, gpu::Texture **res, GPUSamplerState state) - : sampler(state), slot(slot_), is_reference(true), type(Type::Sampler), texture_ref(res){}; + : sampler(state), slot(slot_), is_reference(true), type(Type::Sampler), texture_ref(res) {}; ResourceBind(int slot_, gpu::VertBuf *res) - : slot(slot_), is_reference(false), type(Type::BufferSampler), vertex_buf(res){}; + : slot(slot_), is_reference(false), type(Type::BufferSampler), vertex_buf(res) {}; ResourceBind(int slot_, gpu::VertBuf **res) - : slot(slot_), is_reference(true), type(Type::BufferSampler), vertex_buf_ref(res){}; + : slot(slot_), is_reference(true), type(Type::BufferSampler), vertex_buf_ref(res) {}; void execute() const; std::string serialize() const; @@ -268,42 +268,43 @@ struct PushConstant { PushConstant() = default; PushConstant(int loc, const float &val) - : location(loc), array_len(1), comp_len(1), type(Type::FloatValue), float1_value(val){}; + : location(loc), array_len(1), comp_len(1), type(Type::FloatValue), float1_value(val) {}; PushConstant(int loc, const float2 &val) - : location(loc), array_len(1), comp_len(2), type(Type::FloatValue), float2_value(val){}; + : location(loc), array_len(1), comp_len(2), type(Type::FloatValue), float2_value(val) {}; PushConstant(int loc, const float3 &val) - : location(loc), array_len(1), comp_len(3), type(Type::FloatValue), float3_value(val){}; + : location(loc), array_len(1), comp_len(3), type(Type::FloatValue), float3_value(val) {}; PushConstant(int loc, const float4 &val) - : location(loc), array_len(1), comp_len(4), type(Type::FloatValue), float4_value(val){}; + : location(loc), array_len(1), comp_len(4), type(Type::FloatValue), float4_value(val) {}; PushConstant(int loc, const int &val) - : location(loc), array_len(1), comp_len(1), type(Type::IntValue), int1_value(val){}; + : location(loc), array_len(1), comp_len(1), type(Type::IntValue), int1_value(val) {}; PushConstant(int loc, const int2 &val) - : location(loc), array_len(1), comp_len(2), type(Type::IntValue), int2_value(val){}; + : location(loc), array_len(1), comp_len(2), type(Type::IntValue), int2_value(val) {}; PushConstant(int loc, const int3 &val) - : location(loc), array_len(1), comp_len(3), type(Type::IntValue), int3_value(val){}; + : location(loc), array_len(1), comp_len(3), type(Type::IntValue), int3_value(val) {}; PushConstant(int loc, const int4 &val) - : location(loc), array_len(1), comp_len(4), type(Type::IntValue), int4_value(val){}; + : location(loc), array_len(1), comp_len(4), type(Type::IntValue), int4_value(val) {}; PushConstant(int loc, const float *val, int arr) - : location(loc), array_len(arr), comp_len(1), type(Type::FloatReference), float_ref(val){}; + : location(loc), array_len(arr), comp_len(1), type(Type::FloatReference), float_ref(val) {}; PushConstant(int loc, const float2 *val, int arr) - : location(loc), array_len(arr), comp_len(2), type(Type::FloatReference), float2_ref(val){}; + : location(loc), array_len(arr), comp_len(2), type(Type::FloatReference), float2_ref(val) {}; PushConstant(int loc, const float3 *val, int arr) - : location(loc), array_len(arr), comp_len(3), type(Type::FloatReference), float3_ref(val){}; + : location(loc), array_len(arr), comp_len(3), type(Type::FloatReference), float3_ref(val) {}; PushConstant(int loc, const float4 *val, int arr) - : location(loc), array_len(arr), comp_len(4), type(Type::FloatReference), float4_ref(val){}; + : location(loc), array_len(arr), comp_len(4), type(Type::FloatReference), float4_ref(val) {}; PushConstant(int loc, const float4x4 *val) - : location(loc), array_len(1), comp_len(16), type(Type::FloatReference), float4x4_ref(val){}; + : location(loc), array_len(1), comp_len(16), type(Type::FloatReference), float4x4_ref(val) { + }; PushConstant(int loc, const int *val, int arr) - : location(loc), array_len(arr), comp_len(1), type(Type::IntReference), int_ref(val){}; + : location(loc), array_len(arr), comp_len(1), type(Type::IntReference), int_ref(val) {}; PushConstant(int loc, const int2 *val, int arr) - : location(loc), array_len(arr), comp_len(2), type(Type::IntReference), int2_ref(val){}; + : location(loc), array_len(arr), comp_len(2), type(Type::IntReference), int2_ref(val) {}; PushConstant(int loc, const int3 *val, int arr) - : location(loc), array_len(arr), comp_len(3), type(Type::IntReference), int3_ref(val){}; + : location(loc), array_len(arr), comp_len(3), type(Type::IntReference), int3_ref(val) {}; PushConstant(int loc, const int4 *val, int arr) - : location(loc), array_len(arr), comp_len(4), type(Type::IntReference), int4_ref(val){}; + : location(loc), array_len(arr), comp_len(4), type(Type::IntReference), int4_ref(val) {}; void execute(RecordingState &state) const; std::string serialize() const; @@ -340,21 +341,21 @@ struct SpecializeConstant { SpecializeConstant() = default; SpecializeConstant(gpu::Shader *sh, int loc, const float &val) - : shader(sh), float_value(val), location(loc), type(Type::FloatValue){}; + : shader(sh), float_value(val), location(loc), type(Type::FloatValue) {}; SpecializeConstant(gpu::Shader *sh, int loc, const int &val) - : shader(sh), int_value(val), location(loc), type(Type::IntValue){}; + : shader(sh), int_value(val), location(loc), type(Type::IntValue) {}; SpecializeConstant(gpu::Shader *sh, int loc, const uint &val) - : shader(sh), uint_value(val), location(loc), type(Type::UintValue){}; + : shader(sh), uint_value(val), location(loc), type(Type::UintValue) {}; SpecializeConstant(gpu::Shader *sh, int loc, const bool &val) - : shader(sh), bool_value(val), location(loc), type(Type::BoolValue){}; + : shader(sh), bool_value(val), location(loc), type(Type::BoolValue) {}; SpecializeConstant(gpu::Shader *sh, int loc, const float *val) - : shader(sh), float_ref(val), location(loc), type(Type::FloatReference){}; + : shader(sh), float_ref(val), location(loc), type(Type::FloatReference) {}; SpecializeConstant(gpu::Shader *sh, int loc, const int *val) - : shader(sh), int_ref(val), location(loc), type(Type::IntReference){}; + : shader(sh), int_ref(val), location(loc), type(Type::IntReference) {}; SpecializeConstant(gpu::Shader *sh, int loc, const uint *val) - : shader(sh), uint_ref(val), location(loc), type(Type::UintReference){}; + : shader(sh), uint_ref(val), location(loc), type(Type::UintReference) {}; SpecializeConstant(gpu::Shader *sh, int loc, const bool *val) - : shader(sh), bool_ref(val), location(loc), type(Type::BoolReference){}; + : shader(sh), bool_ref(val), location(loc), type(Type::BoolReference) {}; void execute(RecordingState &state) const; std::string serialize() const; @@ -426,8 +427,8 @@ struct Dispatch { Dispatch() = default; - Dispatch(int3 group_len) : is_reference(false), size(group_len){}; - Dispatch(int3 *group_len) : is_reference(true), size_ref(group_len){}; + Dispatch(int3 group_len) : is_reference(false), size(group_len) {}; + Dispatch(int3 *group_len) : is_reference(true), size_ref(group_len) {}; void execute(RecordingState &state) const; std::string serialize() const; diff --git a/source/blender/draw/intern/draw_hair_private.hh b/source/blender/draw/intern/draw_hair_private.hh index 640aa391603..fdbc32b74c5 100644 --- a/source/blender/draw/intern/draw_hair_private.hh +++ b/source/blender/draw/intern/draw_hair_private.hh @@ -21,7 +21,7 @@ struct CurvesEvalCache; class CurveRefinePass : public PassSimple { public: - CurveRefinePass(const char *name) : PassSimple(name){}; + CurveRefinePass(const char *name) : PassSimple(name) {}; }; using CurvesInfosBuf = UniformBuffer; diff --git a/source/blender/draw/intern/draw_handle.hh b/source/blender/draw/intern/draw_handle.hh index 779dff2a8f3..30a9cbf4fed 100644 --- a/source/blender/draw/intern/draw_handle.hh +++ b/source/blender/draw/intern/draw_handle.hh @@ -57,7 +57,7 @@ struct ResourceIndex { uint32_t raw; ResourceIndex() = default; - ResourceIndex(uint raw_) : raw(raw_){}; + ResourceIndex(uint raw_) : raw(raw_) {}; ResourceIndex(uint index, bool inverted_handedness) { raw = index; diff --git a/source/blender/draw/intern/draw_manager.hh b/source/blender/draw/intern/draw_manager.hh index c71e3003b2e..2736673fb26 100644 --- a/source/blender/draw/intern/draw_manager.hh +++ b/source/blender/draw/intern/draw_manager.hh @@ -116,7 +116,7 @@ class Manager { Object *object_active = nullptr; public: - Manager(){}; + Manager() {}; ~Manager(); /** diff --git a/source/blender/draw/intern/draw_pass.hh b/source/blender/draw/intern/draw_pass.hh index 1a401f6fdf9..15a0910d8fe 100644 --- a/source/blender/draw/intern/draw_pass.hh +++ b/source/blender/draw/intern/draw_pass.hh @@ -162,7 +162,7 @@ class PassBase { sub_passes_(sub_passes), shader_(shader), debug_name(name), - use_custom_ids(false){}; + use_custom_ids(false) {}; /** * Reset the pass command pool. @@ -506,7 +506,7 @@ template class Pass : public detail::PassBase(name, draw_commands_buf_main_, sub_passes_main_){}; + : detail::PassBase(name, draw_commands_buf_main_, sub_passes_main_) {}; void init() { @@ -556,7 +556,7 @@ class PassSortable : public PassMain { bool sorted_ = false; public: - PassSortable(const char *name_) : PassMain(name_){}; + PassSortable(const char *name_) : PassMain(name_) {}; void init() { diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc index 207bd96a61a..4bf6fd406ef 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc @@ -89,7 +89,7 @@ static void extract_uv_stretch_angle_bm(const MeshRenderData &mr, do { const int l_index = BM_elem_index_get(l_iter); - const float(*luv)[2], (*luv_next)[2]; + const float (*luv)[2], (*luv_next)[2]; BMLoop *l_next = l_iter->next; if (l_iter == BM_FACE_FIRST_LOOP(face)) { /* First loop in face. */ diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_area.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_area.cc index 502b5be020c..127e49b9584 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_area.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_area.cc @@ -77,7 +77,7 @@ static AreaInfo compute_area_ratio(const MeshRenderData &mr, MutableSpan for (const int face_index : range) { const IndexRange face = faces[face_index]; const float area = bke::mesh::face_area_calc(positions, corner_verts.slice(face)); - float uvarea = area_poly_v2(reinterpret_cast(&uv_map[face.start()]), + float uvarea = area_poly_v2(reinterpret_cast(&uv_map[face.start()]), face.size()); info.tot_area += area; info.tot_uv_area += uvarea; diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc index c334feb9462..ccb1188e5cd 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc @@ -404,7 +404,7 @@ static void statvis_calc_distort(const MeshRenderData &mr, MutableSpan r_ BM_loop_calc_face_normal_safe_vcos( l_iter, no_face, - reinterpret_cast(mr.bm_vert_coords.data()), + reinterpret_cast(mr.bm_vert_coords.data()), no_corner); } else { diff --git a/source/blender/editors/animation/anim_filter.cc b/source/blender/editors/animation/anim_filter.cc index a33b1127c13..05af9923b33 100644 --- a/source/blender/editors/animation/anim_filter.cc +++ b/source/blender/editors/animation/anim_filter.cc @@ -1108,7 +1108,7 @@ static bool name_matches_dopesheet_filter(const bDopeSheet *ads, const char *nam const size_t str_len = strlen(ads->searchstr); const int words_max = BLI_string_max_possible_word_count(str_len); - int(*words)[2] = static_cast(BLI_array_alloca(words, words_max)); + int (*words)[2] = static_cast(BLI_array_alloca(words, words_max)); const int words_len = BLI_string_find_split_words( ads->searchstr, str_len, ' ', words, words_max); bool found = false; diff --git a/source/blender/editors/armature/armature_skinning.cc b/source/blender/editors/armature/armature_skinning.cc index 33e2e1b598c..0c8f8b78042 100644 --- a/source/blender/editors/armature/armature_skinning.cc +++ b/source/blender/editors/armature/armature_skinning.cc @@ -298,7 +298,7 @@ static void add_verts_to_dgroups(ReportList *reports, bPoseChannel *pchan; Mesh *mesh; Mat4 bbone_array[MAX_BBONE_SUBDIV], *bbone = nullptr; - float(*root)[3], (*tip)[3]; + float (*root)[3], (*tip)[3]; blender::Array verts; bool *selected; int numbones, vertsfilled = 0, segments = 0; @@ -421,7 +421,7 @@ static void add_verts_to_dgroups(ReportList *reports, const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval); if (mesh_eval) { BKE_mesh_foreach_mapped_vert_coords_get( - mesh_eval, reinterpret_cast(verts.data()), mesh->verts_num); + mesh_eval, reinterpret_cast(verts.data()), mesh->verts_num); vertsfilled = 1; } } @@ -448,7 +448,7 @@ static void add_verts_to_dgroups(ReportList *reports, heat_bone_weighting(ob, mesh, - reinterpret_cast(verts.data()), + reinterpret_cast(verts.data()), numbones, dgrouplist, dgroupflip, diff --git a/source/blender/editors/armature/meshlaplacian.cc b/source/blender/editors/armature/meshlaplacian.cc index 8b65cb268bd..5861f6aa3d6 100644 --- a/source/blender/editors/armature/meshlaplacian.cc +++ b/source/blender/editors/armature/meshlaplacian.cc @@ -104,8 +104,7 @@ static void laplacian_increase_edge_count(blender::Map &edgehash, @@ -204,7 +203,7 @@ static LaplacianSystem *laplacian_system_construct_begin(int verts_num, int face sys->verts = MEM_calloc_arrayN(verts_num, "LaplacianSystemVerts"); sys->vpinned = MEM_calloc_arrayN(verts_num, "LaplacianSystemVpinned"); - sys->faces = static_cast( + sys->faces = static_cast( MEM_callocN(sizeof(int[3]) * faces_num, "LaplacianSystemFaces")); sys->verts_num = 0; @@ -241,7 +240,7 @@ void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3) static void laplacian_system_construct_end(LaplacianSystem *sys) { - int(*face)[3]; + int (*face)[3]; int a, verts_num = sys->verts_num, faces_num = sys->faces_num; laplacian_begin_solve(sys, 0); @@ -278,7 +277,7 @@ static void laplacian_system_construct_end(LaplacianSystem *sys) } if (sys->storeweights) { - sys->fweights = static_cast( + sys->fweights = static_cast( MEM_callocN(sizeof(float[3]) * faces_num, "LaplacianFWeight")); } @@ -371,7 +370,7 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTr BVHCallbackUserData *data = static_cast(userdata); const blender::int3 &tri = data->sys->heat.corner_tris[index]; const blender::Span corner_verts = data->sys->heat.corner_verts; - float(*verts)[3] = data->sys->heat.verts; + float (*verts)[3] = data->sys->heat.verts; const float *vtri_co[3]; float dist_test; @@ -403,7 +402,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys) { const blender::int3 *corner_tris = sys->heat.corner_tris; const blender::Span corner_verts = sys->heat.corner_verts; - float(*verts)[3] = sys->heat.verts; + float (*verts)[3] = sys->heat.verts; int tris_num = sys->heat.tris_num; int verts_num = sys->heat.verts_num; int a; @@ -544,7 +543,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys) float fnor[3]; int a, v1, v2, v3, (*face)[3]; - sys->heat.vert_normals = static_cast( + sys->heat.vert_normals = static_cast( MEM_callocN(sizeof(float[3]) * sys->verts_num, "HeatVNors")); for (a = 0, face = sys->faces; a < sys->faces_num; a++, face++) { @@ -1027,7 +1026,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, const blender::Span corner_verts = mdb->cagemesh_cache.corner_verts; const int face_i = mdb->cagemesh_cache.tri_faces[hit.index]; const blender::IndexRange face = mdb->cagemesh_cache.faces[face_i]; - const float(*cagecos)[3] = mdb->cagecos; + const float (*cagecos)[3] = mdb->cagecos; const float len = isect_mdef.lambda; MDefBoundIsect *isect; @@ -1052,7 +1051,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, } interp_weights_poly_v3(isect->poly_weights, - reinterpret_cast(mp_cagecos.data()), + reinterpret_cast(mp_cagecos.data()), face.size(), isect->co); @@ -1766,13 +1765,13 @@ void ED_mesh_deform_bind_callback(Object *object, BKE_mesh_wrapper_ensure_mdata(cagemesh); /* get mesh and cage mesh */ - mdb.vertexcos = static_cast( + mdb.vertexcos = static_cast( MEM_callocN(sizeof(float[3]) * verts_num, "MeshDeformCos")); mdb.verts_num = verts_num; mdb.cagemesh = cagemesh; mdb.cage_verts_num = mdb.cagemesh->verts_num; - mdb.cagecos = static_cast( + mdb.cagecos = static_cast( MEM_callocN(sizeof(*mdb.cagecos) * mdb.cage_verts_num, "MeshDeformBindCos")); copy_m4_m4(mdb.cagemat, cagemat); diff --git a/source/blender/editors/armature/pose_transform.cc b/source/blender/editors/armature/pose_transform.cc index 9a090b3bcc8..d647f3a3d10 100644 --- a/source/blender/editors/armature/pose_transform.cc +++ b/source/blender/editors/armature/pose_transform.cc @@ -258,7 +258,7 @@ static void applyarmature_process_selected_recursive(bArmature *arm, &old_bpt); /* Applied parent effects that have to be kept, if any. */ - float(*new_parent_pose)[4] = pstate ? pstate->new_rest_mat : bone->parent->arm_mat; + float (*new_parent_pose)[4] = pstate ? pstate->new_rest_mat : bone->parent->arm_mat; BKE_bone_parent_transform_calc_from_matrices(bone->flag, bone->inherit_scale_mode, offs_bone, diff --git a/source/blender/editors/curve/editcurve.cc b/source/blender/editors/curve/editcurve.cc index d4056f78f59..ca0efcd25ed 100644 --- a/source/blender/editors/curve/editcurve.cc +++ b/source/blender/editors/curve/editcurve.cc @@ -665,7 +665,7 @@ static void calc_shapeKeys(Object *obedit, ListBase *newnurbs) Nurb *newnu; int totvert = BKE_keyblock_curve_element_count(&editnurb->nurbs); - float(*ofs)[3] = nullptr; + float (*ofs)[3] = nullptr; std::optional> dependent; const float *oldkey, *ofp; float *newkey; diff --git a/source/blender/editors/curve/editcurve_paint.cc b/source/blender/editors/curve/editcurve_paint.cc index 3348e573ec1..a8cf7c216f7 100644 --- a/source/blender/editors/curve/editcurve_paint.cc +++ b/source/blender/editors/curve/editcurve_paint.cc @@ -403,7 +403,7 @@ static void curve_draw_stroke_3d(const bContext * /*C*/, ARegion * /*region*/, v } if (stroke_len > 1) { - float(*coord_array)[3] = static_cast( + float (*coord_array)[3] = static_cast( MEM_mallocN(sizeof(*coord_array) * stroke_len, __func__)); { diff --git a/source/blender/editors/curves/intern/curves_data.cc b/source/blender/editors/curves/intern/curves_data.cc index d376abf21e5..38c48d42e7a 100644 --- a/source/blender/editors/curves/intern/curves_data.cc +++ b/source/blender/editors/curves/intern/curves_data.cc @@ -92,7 +92,7 @@ float (*point_normals_array_create(const Curves *curves_id))[3] const int size = curves.points_num(); float3 *data = MEM_malloc_arrayN(size, __func__); bke::curves_normals_point_domain_calc(curves, {data, size}); - return reinterpret_cast(data); + return reinterpret_cast(data); } } // namespace blender::ed::curves diff --git a/source/blender/editors/curves/intern/curves_draw.cc b/source/blender/editors/curves/intern/curves_draw.cc index ef7e61143f7..8841c450c28 100644 --- a/source/blender/editors/curves/intern/curves_draw.cc +++ b/source/blender/editors/curves/intern/curves_draw.cc @@ -387,7 +387,7 @@ static void curve_draw_stroke_3d(const bContext * /*C*/, ARegion * /*region*/, v } if (stroke_len > 1) { - float(*coord_array)[3] = static_cast( + float (*coord_array)[3] = static_cast( MEM_mallocN(sizeof(*coord_array) * stroke_len, __func__)); { diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_merge.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_merge.cc index 4e9db80af7e..03124862926 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_merge.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_merge.cc @@ -201,9 +201,7 @@ void merge_layers(const GreasePencil &src_grease_pencil, BLI_assert(duration >= 0); dst_frames.add_or_modify( item.key, - [&](InsertKeyframe *frame) { - *frame = {item.value, duration}; - }, + [&](InsertKeyframe *frame) { *frame = {item.value, duration}; }, [&](InsertKeyframe *frame) { /* The destination frame is always an implicit hold if at least on of the source * frame is an implicit hold. */ diff --git a/source/blender/editors/include/UI_interface_c.hh b/source/blender/editors/include/UI_interface_c.hh index 5f27c1d56f0..074a16c5414 100644 --- a/source/blender/editors/include/UI_interface_c.hh +++ b/source/blender/editors/include/UI_interface_c.hh @@ -641,7 +641,9 @@ using uiButArgNCopy = void *(*)(const void *argN); using uiButIdentityCompareFunc = bool (*)(const uiBut *a, const uiBut *b); /* Search types. */ -using uiButSearchCreateFn = ARegion *(*)(bContext *C, ARegion *butregion, uiButSearch *search_but); +using uiButSearchCreateFn = ARegion *(*)(bContext * C, + ARegion *butregion, + uiButSearch *search_but); /** * `is_first` is typically used to ignore search filtering when the menu is first opened in order * to display the full list of options. The value will be false after the button's text is edited @@ -654,7 +656,7 @@ using uiButSearchContextMenuFn = bool (*)(bContext *C, void *active, const wmEvent *event); using uiButSearchTooltipFn = - ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active); + ARegion *(*)(bContext * C, ARegion *region, const rcti *item_rect, void *arg, void *active); using uiButSearchListenFn = void (*)(const wmRegionListenerParams *params, void *arg); using uiBlockHandleFunc = void (*)(bContext *C, void *arg, int event); @@ -684,7 +686,7 @@ struct uiBlockInteraction_Params { }; /** Returns 'user_data', freed by #uiBlockInteractionEndFn. */ -using uiBlockInteractionBeginFn = void *(*)(bContext *C, +using uiBlockInteractionBeginFn = void *(*)(bContext * C, const uiBlockInteraction_Params *params, void *arg1); using uiBlockInteractionEndFn = void (*)(bContext *C, @@ -829,7 +831,7 @@ uiLayout *UI_pie_menu_layout(uiPieMenu *pie); * * Functions used to create popup blocks. These are like popup menus * but allow using all button types and creating their own layout. */ -using uiBlockCreateFunc = uiBlock *(*)(bContext *C, ARegion *region, void *arg1); +using uiBlockCreateFunc = uiBlock *(*)(bContext * C, ARegion *region, void *arg1); using uiBlockCancelFunc = void (*)(bContext *C, void *arg1); void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free); diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc index 3c3b5021279..e782bb8eb29 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc @@ -166,10 +166,11 @@ static void eyedropper_colorband_apply(bContext *C, wmOperator *op) EyedropperColorband *eye = static_cast(op->customdata); /* Always filter, avoids noise in resulting color-band. */ const bool filter_samples = true; - BKE_colorband_init_from_table_rgba(eye->color_band, - reinterpret_cast(eye->color_buffer.data()), - eye->color_buffer.size(), - filter_samples); + BKE_colorband_init_from_table_rgba( + eye->color_band, + reinterpret_cast(eye->color_buffer.data()), + eye->color_buffer.size(), + filter_samples); eye->is_set = true; if (eye->prop) { RNA_property_update(C, &eye->ptr, eye->prop); diff --git a/source/blender/editors/interface/interface_align.cc b/source/blender/editors/interface/interface_align.cc index 2ad990ed477..85af3b152c8 100644 --- a/source/blender/editors/interface/interface_align.cc +++ b/source/blender/editors/interface/interface_align.cc @@ -76,9 +76,7 @@ enum { /* Mapping between 'our' sides and 'public' UI_BUT_ALIGN flags, order must match enum above. */ #define SIDE_TO_UI_BUT_ALIGN \ - { \ - UI_BUT_ALIGN_LEFT, UI_BUT_ALIGN_TOP, UI_BUT_ALIGN_RIGHT, UI_BUT_ALIGN_DOWN \ - } + {UI_BUT_ALIGN_LEFT, UI_BUT_ALIGN_TOP, UI_BUT_ALIGN_RIGHT, UI_BUT_ALIGN_DOWN} /* Given one side, compute the three other ones */ #define SIDE1(_s) (((_s) + 1) % TOTSIDES) diff --git a/source/blender/editors/interface/interface_draw.cc b/source/blender/editors/interface/interface_draw.cc index f17e84a73ec..120efe34d43 100644 --- a/source/blender/editors/interface/interface_draw.cc +++ b/source/blender/editors/interface/interface_draw.cc @@ -103,7 +103,7 @@ void UI_draw_roundbox_4fv_ex(const rctf *rect, blender::gpu::Batch *batch = ui_batch_roundbox_widget_get(); GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_BASE); - GPU_batch_uniform_4fv_array(batch, "parameters", 11, (const float(*)[4]) & widget_params); + GPU_batch_uniform_4fv_array(batch, "parameters", 11, (const float (*)[4]) & widget_params); GPU_blend(GPU_BLEND_ALPHA); GPU_batch_draw(batch); GPU_blend(GPU_BLEND_NONE); @@ -1987,7 +1987,7 @@ void ui_draw_but_CURVEPROFILE(ARegion *region, const uint tot_triangles = tot_points - 2; /* Create array of the positions of the table's points. */ - float(*table_coords)[2] = static_cast( + float (*table_coords)[2] = static_cast( MEM_mallocN(sizeof(*table_coords) * tot_points, __func__)); for (uint i = 0; i < uint(BKE_curveprofile_table_size(profile)); i++) { /* Only add the points from the table here. */ @@ -2411,7 +2411,7 @@ void ui_draw_dropshadow( blender::gpu::Batch *batch = ui_batch_roundbox_shadow_get(); GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_SHADOW); - GPU_batch_uniform_4fv_array(batch, "parameters", 4, (const float(*)[4]) & widget_params); + GPU_batch_uniform_4fv_array(batch, "parameters", 4, (const float (*)[4]) & widget_params); GPU_batch_uniform_1f(batch, "alpha", alpha); GPU_batch_draw(batch); diff --git a/source/blender/editors/interface/interface_intern.hh b/source/blender/editors/interface/interface_intern.hh index 7399695230c..5636d899f65 100644 --- a/source/blender/editors/interface/interface_intern.hh +++ b/source/blender/editors/interface/interface_intern.hh @@ -911,7 +911,7 @@ struct uiKeyNavLock { blender::int2 event_xy = blender::int2(0); }; -using uiBlockHandleCreateFunc = uiBlock *(*)(bContext *C, uiPopupBlockHandle *handle, void *arg1); +using uiBlockHandleCreateFunc = uiBlock *(*)(bContext * C, uiPopupBlockHandle *handle, void *arg1); struct uiPopupBlockCreate { uiBlockCreateFunc create_func = nullptr; diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index dcad3caa7d7..1d1a8aad281 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -232,7 +232,7 @@ struct LayoutOverlap : public uiLayout { struct LayoutRadial : public uiLayout { LayoutRadial() : uiLayout(uiItemType::LayoutRadial, nullptr) {} - void estimate_impl() override{}; + void estimate_impl() override {}; void resolve_impl() override; }; diff --git a/source/blender/editors/interface/interface_widgets.cc b/source/blender/editors/interface/interface_widgets.cc index 0aad4d044b0..5ffd245fae6 100644 --- a/source/blender/editors/interface/interface_widgets.cc +++ b/source/blender/editors/interface/interface_widgets.cc @@ -1079,8 +1079,10 @@ void UI_widgetbase_draw_cache_flush() if (g_widget_base_batch.count == 1) { /* draw single */ GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_BASE); - GPU_batch_uniform_4fv_array( - batch, "parameters", MAX_WIDGET_PARAMETERS, (const float(*)[4])g_widget_base_batch.params); + GPU_batch_uniform_4fv_array(batch, + "parameters", + MAX_WIDGET_PARAMETERS, + (const float (*)[4])g_widget_base_batch.params); GPU_batch_uniform_3fv(batch, "checkerColorAndSize", checker_params); GPU_batch_draw(batch); } @@ -1089,7 +1091,7 @@ void UI_widgetbase_draw_cache_flush() GPU_batch_uniform_4fv_array(batch, "parameters", MAX_WIDGET_PARAMETERS * MAX_WIDGET_BASE_BATCH, - (float(*)[4])g_widget_base_batch.params); + (float (*)[4])g_widget_base_batch.params); GPU_batch_uniform_3fv(batch, "checkerColorAndSize", checker_params); GPU_batch_draw_instance_range(batch, 0, g_widget_base_batch.count); } @@ -1137,7 +1139,7 @@ static void draw_widgetbase_batch(uiWidgetBase *wtb) blender::gpu::Batch *batch = ui_batch_roundbox_widget_get(); GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_BASE); GPU_batch_uniform_4fv_array( - batch, "parameters", MAX_WIDGET_PARAMETERS, (float(*)[4]) & wtb->uniform_params); + batch, "parameters", MAX_WIDGET_PARAMETERS, (float (*)[4]) & wtb->uniform_params); GPU_batch_uniform_3fv(batch, "checkerColorAndSize", checker_params); GPU_batch_draw(batch); } diff --git a/source/blender/editors/interface/templates/interface_template_search_operator.cc b/source/blender/editors/interface/templates/interface_template_search_operator.cc index 95d89f59fa5..238dceec8d6 100644 --- a/source/blender/editors/interface/templates/interface_template_search_operator.cc +++ b/source/blender/editors/interface/templates/interface_template_search_operator.cc @@ -50,7 +50,7 @@ static void operator_search_update_fn(const bContext *C, const int words_max = BLI_string_max_possible_word_count(str_len); blender::Array words(words_max); const int words_len = BLI_string_find_split_words( - str, str_len, ' ', (int(*)[2])words.data(), words_max); + str, str_len, ' ', (int (*)[2])words.data(), words_max); for (wmOperatorType *ot : WM_operatortypes_registered_get()) { const char *ot_ui_name = CTX_IFACE_(ot->translation_context, ot->name); @@ -59,7 +59,7 @@ static void operator_search_update_fn(const bContext *C, continue; } - if (BLI_string_all_words_matched(ot_ui_name, str, (int(*)[2])words.data(), words_len)) { + if (BLI_string_all_words_matched(ot_ui_name, str, (int (*)[2])words.data(), words_len)) { if (WM_operator_poll((bContext *)C, ot)) { std::string name = ot_ui_name; if (const std::optional kmi_str = WM_key_event_operator_string( diff --git a/source/blender/editors/mask/mask_draw.cc b/source/blender/editors/mask/mask_draw.cc index 026296a808f..de5a1b1fa86 100644 --- a/source/blender/editors/mask/mask_draw.cc +++ b/source/blender/editors/mask/mask_draw.cc @@ -183,7 +183,7 @@ static void draw_spline_points(const bContext *C, bool undistort = false; int tot_feather_point; - float(*feather_points)[2], (*fp)[2]; + float (*feather_points)[2], (*fp)[2]; float min[2], max[2]; if (!spline->tot_point) { @@ -386,7 +386,7 @@ static void mask_draw_curve_type(const bContext *C, const uchar rgb_black[4] = {0x00, 0x00, 0x00, 0xff}; uchar rgb_tmp[4]; SpaceClip *sc = CTX_wm_space_clip(C); - float(*points)[2] = orig_points; + float (*points)[2] = orig_points; if (sc) { const bool undistort = sc->clip && (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT); @@ -513,10 +513,10 @@ static void draw_spline_curve(const bContext *C, const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; uint tot_diff_point; - float(*diff_points)[2]; + float (*diff_points)[2]; uint tot_feather_point; - float(*feather_points)[2]; + float (*feather_points)[2]; diff_points = BKE_mask_spline_differentiate_with_resolution(spline, resol, &tot_diff_point); diff --git a/source/blender/editors/mask/mask_query.cc b/source/blender/editors/mask/mask_query.cc index 7e7daff4555..c893390631b 100644 --- a/source/blender/editors/mask/mask_query.cc +++ b/source/blender/editors/mask/mask_query.cc @@ -402,7 +402,7 @@ bool ED_mask_feather_find_nearest(const bContext *C, // MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); int i, tot_feather_point; - float(*feather_points)[2], (*fp)[2]; + float (*feather_points)[2], (*fp)[2]; if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.cc b/source/blender/editors/mesh/editmesh_add_gizmo.cc index d1e6f000d05..221457dfd46 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.cc +++ b/source/blender/editors/mesh/editmesh_add_gizmo.cc @@ -149,7 +149,7 @@ static void gizmo_placement_prop_matrix_get(const wmGizmo *gz, if (value_p != ggd->cage->matrix_offset) { mul_m4_m4m4( - static_cast(value_p), ggd->cage->matrix_basis, ggd->cage->matrix_offset); + static_cast(value_p), ggd->cage->matrix_basis, ggd->cage->matrix_offset); RNA_property_float_get_array(op->ptr, ggd->data.prop_matrix, value); } } @@ -165,7 +165,7 @@ static void gizmo_placement_prop_matrix_set(const wmGizmo *gz, UNUSED_VARS_NDEBUG(gz_prop); float mat[4][4]; - mul_m4_m4m4(mat, ggd->cage->matrix_basis, static_cast(value)); + mul_m4_m4m4(mat, ggd->cage->matrix_basis, static_cast(value)); if (is_negative_m4(mat)) { negate_mat3_m4(mat); diff --git a/source/blender/editors/mesh/editmesh_knife.cc b/source/blender/editors/mesh/editmesh_knife.cc index 7067d1c6815..4be9280c9fd 100644 --- a/source/blender/editors/mesh/editmesh_knife.cc +++ b/source/blender/editors/mesh/editmesh_knife.cc @@ -4715,7 +4715,7 @@ static bool edbm_mesh_knife_point_isect(LinkNode *polys, const float cent_ss[2]) int isect = 0; while (p) { - const float(*mval_fl)[2] = static_cast(p->link); + const float (*mval_fl)[2] = static_cast(p->link); const int mval_tot = MEM_allocN_len(mval_fl) / sizeof(*mval_fl); isect += int(isect_point_poly_v2(cent_ss, mval_fl, mval_tot - 1)); p = p->next; @@ -4765,7 +4765,7 @@ void EDBM_mesh_knife( knife_recalc_ortho(kcd); while (p) { - const float(*mval_fl)[2] = static_cast(p->link); + const float (*mval_fl)[2] = static_cast(p->link); const int mval_tot = MEM_allocN_len(mval_fl) / sizeof(*mval_fl); int i; diff --git a/source/blender/editors/mesh/editmesh_knife_project.cc b/source/blender/editors/mesh/editmesh_knife_project.cc index 41ba0fae13b..6f9c4b09ef7 100644 --- a/source/blender/editors/mesh/editmesh_knife_project.cc +++ b/source/blender/editors/mesh/editmesh_knife_project.cc @@ -76,7 +76,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, Object *ob, Li int a; BPoint *bp; bool is_cyclic = (nu->flagu & CU_NURB_CYCLIC) != 0; - float(*mval)[2] = static_cast( + float (*mval)[2] = static_cast( MEM_mallocN(sizeof(*mval) * (nu->pntsu + is_cyclic), __func__)); for (bp = nu->bp, a = 0; a < nu->pntsu; a++, bp++) { diff --git a/source/blender/editors/mesh/editmesh_preselect_edgering.cc b/source/blender/editors/mesh/editmesh_preselect_edgering.cc index 582fbaf7c05..a0566e01303 100644 --- a/source/blender/editors/mesh/editmesh_preselect_edgering.cc +++ b/source/blender/editors/mesh/editmesh_preselect_edgering.cc @@ -221,10 +221,10 @@ static void view3d_preselect_mesh_edgering_update_verts_from_edge( const Span vert_positions) { float v_cos[2][3]; - float(*verts)[3]; + float (*verts)[3]; int i, tot = 0; - verts = static_cast(MEM_mallocN(sizeof(*psel->verts) * previewlines, __func__)); + verts = static_cast(MEM_mallocN(sizeof(*psel->verts) * previewlines, __func__)); edgering_vcos_get_pair(&eed_start->v1, v_cos, vert_positions); @@ -248,7 +248,7 @@ static void view3d_preselect_mesh_edgering_update_edges_from_edge( BMWalker walker; BMEdge *eed, *eed_last; BMVert *v[2][2] = {{nullptr}}, *eve_last; - float(*edges)[2][3] = nullptr; + float (*edges)[2][3] = nullptr; BLI_Stack *edge_stack; int i, tot = 0; @@ -274,7 +274,7 @@ static void view3d_preselect_mesh_edgering_update_edges_from_edge( eed_start = *(BMEdge **)BLI_stack_peek(edge_stack); - edges = static_cast(MEM_mallocN( + edges = static_cast(MEM_mallocN( (sizeof(*edges) * (BLI_stack_count(edge_stack) + (eed_last != eed_start))) * previewlines, __func__)); diff --git a/source/blender/editors/mesh/editmesh_preselect_elem.cc b/source/blender/editors/mesh/editmesh_preselect_elem.cc index 992f7443d3f..1509a991299 100644 --- a/source/blender/editors/mesh/editmesh_preselect_elem.cc +++ b/source/blender/editors/mesh/editmesh_preselect_elem.cc @@ -222,7 +222,7 @@ static void view3d_preselect_mesh_elem_update_from_vert(EditMesh_PreSelElem *pse BMVert *eve, const Span vert_positions) { - float(*verts)[3] = static_cast(MEM_mallocN(sizeof(*psel->verts), __func__)); + float (*verts)[3] = static_cast(MEM_mallocN(sizeof(*psel->verts), __func__)); vcos_get(eve, verts[0], vert_positions); psel->verts = verts; psel->verts_len = 1; @@ -233,7 +233,7 @@ static void view3d_preselect_mesh_elem_update_from_edge(EditMesh_PreSelElem *pse BMEdge *eed, const Span vert_positions) { - float(*edges)[2][3] = static_cast(MEM_mallocN(sizeof(*psel->edges), __func__)); + float (*edges)[2][3] = static_cast(MEM_mallocN(sizeof(*psel->edges), __func__)); vcos_get_pair(&eed->v1, edges[0], vert_positions); psel->edges = edges; psel->edges_len = 1; @@ -269,9 +269,9 @@ static void view3d_preselect_update_preview_triangle_from_vert( ED_view3d_win_to_3d_int(vc->v3d, vc->region, center, mval, center); mul_m4_v3(vc->obedit->world_to_object().ptr(), center); - psel->preview_tris = static_cast( + psel->preview_tris = static_cast( MEM_mallocN(sizeof(*psel->preview_tris) * 2, __func__)); - psel->preview_lines = static_cast( + psel->preview_lines = static_cast( MEM_mallocN(sizeof(*psel->preview_lines) * 4, __func__)); copy_v3_v3(psel->preview_tris[0][0], e_pair[0]->v1->co); @@ -314,7 +314,7 @@ static void view3d_preselect_update_preview_triangle_from_face(EditMesh_PreSelEl BMFace *efa, const int /*mval*/[2]) { - float(*preview_lines)[2][3] = static_cast( + float (*preview_lines)[2][3] = static_cast( MEM_mallocN(sizeof(*psel->edges) * efa->len, __func__)); BMLoop *l_iter, *l_first; l_iter = l_first = BM_FACE_FIRST_LOOP(efa); @@ -330,9 +330,9 @@ static void view3d_preselect_update_preview_triangle_from_edge( EditMesh_PreSelElem *psel, ViewContext *vc, BMesh * /*bm*/, BMEdge *eed, const int mval[2]) { float center[3]; - psel->preview_tris = static_cast( + psel->preview_tris = static_cast( MEM_mallocN(sizeof(*psel->preview_tris), __func__)); - psel->preview_lines = static_cast( + psel->preview_lines = static_cast( MEM_mallocN(sizeof(*psel->preview_lines) * 3, __func__)); mid_v3_v3v3(center, eed->v1->co, eed->v2->co); mul_m4_v3(vc->obedit->object_to_world().ptr(), center); @@ -360,7 +360,7 @@ static void view3d_preselect_mesh_elem_update_from_face(EditMesh_PreSelElem *pse BMFace *efa, const Span vert_positions) { - float(*edges)[2][3] = static_cast( + float (*edges)[2][3] = static_cast( MEM_mallocN(sizeof(*psel->edges) * efa->len, __func__)); BMLoop *l_iter, *l_first; l_iter = l_first = BM_FACE_FIRST_LOOP(efa); diff --git a/source/blender/editors/mesh/editmesh_select.cc b/source/blender/editors/mesh/editmesh_select.cc index 5818730d7c5..2a3f6e730c9 100644 --- a/source/blender/editors/mesh/editmesh_select.cc +++ b/source/blender/editors/mesh/editmesh_select.cc @@ -1457,7 +1457,7 @@ static wmOperatorStatus edbm_select_similar_region_exec(bContext *C, wmOperator bool changed = false; /* Group variables. */ - int(*group_index)[2]; + int (*group_index)[2]; int group_tot; int i; @@ -3109,7 +3109,7 @@ bool EDBM_select_interior_faces(BMEditMesh *em) } /* Group variables. */ - int(*fgroup_index)[2]; + int (*fgroup_index)[2]; int fgroup_len; int *fgroup_array = MEM_malloc_arrayN(bm->totface, __func__); diff --git a/source/blender/editors/mesh/editmesh_tools.cc b/source/blender/editors/mesh/editmesh_tools.cc index 35d6d887135..3b9961836cb 100644 --- a/source/blender/editors/mesh/editmesh_tools.cc +++ b/source/blender/editors/mesh/editmesh_tools.cc @@ -4337,7 +4337,7 @@ static bool mesh_separate_loose( blender::Array edge_groups(bm_old->totedge); blender::Array face_groups(bm_old->totface); - int(*groups)[3] = nullptr; + int (*groups)[3] = nullptr; int groups_len = BM_mesh_calc_edge_groups_as_arrays( bm_old, vert_groups.data(), edge_groups.data(), face_groups.data(), &groups); if (groups_len <= 1) { @@ -9523,7 +9523,7 @@ static wmOperatorStatus edbm_set_normals_from_faces_exec(bContext *C, wmOperator BKE_editmesh_lnorspace_update(em); - float(*vert_normals)[3] = static_cast( + float (*vert_normals)[3] = static_cast( MEM_mallocN(sizeof(*vert_normals) * bm->totvert, __func__)); { int v_index; @@ -9631,7 +9631,7 @@ static wmOperatorStatus edbm_smooth_normals_exec(bContext *C, wmOperator *op) BKE_editmesh_lnorspace_update(em); BMLoopNorEditDataArray *lnors_ed_arr = BM_loop_normal_editdata_array_init(bm, false); - float(*smooth_normal)[3] = static_cast( + float (*smooth_normal)[3] = static_cast( MEM_callocN(sizeof(*smooth_normal) * lnors_ed_arr->totloop, __func__)); /* NOTE(@mont29): This is weird choice of operation, taking all loops of faces of current diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index de833fa423d..46f32fdaa66 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -779,7 +779,7 @@ static std::optional> lattice_add_to_selected_collect_targets_and const Object *object_eval = DEG_get_evaluated(depsgraph, base->object); if (object_eval && DEG_object_transform_is_evaluated(*object_eval)) { if (std::optional> object_bounds = BKE_object_boundbox_get(object_eval)) { - const float(*object_to_world_matrix)[4] = object_eval->object_to_world().ptr(); + const float (*object_to_world_matrix)[4] = object_eval->object_to_world().ptr(); /* Generate all 8 corners of the bounding box. */ std::array corners = bounds::corners(*object_bounds); for (float3 &corner : corners) { diff --git a/source/blender/editors/physics/particle_object.cc b/source/blender/editors/physics/particle_object.cc index 305d85359f6..f8e6d516653 100644 --- a/source/blender/editors/physics/particle_object.cc +++ b/source/blender/editors/physics/particle_object.cc @@ -1171,7 +1171,7 @@ static bool copy_particle_systems_to_object(const bContext *C, for (psys = psys_start, psys_from = PSYS_FROM_FIRST, i = 0; psys; psys = psys->next, psys_from = PSYS_FROM_NEXT(psys_from), i++) { - const float(*from_mat)[4], (*to_mat)[4]; + const float (*from_mat)[4], (*to_mat)[4]; switch (space) { case PAR_COPY_SPACE_OBJECT: diff --git a/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc b/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc index 895e6c92632..85f7c36e82b 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc @@ -1860,7 +1860,7 @@ static inline bool is_point_inside_bounds(const Bounds bounds, const int2 static inline bool is_point_inside_lasso(const Array lasso, const int2 point) { return isect_point_poly_v2_int( - point, reinterpret_cast(lasso.data()), uint(lasso.size())); + point, reinterpret_cast(lasso.data()), uint(lasso.size())); } static wmOperatorStatus grease_pencil_erase_lasso_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/sculpt_paint/grease_pencil_tint.cc b/source/blender/editors/sculpt_paint/grease_pencil_tint.cc index 2b574d9d30e..dc4f09ab4ce 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_tint.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_tint.cc @@ -33,7 +33,7 @@ using ed::greasepencil::MutableDrawingInfo; class TintOperation : public GreasePencilStrokeOperation { public: - TintOperation(bool temp_eraser = false) : temp_eraser_(temp_eraser){}; + TintOperation(bool temp_eraser = false) : temp_eraser_(temp_eraser) {}; void on_stroke_begin(const bContext &C, const InputSample &start_sample) override; void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override; void on_stroke_done(const bContext &C) override; @@ -209,7 +209,7 @@ void TintOperation::tint_fills(const bke::CurvesGeometry &strokes, return false; } return isect_point_poly_v2( - mouse, reinterpret_cast(points.data()), points.size()); + mouse, reinterpret_cast(points.data()), points.size()); }; threading::parallel_for(strokes.curves_range(), 512, [&](const IndexRange curves) { diff --git a/source/blender/editors/sculpt_paint/paint_cursor.cc b/source/blender/editors/sculpt_paint/paint_cursor.cc index fe6f4e4336e..222a38a337a 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.cc +++ b/source/blender/editors/sculpt_paint/paint_cursor.cc @@ -1011,7 +1011,7 @@ static void paint_draw_curve_cursor(Brush *brush, ViewContext *vc) sizeof(float[2])); } - float(*v)[2] = (float(*)[2])data; + float (*v)[2] = (float (*)[2])data; immUniformColor4f(0.0f, 0.0f, 0.0f, 0.5f); GPU_line_width(3.0f); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index 4483db1116e..9682dfd5da4 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -1312,7 +1312,7 @@ static void uv_image_outset(const ProjPaintState *ps, for (fidx[0] = 0; fidx[0] < 3; fidx[0]++) { LoopSeamData *seam_data; - float(*seam_uvs)[2]; + float (*seam_uvs)[2]; float ang[2]; if ((ps->faceSeamFlags[tri_index] & (PROJ_FACE_SEAM0 << fidx[0])) == 0) { @@ -1601,7 +1601,7 @@ static void screen_px_to_vector_persp(int winx, r_dir[0] = 2.0f * (co_px[0] / winx) - 1.0f; r_dir[1] = 2.0f * (co_px[1] / winy) - 1.0f; r_dir[2] = -0.5f; - mul_project_m4_v3((float(*)[4])projmat_inv, r_dir); + mul_project_m4_v3((float (*)[4])projmat_inv, r_dir); sub_v3_v3(r_dir, view_pos); } @@ -3303,7 +3303,7 @@ static void project_paint_face_init(const ProjPaintState *ps, if (len_squared_v2v2(vCoSS[fidx1], vCoSS[fidx2]) > FLT_EPSILON) { uint loop_idx = ps->corner_tris_eval[tri_index][fidx1]; LoopSeamData *seam_data = &ps->loopSeamData[loop_idx]; - float(*seam_uvs)[2] = seam_data->seam_uvs; + float (*seam_uvs)[2] = seam_data->seam_uvs; if (is_ortho) { fac1 = line_point_factor_v2(bucket_clip_edges[0], vCoSS[fidx1], vCoSS[fidx2]); @@ -3392,7 +3392,7 @@ static void project_paint_face_init(const ProjPaintState *ps, if (!is_ortho) { pixel_on_edge[3] = 1.0f; /* cast because of const */ - mul_m4_v4((float(*)[4])ps->projectMat, pixel_on_edge); + mul_m4_v4((float (*)[4])ps->projectMat, pixel_on_edge); pixel_on_edge[0] = float(ps->winx * 0.5f) + (ps->winx * 0.5f) * pixel_on_edge[0] / pixel_on_edge[3]; pixel_on_edge[1] = float(ps->winy * 0.5f) + @@ -3829,7 +3829,7 @@ static void proj_paint_state_screen_coords_init(ProjPaintState *ps, const int di INIT_MINMAX2(ps->screenMin, ps->screenMax); - ps->screenCoords = static_cast( + ps->screenCoords = static_cast( MEM_mallocN(sizeof(float) * ps->totvert_eval * 4, "ProjectPaint ScreenVerts")); projScreenCo = *ps->screenCoords; @@ -3907,7 +3907,7 @@ static void proj_paint_state_cavity_init(ProjPaintState *ps) if (ps->do_mask_cavity) { int *counter = MEM_calloc_arrayN(ps->totvert_eval, "counter"); - float(*edges)[3] = static_cast( + float (*edges)[3] = static_cast( MEM_callocN(sizeof(float[3]) * ps->totvert_eval, "edges")); ps->cavities = MEM_malloc_arrayN(ps->totvert_eval, "ProjectPaint Cavities"); cavities = ps->cavities; @@ -4102,8 +4102,8 @@ static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *p ps->corner_tris_eval = ps->mesh_eval->corner_tris(); ps->corner_tri_faces_eval = ps->mesh_eval->corner_tri_faces(); - ps->poly_to_loop_uv = static_cast( - MEM_mallocN(ps->faces_num_eval * sizeof(float(*)[2]), "proj_paint_mtfaces")); + ps->poly_to_loop_uv = static_cast( + MEM_mallocN(ps->faces_num_eval * sizeof(float (*)[2]), "proj_paint_mtfaces")); return true; } @@ -4116,24 +4116,24 @@ struct ProjPaintLayerClone { static void proj_paint_layer_clone_init(ProjPaintState *ps, ProjPaintLayerClone *layer_clone) { - const float(*uv_map_clone_base)[2] = nullptr; + const float (*uv_map_clone_base)[2] = nullptr; /* use clone mtface? */ if (ps->do_layer_clone) { const int layer_num = CustomData_get_clone_layer(&((Mesh *)ps->ob->data)->corner_data, CD_PROP_FLOAT2); - ps->poly_to_loop_uv_clone = static_cast( - MEM_mallocN(ps->faces_num_eval * sizeof(float(*)[2]), "proj_paint_mtfaces")); + ps->poly_to_loop_uv_clone = static_cast( + MEM_mallocN(ps->faces_num_eval * sizeof(float (*)[2]), "proj_paint_mtfaces")); if (layer_num != -1) { - uv_map_clone_base = static_cast( + uv_map_clone_base = static_cast( CustomData_get_layer_n(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2, layer_num)); } if (uv_map_clone_base == nullptr) { /* get active instead */ - uv_map_clone_base = static_cast( + uv_map_clone_base = static_cast( CustomData_get_layer(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2)); } } @@ -4163,10 +4163,10 @@ static bool project_paint_clone_face_skip(ProjPaintState *ps, if (ps->do_material_slots) { if (lc->slot_clone != lc->slot_last_clone) { if (!lc->slot_clone->uvname || - !(lc->uv_map_clone_base = static_cast(CustomData_get_layer_named( + !(lc->uv_map_clone_base = static_cast(CustomData_get_layer_named( &ps->mesh_eval->corner_data, CD_PROP_FLOAT2, lc->slot_clone->uvname)))) { - lc->uv_map_clone_base = static_cast( + lc->uv_map_clone_base = static_cast( CustomData_get_layer(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2)); } lc->slot_last_clone = lc->slot_clone; @@ -4347,17 +4347,17 @@ static void project_paint_prepare_all_faces(ProjPaintState *ps, slot = project_paint_face_paint_slot(ps, tri_index); /* all faces should have a valid slot, reassert here */ if (slot == nullptr) { - uv_map_base = static_cast( + uv_map_base = static_cast( CustomData_get_layer(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2)); tpage = ps->canvas_ima; } else { if (slot != slot_last) { if (!slot->uvname || - !(uv_map_base = static_cast(CustomData_get_layer_named( + !(uv_map_base = static_cast(CustomData_get_layer_named( &ps->mesh_eval->corner_data, CD_PROP_FLOAT2, slot->uvname)))) { - uv_map_base = static_cast( + uv_map_base = static_cast( CustomData_get_layer(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2)); } slot_last = slot; @@ -4507,7 +4507,7 @@ static void project_paint_begin(const bContext *C, { ProjPaintLayerClone layer_clone; ProjPaintFaceLookup face_lookup; - const float(*uv_map_base)[2] = nullptr; + const float (*uv_map_base)[2] = nullptr; /* At the moment this is just ps->arena_mt[0], but use this to show were not multi-threading. */ MemArena *arena; @@ -4541,13 +4541,13 @@ static void project_paint_begin(const bContext *C, int layer_num = CustomData_get_stencil_layer(&((Mesh *)ps->ob->data)->corner_data, CD_PROP_FLOAT2); if (layer_num != -1) { - ps->uv_map_stencil_eval = static_cast( + ps->uv_map_stencil_eval = static_cast( CustomData_get_layer_n(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2, layer_num)); } if (ps->uv_map_stencil_eval == nullptr) { /* get active instead */ - ps->uv_map_stencil_eval = static_cast( + ps->uv_map_stencil_eval = static_cast( CustomData_get_layer(&ps->mesh_eval->corner_data, CD_PROP_FLOAT2)); } diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.cc b/source/blender/editors/sculpt_paint/sculpt_cloth.cc index 146c3b3c941..e9c6eb51fbe 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.cc +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.cc @@ -1125,7 +1125,7 @@ static void cloth_brush_collision_cb(void *userdata, ClothBrushCollision *col = (ClothBrushCollision *)userdata; CollisionModifierData *col_data = col->col_data; const int3 vert_tri = col_data->vert_tris[index]; - float(*positions)[3] = col_data->x; + float (*positions)[3] = col_data->x; float *tri[3], no[3], co[3]; tri[0] = positions[vert_tri[0]]; diff --git a/source/blender/editors/sculpt_paint/sculpt_trim.cc b/source/blender/editors/sculpt_paint/sculpt_trim.cc index 44fa8fcd182..33f9e75cf64 100644 --- a/source/blender/editors/sculpt_paint/sculpt_trim.cc +++ b/source/blender/editors/sculpt_paint/sculpt_trim.cc @@ -358,7 +358,7 @@ static void generate_geometry(gesture::GestureData &gesture_data) get_origin_and_normal(gesture_data, shape_origin, shape_normal); plane_from_point_normal_v3(shape_plane, shape_origin, shape_normal); - const float(*ob_imat)[4] = vc.obact->world_to_object().ptr(); + const float (*ob_imat)[4] = vc.obact->world_to_object().ptr(); /* Write vertices coordinates OperationType::Difference for the front face. */ MutableSpan positions = trim_operation->mesh->vert_positions_for_write(); @@ -444,7 +444,7 @@ static void generate_geometry(gesture::GestureData &gesture_data) /* Get the triangulation for the front/back poly. */ const int face_tris_num = bke::mesh::face_triangles_num(screen_points.size()); Array tris(face_tris_num); - BLI_polyfill_calc(reinterpret_cast(screen_points.data()), + BLI_polyfill_calc(reinterpret_cast(screen_points.data()), screen_points.size(), 0, reinterpret_cast(tris.data())); diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.cc b/source/blender/editors/sculpt_paint/sculpt_uv.cc index 229d524f822..edd365ff3ac 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.cc +++ b/source/blender/editors/sculpt_paint/sculpt_uv.cc @@ -251,7 +251,7 @@ static void HC_relaxation_iteration_uv(UvSculptData *sculptdata, if (element->separate && element != sculptdata->uv[i].element) { break; } - float(*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); + float (*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); copy_v2_v2(*luv, sculptdata->uv[i].uv); } } @@ -328,7 +328,7 @@ static void laplacian_relaxation_iteration_uv(UvSculptData *sculptdata, break; } - float(*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); + float (*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); copy_v2_v2(*luv, sculptdata->uv[i].uv); } } @@ -400,7 +400,7 @@ static void relaxation_iteration_uv(UvSculptData *sculptdata, UvElement **head_table = BM_uv_element_map_ensure_head_table(sculptdata->elementMap); const int total_uvs = sculptdata->elementMap->total_uvs; - float(*delta_buf)[3] = (float(*)[3])MEM_callocN(total_uvs * sizeof(float[3]), __func__); + float (*delta_buf)[3] = (float (*)[3])MEM_callocN(total_uvs * sizeof(float[3]), __func__); const UvElement *storage = sculptdata->elementMap->storage; for (int j = 0; j < total_uvs; j++) { @@ -412,9 +412,9 @@ static void relaxation_iteration_uv(UvSculptData *sculptdata, const float *v_prev_co = ele_prev->l->v->co; const float *v_next_co = ele_next->l->v->co; - const float(*luv_curr)[2] = BM_ELEM_CD_GET_FLOAT2_P(ele_curr->l, cd_loop_uv_offset); - const float(*luv_next)[2] = BM_ELEM_CD_GET_FLOAT2_P(ele_next->l, cd_loop_uv_offset); - const float(*luv_prev)[2] = BM_ELEM_CD_GET_FLOAT2_P(ele_prev->l, cd_loop_uv_offset); + const float (*luv_curr)[2] = BM_ELEM_CD_GET_FLOAT2_P(ele_curr->l, cd_loop_uv_offset); + const float (*luv_next)[2] = BM_ELEM_CD_GET_FLOAT2_P(ele_next->l, cd_loop_uv_offset); + const float (*luv_prev)[2] = BM_ELEM_CD_GET_FLOAT2_P(ele_prev->l, cd_loop_uv_offset); const UvElement *head_curr = head_table[ele_curr - sculptdata->elementMap->storage]; const UvElement *head_next = head_table[ele_next - sculptdata->elementMap->storage]; @@ -457,7 +457,7 @@ static void relaxation_iteration_uv(UvSculptData *sculptdata, const float *delta_sum = delta_buf[adj_el->element - storage]; { - const float(*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(adj_el->element->l, cd_loop_uv_offset); + const float (*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(adj_el->element->l, cd_loop_uv_offset); BLI_assert(adj_el->uv == (float *)luv); /* Only true for head. */ adj_el->uv[0] = (*luv)[0] + strength * safe_divide(delta_sum[0], delta_sum[2]); adj_el->uv[1] = (*luv)[1] + strength * safe_divide(delta_sum[1], delta_sum[2]); @@ -467,7 +467,7 @@ static void relaxation_iteration_uv(UvSculptData *sculptdata, /* Copy UV co-ordinates to all UvElements. */ UvElement *tail = adj_el->element; while (tail) { - float(*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(tail->l, cd_loop_uv_offset); + float (*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(tail->l, cd_loop_uv_offset); copy_v2_v2(*luv, adj_el->uv); tail = tail->next; if (tail && tail->separate) { @@ -538,7 +538,7 @@ static void uv_sculpt_stroke_apply(bContext *C, if (element->separate && element != sculptdata->uv[i].element) { break; } - float(*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); + float (*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); copy_v2_v2(*luv, sculptdata->uv[i].uv); } } @@ -575,7 +575,7 @@ static void uv_sculpt_stroke_apply(bContext *C, if (element->separate && element != sculptdata->uv[uvindex].element) { break; } - float(*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); + float (*luv)[2] = BM_ELEM_CD_GET_FLOAT2_P(element->l, cd_loop_uv_offset); copy_v2_v2(*luv, sculptdata->uv[uvindex].uv); } } @@ -670,7 +670,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm ARegion *region = CTX_wm_region(C); float co[2]; BMFace *efa; - float(*luv)[2]; + float (*luv)[2]; BMLoop *l; BMIter iter, liter; diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 7204aea6557..235d4b3ef1a 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -1743,7 +1743,7 @@ static void nodesocket_cache_flush() batch, "parameters", 4, - reinterpret_cast(g_batch_nodesocket().params.data())); + reinterpret_cast(g_batch_nodesocket().params.data())); GPU_batch_draw(batch); } else { @@ -1752,7 +1752,7 @@ static void nodesocket_cache_flush() batch, "parameters", MAX_SOCKET_PARAMETERS * MAX_SOCKET_INSTANCE, - reinterpret_cast(g_batch_nodesocket().params.data())); + reinterpret_cast(g_batch_nodesocket().params.data())); GPU_batch_draw_instance_range(batch, 0, g_batch_nodesocket().params.size()); } g_batch_nodesocket().params.clear(); @@ -1788,7 +1788,7 @@ static void draw_node_socket_batch(const NodeSocketShaderParameters &socket_para gpu::Batch *batch = nodesocket_batch_init(); GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_NODE_SOCKET); GPU_batch_uniform_4fv_array( - batch, "parameters", MAX_SOCKET_PARAMETERS, (const float(*)[4])(&socket_params)); + batch, "parameters", MAX_SOCKET_PARAMETERS, (const float (*)[4])(&socket_params)); GPU_batch_draw(batch); } } diff --git a/source/blender/editors/space_node/node_gizmo.cc b/source/blender/editors/space_node/node_gizmo.cc index d4ecedf4102..618320e9f0d 100644 --- a/source/blender/editors/space_node/node_gizmo.cc +++ b/source/blender/editors/space_node/node_gizmo.cc @@ -110,7 +110,7 @@ static void gizmo_node_backdrop_prop_matrix_get(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, void *value_p) { - float(*matrix)[4] = (float(*)[4])value_p; + float (*matrix)[4] = (float (*)[4])value_p; BLI_assert(gz_prop->type->array_length == 16); const SpaceNode *snode = (const SpaceNode *)gz_prop->custom_func.user_data; matrix[0][0] = snode->zoom; @@ -123,7 +123,7 @@ static void gizmo_node_backdrop_prop_matrix_set(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = (const float(*)[4])value_p; + const float (*matrix)[4] = (const float (*)[4])value_p; BLI_assert(gz_prop->type->array_length == 16); SpaceNode *snode = (SpaceNode *)gz_prop->custom_func.user_data; snode->zoom = matrix[0][0]; @@ -311,7 +311,7 @@ static void gizmo_node_crop_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - float(*matrix)[4] = (float(*)[4])value_p; + float (*matrix)[4] = (float (*)[4])value_p; BLI_assert(gz_prop->type->array_length == 16); NodeBBoxWidgetGroup *crop_group = (NodeBBoxWidgetGroup *)gz->parent_gzgroup->customdata; const float2 dims = crop_group->state.dims; @@ -331,7 +331,7 @@ static void gizmo_node_crop_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = (const float(*)[4])value_p; + const float (*matrix)[4] = (const float (*)[4])value_p; BLI_assert(gz_prop->type->array_length == 16); NodeBBoxWidgetGroup *crop_group = (NodeBBoxWidgetGroup *)gz->parent_gzgroup->customdata; const float2 dims = crop_group->state.dims; @@ -477,7 +477,7 @@ static void gizmo_node_box_mask_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - float(*matrix)[4] = (float(*)[4])value_p; + float (*matrix)[4] = (float (*)[4])value_p; BLI_assert(gz_prop->type->array_length == 16); NodeBBoxWidgetGroup *mask_group = (NodeBBoxWidgetGroup *)gz->parent_gzgroup->customdata; const float2 dims = mask_group->state.dims; @@ -511,7 +511,7 @@ static void gizmo_node_box_mask_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = (const float(*)[4])value_p; + const float (*matrix)[4] = (const float (*)[4])value_p; BLI_assert(gz_prop->type->array_length == 16); NodeBBoxWidgetGroup *mask_group = (NodeBBoxWidgetGroup *)gz->parent_gzgroup->customdata; const float2 dims = mask_group->state.dims; @@ -1018,7 +1018,7 @@ static void gizmo_node_split_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - float(*matrix)[4] = reinterpret_cast(value_p); + float (*matrix)[4] = reinterpret_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); NodeBBoxWidgetGroup *split_group = (NodeBBoxWidgetGroup *)gz->parent_gzgroup->customdata; const float2 dims = split_group->state.dims; @@ -1047,7 +1047,7 @@ static void gizmo_node_split_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = reinterpret_cast(value_p); + const float (*matrix)[4] = reinterpret_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); NodeBBoxWidgetGroup *split_group = reinterpret_cast( gz->parent_gzgroup->customdata); diff --git a/source/blender/editors/space_view3d/view3d_cursor_snap.cc b/source/blender/editors/space_view3d/view3d_cursor_snap.cc index 88263430aba..73d4f6a8e9f 100644 --- a/source/blender/editors/space_view3d/view3d_cursor_snap.cc +++ b/source/blender/editors/space_view3d/view3d_cursor_snap.cc @@ -184,7 +184,7 @@ static void v3d_cursor_plane_draw_grid(const int resolution, immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR); const size_t coords_len = resolution * resolution; - float(*coords)[3] = static_cast( + float (*coords)[3] = static_cast( MEM_mallocN(sizeof(*coords) * coords_len, __func__)); const int axis_x = (plane_axis + 0) % 3; diff --git a/source/blender/editors/space_view3d/view3d_gizmo_camera.cc b/source/blender/editors/space_view3d/view3d_gizmo_camera.cc index d63cbd83338..1b4aecc5fcd 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_camera.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_camera.cc @@ -341,7 +341,7 @@ static void gizmo_render_border_prop_matrix_get(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, void *value_p) { - float(*matrix)[4] = static_cast(value_p); + float (*matrix)[4] = static_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); CameraViewWidgetGroup *viewgroup = static_cast( gz_prop->custom_func.user_data); @@ -358,7 +358,7 @@ static void gizmo_render_border_prop_matrix_set(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = static_cast(value_p); + const float (*matrix)[4] = static_cast(value_p); CameraViewWidgetGroup *viewgroup = static_cast( gz_prop->custom_func.user_data); rctf *border = viewgroup->state.edit_border; diff --git a/source/blender/editors/space_view3d/view3d_gizmo_empty.cc b/source/blender/editors/space_view3d/view3d_gizmo_empty.cc index 2441a7fd970..3ca991cae86 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_empty.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_empty.cc @@ -50,7 +50,7 @@ static void gizmo_empty_image_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - float(*matrix)[4] = static_cast(value_p); + float (*matrix)[4] = static_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); EmptyImageWidgetGroup *igzgroup = static_cast( gz_prop->custom_func.user_data); @@ -73,7 +73,7 @@ static void gizmo_empty_image_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = static_cast(value_p); + const float (*matrix)[4] = static_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); EmptyImageWidgetGroup *igzgroup = static_cast( gz_prop->custom_func.user_data); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_light.cc b/source/blender/editors/space_view3d/view3d_gizmo_light.cc index d3901c6e476..f949e9fcf81 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_light.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_light.cc @@ -53,7 +53,7 @@ static void gizmo_spot_blend_prop_matrix_get(const wmGizmo * /*gz*/, void *value_p) { BLI_assert(gz_prop->type->array_length == 16); - float(*matrix)[4] = static_cast(value_p); + float (*matrix)[4] = static_cast(value_p); const bContext *C = static_cast(gz_prop->custom_func.user_data); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -75,7 +75,7 @@ static void gizmo_spot_blend_prop_matrix_set(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = static_cast(value_p); + const float (*matrix)[4] = static_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); const bContext *C = static_cast(gz_prop->custom_func.user_data); @@ -103,7 +103,7 @@ static void gizmo_light_radius_prop_matrix_get(const wmGizmo * /*gz*/, void *value_p) { BLI_assert(gz_prop->type->array_length == 16); - float(*matrix)[4] = static_cast(value_p); + float (*matrix)[4] = static_cast(value_p); const bContext *C = static_cast(gz_prop->custom_func.user_data); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -119,7 +119,7 @@ static void gizmo_light_radius_prop_matrix_set(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = static_cast(value_p); + const float (*matrix)[4] = static_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); const bContext *C = static_cast(gz_prop->custom_func.user_data); @@ -399,7 +399,7 @@ static void gizmo_area_light_prop_matrix_get(const wmGizmo * /*gz*/, void *value_p) { BLI_assert(gz_prop->type->array_length == 16); - float(*matrix)[4] = static_cast(value_p); + float (*matrix)[4] = static_cast(value_p); const Light *la = static_cast(gz_prop->custom_func.user_data); matrix[0][0] = la->area_size; @@ -411,7 +411,7 @@ static void gizmo_area_light_prop_matrix_set(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop, const void *value_p) { - const float(*matrix)[4] = static_cast(value_p); + const float (*matrix)[4] = static_cast(value_p); BLI_assert(gz_prop->type->array_length == 16); Light *la = static_cast(gz_prop->custom_func.user_data); diff --git a/source/blender/editors/space_view3d/view3d_placement.cc b/source/blender/editors/space_view3d/view3d_placement.cc index 8b8e1f5973e..4f6123fef74 100644 --- a/source/blender/editors/space_view3d/view3d_placement.cc +++ b/source/blender/editors/space_view3d/view3d_placement.cc @@ -511,7 +511,7 @@ static void draw_circle_in_quad(const float v1[3], {-1, +1}, }; - float(*coords)[3] = static_cast( + float (*coords)[3] = static_cast( MEM_mallocN(sizeof(float[3]) * (resolution + 1), __func__)); for (int i = 0; i <= resolution; i++) { float theta = ((2.0f * M_PI) * (float(i) / float(resolution))) + 0.01f; diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index 3a412c6b64e..965ef6f0eef 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -1362,7 +1362,7 @@ static bool view3d_lasso_select(bContext *C, } else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)) { changed_multi |= PE_lasso_select(C, - reinterpret_cast(mcoords.data()), + reinterpret_cast(mcoords.data()), mcoords.size(), sel_op) != OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_view3d/view3d_utils.cc b/source/blender/editors/space_view3d/view3d_utils.cc index 20b77a6c74f..7b392cfd702 100644 --- a/source/blender/editors/space_view3d/view3d_utils.cc +++ b/source/blender/editors/space_view3d/view3d_utils.cc @@ -467,7 +467,7 @@ bool ED_view3d_boundbox_clip_ex(const RegionView3D *rv3d, const BoundBox *bb, fl return true; } - mul_m4_m4m4(persmatob, (float(*)[4])rv3d->persmat, obmat); + mul_m4_m4m4(persmatob, (float (*)[4])rv3d->persmat, obmat); return view3d_boundbox_clip_m4(bb, persmatob); } diff --git a/source/blender/editors/transform/transform_constraints.cc b/source/blender/editors/transform/transform_constraints.cc index e56ce29a422..3290f1c1f79 100644 --- a/source/blender/editors/transform/transform_constraints.cc +++ b/source/blender/editors/transform/transform_constraints.cc @@ -482,7 +482,7 @@ static void applyObjectConstraintVec(const TransInfo *t, copy_v3_v3(out, in); if (t->con.mode & CON_APPLY) { mul_m3_v3(t->spacemtx_inv, out); - const float(*axismtx)[3] = transform_object_axismtx_get(t, tc, td); + const float (*axismtx)[3] = transform_object_axismtx_get(t, tc, td); mul_m3_v3(axismtx, out); if (t->flag & T_EDIT) { mul_m3_v3(tc->mat3_unit, out); @@ -529,7 +529,7 @@ static void applyObjectConstraintSize(const TransInfo *t, float tmat[3][3]; float imat[3][3]; - const float(*axismtx)[3] = transform_object_axismtx_get(t, tc, td); + const float (*axismtx)[3] = transform_object_axismtx_get(t, tc, td); invert_m3_m3(imat, axismtx); if (!(t->con.mode & CON_AXIS0)) { @@ -606,7 +606,7 @@ static void applyObjectConstraintRot(const TransInfo *t, { if (t->con.mode & CON_APPLY) { float tmp_axismtx[3][3]; - const float(*axismtx)[3]; + const float (*axismtx)[3]; /* On setup call, use first object. */ if (td == nullptr) { @@ -960,7 +960,7 @@ static void drawObjectConstraint(TransInfo *t) TransData *td = tc->data; for (int i = 0; i < tc->data_len; i++, td++) { float co[3]; - const float(*axismtx)[3]; + const float (*axismtx)[3]; if (t->flag & T_PROP_EDIT) { /* We're sorted, so skip the rest. */ diff --git a/source/blender/editors/transform/transform_convert_mesh.cc b/source/blender/editors/transform/transform_convert_mesh.cc index 932c41c9b15..e46bfa1abf4 100644 --- a/source/blender/editors/transform/transform_convert_mesh.cc +++ b/source/blender/editors/transform/transform_convert_mesh.cc @@ -636,7 +636,7 @@ static void mesh_customdatacorrect_apply_vert(TransCustomDataLayer *tcld, */ const bool update_loop_mdisps = is_moved && do_loop_mdisps && (tcld->cd_loop_mdisp_offset != -1); if (update_loop_mdisps) { - float(*faces_center)[3] = static_cast(BLI_array_alloca(faces_center, l_num)); + float (*faces_center)[3] = static_cast(BLI_array_alloca(faces_center, l_num)); BMLoop *l; BM_ITER_ELEM_INDEX (l, &liter, v, BM_LOOPS_OF_VERT, j) { @@ -752,7 +752,7 @@ void transform_convert_mesh_islands_calc(BMEditMesh *em, /* Group variables. */ int *groups_array = nullptr; - int(*group_index)[2] = nullptr; + int (*group_index)[2] = nullptr; bool has_only_single_islands = bm->totedgesel == 0 && bm->totfacesel == 0; if (has_only_single_islands && !calc_single_islands) { @@ -786,12 +786,12 @@ void transform_convert_mesh_islands_calc(BMEditMesh *em, BLI_assert(data.island_tot); if (calc_island_center) { - data.center = static_cast( + data.center = static_cast( MEM_mallocN(sizeof(*data.center) * data.island_tot, __func__)); } if (calc_island_axismtx) { - data.axismtx = static_cast( + data.axismtx = static_cast( MEM_mallocN(sizeof(*data.axismtx) * data.island_tot, __func__)); } @@ -881,11 +881,11 @@ void transform_convert_mesh_islands_calc(BMEditMesh *em, if (group_tot_single != 0) { if (calc_island_center) { - data.center = static_cast(MEM_reallocN( + data.center = static_cast(MEM_reallocN( data.center, sizeof(*data.center) * (data.island_tot + group_tot_single))); } if (calc_island_axismtx) { - data.axismtx = static_cast(MEM_reallocN( + data.axismtx = static_cast(MEM_reallocN( data.axismtx, sizeof(*data.axismtx) * (data.island_tot + group_tot_single))); } @@ -1330,7 +1330,7 @@ void transform_convert_mesh_crazyspace_detect(TransInfo *t, BMEditMesh *em, TransMeshDataCrazySpace *r_crazyspace_data) { - float(*quats)[4] = nullptr; + float (*quats)[4] = nullptr; const int prop_mode = (t->flag & T_PROP_EDIT) ? (t->flag & T_PROP_EDIT_ALL) : 0; if (BKE_modifiers_get_cage_index(t->scene, tc->obedit, nullptr, true) != -1) { Array defcos; @@ -1360,7 +1360,7 @@ void transform_convert_mesh_crazyspace_detect(TransInfo *t, { const Array mappedcos = BKE_crazyspace_get_mapped_editverts(t->depsgraph, tc->obedit); - quats = static_cast( + quats = static_cast( MEM_mallocN(em->bm->totvert * sizeof(*quats), "crazy quats")); BKE_crazyspace_set_quats_editmesh(em, defcos, mappedcos, quats, !prop_mode); } diff --git a/source/blender/editors/transform/transform_convert_mesh_uv.cc b/source/blender/editors/transform/transform_convert_mesh_uv.cc index 36c2141252c..56fde09961f 100644 --- a/source/blender/editors/transform/transform_convert_mesh_uv.cc +++ b/source/blender/editors/transform/transform_convert_mesh_uv.cc @@ -360,7 +360,7 @@ static void createTransUVs(bContext *C, TransInfo *t) BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { const bool selected = uvedit_uv_select_test(scene, l, offsets); - float(*luv)[2]; + float (*luv)[2]; const float *center = nullptr; float prop_distance = FLT_MAX; @@ -380,7 +380,7 @@ static void createTransUVs(bContext *C, TransInfo *t) } } - luv = (float(*)[2])BM_ELEM_CD_GET_FLOAT_P(l, offsets.uv); + luv = (float (*)[2])BM_ELEM_CD_GET_FLOAT_P(l, offsets.uv); UVsToTransData(t->aspect, *luv, center, prop_distance, selected, l, td++, td2d++); } } diff --git a/source/blender/editors/transform/transform_convert_tracking.cc b/source/blender/editors/transform/transform_convert_tracking.cc index 3bcca61e4b8..230c5de0625 100644 --- a/source/blender/editors/transform/transform_convert_tracking.cc +++ b/source/blender/editors/transform/transform_convert_tracking.cc @@ -489,7 +489,7 @@ static void flushTransTracking(TransInfo *t) float d[2], d2[2]; if (!tdt->smarkers) { - tdt->smarkers = static_cast(MEM_callocN( + tdt->smarkers = static_cast(MEM_callocN( sizeof(*tdt->smarkers) * tdt->markersnr, "flushTransTracking markers")); for (int a = 0; a < tdt->markersnr; a++) { copy_v2_v2(tdt->smarkers[a], tdt->markers[a].pos); diff --git a/source/blender/editors/transform/transform_gizmo_3d.cc b/source/blender/editors/transform/transform_gizmo_3d.cc index 531c295b72d..7138ce52d7f 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.cc +++ b/source/blender/editors/transform/transform_gizmo_3d.cc @@ -556,7 +556,7 @@ static int gizmo_3d_foreach_selected(const bContext *C, invert_m4_m4(obedit->runtime->world_to_object.ptr(), obedit->object_to_world().ptr()); \ Vector objects = BKE_view_layer_array_from_objects_in_edit_mode( \ scene, view_layer, CTX_wm_view3d(C)); \ - for (Object * ob_iter : objects) { \ + for (Object *ob_iter : objects) { \ const bool use_mat_local = (ob_iter != obedit); #define FOREACH_EDIT_OBJECT_END() \ @@ -1098,7 +1098,7 @@ static bool gizmo_3d_calc_pos(const bContext *C, float co_sum[3] = {0.0f, 0.0f, 0.0f}; const auto gizmo_3d_calc_center_fn = [&](const float3 &co) { add_v3_v3(co_sum, co); }; - const float(*r_mat)[4] = nullptr; + const float (*r_mat)[4] = nullptr; int totsel; totsel = gizmo_3d_foreach_selected(C, 0, @@ -2400,7 +2400,7 @@ void transform_gizmo_3d_model_from_constraint_and_mode_set(TransInfo *t) wmGizmo *gizmo_modal_current = WM_gizmomap_get_modal(t->region->runtime->gizmo_map); if (axis_idx != -1) { RegionView3D *rv3d = static_cast(t->region->regiondata); - float(*mat_cmp)[3] = t->orient[t->orient_curr != O_DEFAULT ? t->orient_curr : O_SCENE].matrix; + float (*mat_cmp)[3] = t->orient[t->orient_curr != O_DEFAULT ? t->orient_curr : O_SCENE].matrix; bool update_orientation = !(equals_v3v3(rv3d->twmat[0], mat_cmp[0]) && equals_v3v3(rv3d->twmat[1], mat_cmp[1]) && diff --git a/source/blender/editors/transform/transform_mode_trackball.cc b/source/blender/editors/transform/transform_mode_trackball.cc index 7e504f1a9cb..3eefe132633 100644 --- a/source/blender/editors/transform/transform_mode_trackball.cc +++ b/source/blender/editors/transform/transform_mode_trackball.cc @@ -43,7 +43,7 @@ static void transdata_elem_trackball(const TransInfo *t, const float mat_final[3][3]) { float mat_buf[3][3]; - const float(*mat)[3] = mat_final; + const float (*mat)[3] = mat_final; if (t->flag & T_PROP_EDIT) { axis_angle_normalized_to_mat3(mat_buf, axis, td->factor * angle); mat = mat_buf; diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index bfebe575246..270aee09dac 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -150,7 +150,7 @@ bool SnapData::snap_boundbox(const float3 &min, const float3 &max) #ifdef TEST_CLIPPLANES_IN_BOUNDBOX int isect_type = isect_aabb_planes_v3( - reinterpret_cast(this->clip_planes.data()), + reinterpret_cast(this->clip_planes.data()), this->clip_planes.size(), min, max); @@ -172,7 +172,7 @@ bool SnapData::snap_boundbox(const float3 &min, const float3 &max) bool SnapData::snap_point(const float3 &co, int index) { if (test_projected_vert_dist(&this->nearest_precalc, - reinterpret_cast(this->clip_planes.data()), + reinterpret_cast(this->clip_planes.data()), this->clip_planes.size(), this->is_persp, co, @@ -187,7 +187,7 @@ bool SnapData::snap_point(const float3 &co, int index) bool SnapData::snap_edge(const float3 &va, const float3 &vb, int edge_index) { if (test_projected_edge_dist(&this->nearest_precalc, - reinterpret_cast(this->clip_planes.data()), + reinterpret_cast(this->clip_planes.data()), this->clip_planes.size(), this->is_persp, va, @@ -555,7 +555,7 @@ void raycast_all_cb(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRay float depth; /* World-space location. */ - mul_v3_m4v3(location, (float(*)[4])data->obmat, hit->co); + mul_v3_m4v3(location, (float (*)[4])data->obmat, hit->co); depth = (hit->dist + data->len_diff) / data->local_scale; SnapObjectHitDepth *hit_item = hit_depth_create(depth, location, data->ob_uuid); diff --git a/source/blender/editors/transform/transform_snap_object.hh b/source/blender/editors/transform/transform_snap_object.hh index b472a7e3c50..61e221bb9f1 100644 --- a/source/blender/editors/transform/transform_snap_object.hh +++ b/source/blender/editors/transform/transform_snap_object.hh @@ -172,9 +172,9 @@ class SnapData { const BVHTreeRayHit *hit, const bool is_in_front); - virtual void get_vert_co(const int /*index*/, const float ** /*r_co*/){}; - virtual void get_edge_verts_index(const int /*index*/, int /*r_v_index*/[2]){}; - virtual void copy_vert_no(const int /*index*/, float /*r_no*/[3]){}; + virtual void get_vert_co(const int /*index*/, const float ** /*r_co*/) {}; + virtual void get_edge_verts_index(const int /*index*/, int /*r_v_index*/[2]) {}; + virtual void copy_vert_no(const int /*index*/, float /*r_no*/[3]) {}; }; /* `transform_snap_object.cc` */ diff --git a/source/blender/editors/transform/transform_snap_object_mesh.cc b/source/blender/editors/transform/transform_snap_object_mesh.cc index eaa94f890a1..0cedbd239c2 100644 --- a/source/blender/editors/transform/transform_snap_object_mesh.cc +++ b/source/blender/editors/transform/transform_snap_object_mesh.cc @@ -389,7 +389,7 @@ eSnapMode snap_polygon_mesh(SnapObjectContext *sctx, cb_snap_edge(&nearest2d, face_edges[i], &nearest2d.nearest_precalc, - reinterpret_cast(nearest2d.clip_planes.data()), + reinterpret_cast(nearest2d.clip_planes.data()), nearest2d.clip_planes.size(), &nearest); } @@ -401,7 +401,7 @@ eSnapMode snap_polygon_mesh(SnapObjectContext *sctx, cb_snap_vert(&nearest2d, face_verts[i], &nearest2d.nearest_precalc, - reinterpret_cast(nearest2d.clip_planes.data()), + reinterpret_cast(nearest2d.clip_planes.data()), nearest2d.clip_planes.size(), &nearest); } @@ -501,15 +501,16 @@ static eSnapMode snapMesh(SnapObjectContext *sctx, if (bvhtree[1]) { BLI_assert(snap_to & SCE_SNAP_TO_POINT); /* Snap to loose verts. */ - BLI_bvhtree_find_nearest_projected(bvhtree[1], - nearest2d.pmat_local.ptr(), - sctx->runtime.win_size, - sctx->runtime.mval, - reinterpret_cast(nearest2d.clip_planes.data()), - nearest2d.clip_planes.size(), - &nearest, - cb_snap_vert, - &nearest2d); + BLI_bvhtree_find_nearest_projected( + bvhtree[1], + nearest2d.pmat_local.ptr(), + sctx->runtime.win_size, + sctx->runtime.mval, + reinterpret_cast(nearest2d.clip_planes.data()), + nearest2d.clip_planes.size(), + &nearest, + cb_snap_vert, + &nearest2d); if (nearest.index != -1) { last_index = nearest.index; @@ -525,7 +526,7 @@ static eSnapMode snapMesh(SnapObjectContext *sctx, nearest2d.pmat_local.ptr(), sctx->runtime.win_size, sctx->runtime.mval, - reinterpret_cast(nearest2d.clip_planes.data()), + reinterpret_cast(nearest2d.clip_planes.data()), nearest2d.clip_planes.size(), &nearest, cb_snap_edge, @@ -539,7 +540,7 @@ static eSnapMode snapMesh(SnapObjectContext *sctx, nearest2d.pmat_local.ptr(), sctx->runtime.win_size, sctx->runtime.mval, - reinterpret_cast(nearest2d.clip_planes.data()), + reinterpret_cast(nearest2d.clip_planes.data()), nearest2d.clip_planes.size(), &nearest, cb_snap_tri_edges, @@ -558,7 +559,7 @@ static eSnapMode snapMesh(SnapObjectContext *sctx, nearest2d.pmat_local.ptr(), sctx->runtime.win_size, sctx->runtime.mval, - reinterpret_cast(nearest2d.clip_planes.data()), + reinterpret_cast(nearest2d.clip_planes.data()), nearest2d.clip_planes.size(), &nearest, cb_snap_edge_verts, @@ -572,7 +573,7 @@ static eSnapMode snapMesh(SnapObjectContext *sctx, nearest2d.pmat_local.ptr(), sctx->runtime.win_size, sctx->runtime.mval, - reinterpret_cast(nearest2d.clip_planes.data()), + reinterpret_cast(nearest2d.clip_planes.data()), nearest2d.clip_planes.size(), &nearest, cb_snap_tri_verts, diff --git a/source/blender/editors/uvedit/uvedit_clipboard.cc b/source/blender/editors/uvedit/uvedit_clipboard.cc index fee772460cf..9bea07a4ec7 100644 --- a/source/blender/editors/uvedit/uvedit_clipboard.cc +++ b/source/blender/editors/uvedit/uvedit_clipboard.cc @@ -219,7 +219,7 @@ static bool find_isomorphism(UvElementMap *dest, GraphISO *graph_dest = build_iso_graph(dest, dest_island_index, cd_loop_uv_offset); - int(*solution)[2] = (int(*)[2])MEM_mallocN(graph_source->n * sizeof(*solution), __func__); + int (*solution)[2] = (int (*)[2])MEM_mallocN(graph_source->n * sizeof(*solution), __func__); int solution_length = 0; const bool found = ED_uvedit_clipboard_maximum_common_subgraph( graph_source, graph_dest, solution, &solution_length, r_search_abandoned); diff --git a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc index 7d0dcebf694..e0a0c00b2b5 100644 --- a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc +++ b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc @@ -318,8 +318,8 @@ static void maximum_common_subgraph_internal(int incumbent[][2], { int min = std::min(n0, n1); - uint8_t(*cur)[2] = (uint8_t(*)[2])MEM_mallocN(min * sizeof(*cur), __func__); - uint8_t(*domains)[BDS] = (uint8_t(*)[8])MEM_mallocN(min * min * sizeof(*domains), __func__); + uint8_t (*cur)[2] = (uint8_t (*)[2])MEM_mallocN(min * sizeof(*cur), __func__); + uint8_t (*domains)[BDS] = (uint8_t (*)[8])MEM_mallocN(min * min * sizeof(*domains), __func__); uint8_t *left = static_cast(MEM_mallocN(n0 * sizeof *left, __func__)); uint8_t *right = static_cast(MEM_mallocN(n1 * sizeof *right, __func__)); diff --git a/source/blender/editors/uvedit/uvedit_islands.cc b/source/blender/editors/uvedit/uvedit_islands.cc index 9cc87b95ab6..769ef56099e 100644 --- a/source/blender/editors/uvedit/uvedit_islands.cc +++ b/source/blender/editors/uvedit/uvedit_islands.cc @@ -122,7 +122,7 @@ int bm_mesh_calc_uv_islands(const Scene *scene, int *groups_array = MEM_malloc_arrayN(bm->totface, __func__); - int(*group_index)[2]; + int (*group_index)[2]; /* Set the tag for `BM_mesh_calc_face_groups`. */ BMFace *f; diff --git a/source/blender/editors/uvedit/uvedit_select.cc b/source/blender/editors/uvedit/uvedit_select.cc index d3f790ac369..fa1b71d67ed 100644 --- a/source/blender/editors/uvedit/uvedit_select.cc +++ b/source/blender/editors/uvedit/uvedit_select.cc @@ -4606,7 +4606,7 @@ static wmOperatorStatus uv_select_overlap(bContext *C, const bool extend) int data_index = 0; int face_len_alloc = 3; - float(*uv_verts)[2] = static_cast( + float (*uv_verts)[2] = static_cast( MEM_mallocN(sizeof(*uv_verts) * face_len_alloc, "UvOverlapCoords")); uint(*indices)[3] = static_cast( MEM_mallocN(sizeof(*indices) * (face_len_alloc - 2), "UvOverlapTris")); @@ -4637,7 +4637,7 @@ static wmOperatorStatus uv_select_overlap(bContext *C, const bool extend) if (face_len_alloc < face_len) { MEM_freeN(uv_verts); MEM_freeN(indices); - uv_verts = static_cast( + uv_verts = static_cast( MEM_mallocN(sizeof(*uv_verts) * face_len, "UvOverlapCoords")); indices = static_cast( MEM_mallocN(sizeof(*indices) * tri_len, "UvOverlapTris")); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.cc b/source/blender/editors/uvedit/uvedit_unwrap_ops.cc index 011e54da2f7..0ab740e85f9 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.cc +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.cc @@ -4238,7 +4238,7 @@ static wmOperatorStatus cube_project_exec(bContext *C, wmOperator *op) } float bounds[2][3]; - float(*bounds_buf)[3] = nullptr; + float (*bounds_buf)[3] = nullptr; if (!RNA_property_is_set(op->ptr, prop_cube_size)) { bounds_buf = bounds; diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index cbeb288b20f..1084e403217 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -819,8 +819,8 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) transp += 3; } } // loop over strip vertices - } // loop over strips - } // loop over strokes + } // loop over strips + } // loop over strokes BKE_object_materials_sync_length(freestyle_bmain, object_mesh, (ID *)mesh); diff --git a/source/blender/freestyle/intern/geometry/Grid.h b/source/blender/freestyle/intern/geometry/Grid.h index 36b9828191c..d2c976aa67b 100644 --- a/source/blender/freestyle/intern/geometry/Grid.h +++ b/source/blender/freestyle/intern/geometry/Grid.h @@ -72,7 +72,7 @@ class Cell { class GridVisitor { public: - virtual ~GridVisitor(){}; // soc + virtual ~GridVisitor() {}; // soc virtual void discoverCell(Cell * /*cell*/) {} @@ -382,7 +382,7 @@ class Grid { class VirtualOccludersSet { public: - VirtualOccludersSet(Grid &_grid) : grid(_grid){}; + VirtualOccludersSet(Grid &_grid) : grid(_grid) {}; Polygon3r *begin(); Polygon3r *next(); Polygon3r *next(bool stopOnNewCell); diff --git a/source/blender/freestyle/intern/geometry/Noise.cpp b/source/blender/freestyle/intern/geometry/Noise.cpp index 1d5f56ac5d0..5ab6b91ea25 100644 --- a/source/blender/freestyle/intern/geometry/Noise.cpp +++ b/source/blender/freestyle/intern/geometry/Noise.cpp @@ -48,7 +48,7 @@ namespace Freestyle { { \ (t) = (i) + (N); \ (r0) = modff((t), &(u)); \ - (r1) = (r0)-1.0; \ + (r1) = (r0) - 1.0; \ (b0) = int(u) & BM; \ (b1) = ((b0) + 1) & BM; \ } \ diff --git a/source/blender/freestyle/intern/system/PointerSequence.h b/source/blender/freestyle/intern/system/PointerSequence.h index ff4a702d5cb..188be58fb24 100644 --- a/source/blender/freestyle/intern/system/PointerSequence.h +++ b/source/blender/freestyle/intern/system/PointerSequence.h @@ -62,7 +62,7 @@ template class PointerSequence : public C { } public: - PointerSequence(){}; + PointerSequence() {}; ~PointerSequence() { diff --git a/source/blender/freestyle/intern/view_map/GridDensityProvider.h b/source/blender/freestyle/intern/view_map/GridDensityProvider.h index 535ab3b8f9f..d425f8ae983 100644 --- a/source/blender/freestyle/intern/view_map/GridDensityProvider.h +++ b/source/blender/freestyle/intern/view_map/GridDensityProvider.h @@ -32,7 +32,7 @@ class GridDensityProvider { public: GridDensityProvider(OccluderSource &source) : source(source) {} - virtual ~GridDensityProvider(){}; + virtual ~GridDensityProvider() {}; float cellSize() { diff --git a/source/blender/freestyle/intern/view_map/Interface0D.h b/source/blender/freestyle/intern/view_map/Interface0D.h index 3890c8d657e..8df2a4c260f 100644 --- a/source/blender/freestyle/intern/view_map/Interface0D.h +++ b/source/blender/freestyle/intern/view_map/Interface0D.h @@ -44,7 +44,7 @@ class Interface0D { Interface0D() {} /** Destructor */ - virtual ~Interface0D(){}; + virtual ~Interface0D() {}; /** Returns the string "Interface0D". */ virtual string getExactTypeName() const diff --git a/source/blender/freestyle/intern/view_map/Interface1D.h b/source/blender/freestyle/intern/view_map/Interface1D.h index 33af70f7d99..50a4ee23b5a 100644 --- a/source/blender/freestyle/intern/view_map/Interface1D.h +++ b/source/blender/freestyle/intern/view_map/Interface1D.h @@ -138,7 +138,7 @@ class Interface1D { } /** Destructor */ - virtual ~Interface1D(){}; + virtual ~Interface1D() {}; /** Returns the string "Interface1D". */ virtual string getExactTypeName() const diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.h b/source/blender/freestyle/intern/winged_edge/WEdge.h index bfc1ecd3e9c..c82b6e57711 100644 --- a/source/blender/freestyle/intern/winged_edge/WEdge.h +++ b/source/blender/freestyle/intern/winged_edge/WEdge.h @@ -347,7 +347,7 @@ class WOEdge { userdata = nullptr; } - virtual ~WOEdge(){}; // soc + virtual ~WOEdge() {}; // soc /** copy constructor */ WOEdge(WOEdge &iBrother); diff --git a/source/blender/functions/FN_multi_function_builder.hh b/source/blender/functions/FN_multi_function_builder.hh index b56af63b1f4..199c4264478 100644 --- a/source/blender/functions/FN_multi_function_builder.hh +++ b/source/blender/functions/FN_multi_function_builder.hh @@ -131,14 +131,13 @@ template /*param_tags*/, - std::index_sequence /*indices*/, - ElementFn element_fn, - MaskT mask, - /* Use restrict to tell the compiler that pointer inputs do not alias - * each other. This is important for some compiler optimizations. */ - Args &&__restrict... args) +inline void execute_array(TypeSequence /*param_tags*/, + std::index_sequence /*indices*/, + ElementFn element_fn, + MaskT mask, + /* Use restrict to tell the compiler that pointer inputs do not alias + * each other. This is important for some compiler optimizations. */ + Args &&__restrict... args) { if constexpr (std::is_same_v, IndexRange>) { /* Having this explicit loop is necessary for MSVC to be able to vectorize this. */ @@ -174,11 +173,10 @@ template #if (defined(__GNUC__) && !defined(__clang__)) [[gnu::optimize("-funroll-loops")]] [[gnu::optimize("O3")]] #endif -inline void -execute_materialized_impl(TypeSequence /*param_tags*/, - const ElementFn element_fn, - const int64_t size, - Chunks &&__restrict... chunks) +inline void execute_materialized_impl(TypeSequence /*param_tags*/, + const ElementFn element_fn, + const int64_t size, + Chunks &&__restrict... chunks) { for (int64_t i = 0; i < size; i++) { element_fn(chunks[i]...); diff --git a/source/blender/geometry/intern/mesh_boolean.cc b/source/blender/geometry/intern/mesh_boolean.cc index 4aa8434fd3f..fe3b58d5053 100644 --- a/source/blender/geometry/intern/mesh_boolean.cc +++ b/source/blender/geometry/intern/mesh_boolean.cc @@ -602,7 +602,7 @@ static void copy_or_interp_loop_attributes(Mesh *dest_mesh, int norig = fill_orig_loops(f, orig_face, orig_me, orig_me_index, mim, orig_loops); /* We may need these arrays if we have to interpolate Loop attributes rather than just copy. * Right now, trying Array complains, so declare cos_2d a different way. */ - float(*cos_2d)[2]; + float (*cos_2d)[2]; Array weights; Array src_blocks_ofs; float axis_mat[3][3]; @@ -612,7 +612,7 @@ static void copy_or_interp_loop_attributes(Mesh *dest_mesh, * At this point we cannot yet calculate the interpolation weights, as they depend on * the coordinate where interpolation is to happen, but we can allocate the needed arrays, * so they don't have to be allocated per-layer. */ - cos_2d = (float(*)[2])BLI_array_alloca(cos_2d, orig_face.size()); + cos_2d = (float (*)[2])BLI_array_alloca(cos_2d, orig_face.size()); weights = Array(orig_face.size()); src_blocks_ofs = Array(orig_face.size()); get_poly2d_cos(orig_me, orig_face, cos_2d, mim.to_target_transform[orig_me_index], axis_mat); diff --git a/source/blender/geometry/intern/mesh_boolean_manifold.cc b/source/blender/geometry/intern/mesh_boolean_manifold.cc index 80a3e805b1c..dac0a4751e2 100644 --- a/source/blender/geometry/intern/mesh_boolean_manifold.cc +++ b/source/blender/geometry/intern/mesh_boolean_manifold.cc @@ -1561,7 +1561,7 @@ static void interpolate_corner_attributes(bke::MutableAttributeAccessor &output_ const Span out_face_verts = output_corner_verts.slice(out_face); weights.resize(in_face_size); cos_2d.resize(in_face_size); - float(*cos_2d_p)[2] = reinterpret_cast(cos_2d.data()); + float (*cos_2d_p)[2] = reinterpret_cast(cos_2d.data()); const float3 axis_dominant = bke::mesh::face_normal_calc(input_vert_positions, in_face_verts); axis_dominant_v3_to_m3(axis_mat.ptr(), axis_dominant); diff --git a/source/blender/geometry/intern/mesh_triangulate.cc b/source/blender/geometry/intern/mesh_triangulate.cc index 199f47e6337..7d6563070e0 100644 --- a/source/blender/geometry/intern/mesh_triangulate.cc +++ b/source/blender/geometry/intern/mesh_triangulate.cc @@ -414,12 +414,12 @@ static void calc_corner_tris(const Span positions, const Span positions_2d = projected_positions.slice(local_corner_offsets[i]); const IndexRange tris_range = tris_by_ngon[pos + i]; MutableSpan map = corner_tris.slice(tris_range).cast(); - BLI_polyfill_calc(reinterpret_cast(positions_2d.data()), + BLI_polyfill_calc(reinterpret_cast(positions_2d.data()), positions_2d.size(), 1, reinterpret_cast(map.data())); if (ngon_mode == TriangulateNGonMode::Beauty) { - BLI_polyfill_beautify(reinterpret_cast(positions_2d.data()), + BLI_polyfill_beautify(reinterpret_cast(positions_2d.data()), positions_2d.size(), reinterpret_cast(map.data()), data.arena, diff --git a/source/blender/geometry/intern/uv_pack.cc b/source/blender/geometry/intern/uv_pack.cc index bfcafb33ca8..ab96ff67be4 100644 --- a/source/blender/geometry/intern/uv_pack.cc +++ b/source/blender/geometry/intern/uv_pack.cc @@ -168,7 +168,7 @@ void PackIsland::add_polygon(const Span uvs, MemArena *arena, Heap *heap /* Storage. */ uint(*tris)[3] = static_cast( BLI_memarena_alloc(arena, sizeof(*tris) * size_t(nfilltri))); - const float(*source)[2] = reinterpret_cast(uvs.data()); + const float (*source)[2] = reinterpret_cast(uvs.data()); /* Triangulate. */ BLI_polyfill_calc_arena(source, vert_count, 0, tris, arena); diff --git a/source/blender/geometry/intern/uv_parametrizer.cc b/source/blender/geometry/intern/uv_parametrizer.cc index 57f2bf70c14..7431f289a52 100644 --- a/source/blender/geometry/intern/uv_parametrizer.cc +++ b/source/blender/geometry/intern/uv_parametrizer.cc @@ -3855,7 +3855,7 @@ static void p_add_ngon(ParamHandle *handle, uint nfilltri = nverts - 2; uint(*tris)[3] = static_cast( BLI_memarena_alloc(arena, sizeof(*tris) * size_t(nfilltri))); - float(*projverts)[2] = static_cast( + float (*projverts)[2] = static_cast( BLI_memarena_alloc(arena, sizeof(*projverts) * size_t(nverts))); /* Calc normal, flipped: to get a positive 2d cross product. */ diff --git a/source/blender/gpu/GPU_framebuffer.hh b/source/blender/gpu/GPU_framebuffer.hh index 36cd62507f2..18347a99324 100644 --- a/source/blender/gpu/GPU_framebuffer.hh +++ b/source/blender/gpu/GPU_framebuffer.hh @@ -138,14 +138,9 @@ struct GPULoadStore { }; /* Empty bind point. */ -#define NULL_ATTACHMENT_COLOR \ - { \ - 0.0, 0.0, 0.0, 0.0 \ - } +#define NULL_ATTACHMENT_COLOR {0.0, 0.0, 0.0, 0.0} #define NULL_LOAD_STORE \ - { \ - GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_DONT_CARE, NULL_ATTACHMENT_COLOR \ - } + {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_DONT_CARE, NULL_ATTACHMENT_COLOR} /** * Load store config array (load_store_actions) matches attachment structure of @@ -262,32 +257,44 @@ void GPU_framebuffer_config_array(blender::gpu::FrameBuffer *fb, /** Empty bind point. */ #define GPU_ATTACHMENT_NONE \ { \ - nullptr, -1, 0, \ + nullptr, \ + -1, \ + 0, \ } /** Leave currently bound texture in this slot. DEPRECATED: Specify all textures for clarity. */ #define GPU_ATTACHMENT_LEAVE \ { \ - nullptr, -1, -1, \ + nullptr, \ + -1, \ + -1, \ } /** Bind the first mip level of a texture (all layers). */ #define GPU_ATTACHMENT_TEXTURE(_texture) \ { \ - _texture, -1, 0, \ + _texture, \ + -1, \ + 0, \ } /** Bind the \a _mip level of a texture (all layers). */ #define GPU_ATTACHMENT_TEXTURE_MIP(_texture, _mip) \ { \ - _texture, -1, _mip, \ + _texture, \ + -1, \ + _mip, \ } /** Bind the \a _layer layer of the first mip level of a texture. */ #define GPU_ATTACHMENT_TEXTURE_LAYER(_texture, _layer) \ { \ - _texture, _layer, 0, \ + _texture, \ + _layer, \ + 0, \ } /** Bind the \a _layer layer of the \a _mip level of a texture. */ #define GPU_ATTACHMENT_TEXTURE_LAYER_MIP(_texture, _layer, _mip) \ { \ - _texture, _layer, _mip, \ + _texture, \ + _layer, \ + _mip, \ } /** NOTE: The cube-face variants are equivalent to the layer ones but give better semantic. */ @@ -295,12 +302,16 @@ void GPU_framebuffer_config_array(blender::gpu::FrameBuffer *fb, /** Bind the first mip level of a cube-map \a _face texture. */ #define GPU_ATTACHMENT_TEXTURE_CUBEFACE(_texture, _face) \ { \ - _texture, _face, 0, \ + _texture, \ + _face, \ + 0, \ } /** Bind the \a _mip level of a cube-map \a _face texture. */ #define GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(_texture, _face, _mip) \ { \ - _texture, _face, _mip, \ + _texture, \ + _face, \ + _mip, \ } /** diff --git a/source/blender/gpu/GPU_index_buffer.hh b/source/blender/gpu/GPU_index_buffer.hh index 59514408bb5..5208f48e3d6 100644 --- a/source/blender/gpu/GPU_index_buffer.hh +++ b/source/blender/gpu/GPU_index_buffer.hh @@ -62,7 +62,7 @@ class IndexBuf { }; public: - IndexBuf(){}; + IndexBuf() {}; virtual ~IndexBuf(); void init(uint indices_len, diff --git a/source/blender/gpu/GPU_matrix.hh b/source/blender/gpu/GPU_matrix.hh index f9f1e954ed6..74fdcb7d604 100644 --- a/source/blender/gpu/GPU_matrix.hh +++ b/source/blender/gpu/GPU_matrix.hh @@ -178,35 +178,35 @@ int GPU_matrix_stack_level_get_projection(); # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) # define _GPU_MAT3_CONST_CAST(x) \ (_Generic((x), \ - void *: (const float(*)[3])(x), \ - float *: (const float(*)[3])(x), \ - float(*)[4]: (const float(*)[3])(x), \ - const void *: (const float(*)[3])(x), \ - const float *: (const float(*)[3])(x), \ - const float(*)[3]: (const float(*)[3])(x))) + void *: (const float (*)[3])(x), \ + float *: (const float (*)[3])(x), \ + float (*)[4]: (const float (*)[3])(x), \ + const void *: (const float (*)[3])(x), \ + const float *: (const float (*)[3])(x), \ + const float (*)[3]: (const float (*)[3])(x))) # define _GPU_MAT3_CAST(x) \ (_Generic((x), \ - void *: (float(*)[3])(x), \ - float *: (float(*)[3])(x), \ - float(*)[3]: (float(*)[3])(x))) + void *: (float (*)[3])(x), \ + float *: (float (*)[3])(x), \ + float (*)[3]: (float (*)[3])(x))) # define _GPU_MAT4_CONST_CAST(x) \ (_Generic((x), \ - void *: (const float(*)[4])(x), \ - float *: (const float(*)[4])(x), \ - float(*)[4]: (const float(*)[4])(x), \ - const void *: (const float(*)[4])(x), \ - const float *: (const float(*)[4])(x), \ - const float(*)[4]: (const float(*)[4])(x))) + void *: (const float (*)[4])(x), \ + float *: (const float (*)[4])(x), \ + float (*)[4]: (const float (*)[4])(x), \ + const void *: (const float (*)[4])(x), \ + const float *: (const float (*)[4])(x), \ + const float (*)[4]: (const float (*)[4])(x))) # define _GPU_MAT4_CAST(x) \ (_Generic((x), \ - void *: (float(*)[4])(x), \ - float *: (float(*)[4])(x), \ - float(*)[4]: (float(*)[4])(x))) + void *: (float (*)[4])(x), \ + float *: (float (*)[4])(x), \ + float (*)[4]: (float (*)[4])(x))) # else -# define _GPU_MAT3_CONST_CAST(x) (const float(*)[3])(x) -# define _GPU_MAT3_CAST(x) (float(*)[3])(x) -# define _GPU_MAT4_CONST_CAST(x) (const float(*)[4])(x) -# define _GPU_MAT4_CAST(x) (float(*)[4])(x) +# define _GPU_MAT3_CONST_CAST(x) (const float (*)[3])(x) +# define _GPU_MAT3_CAST(x) (float (*)[3])(x) +# define _GPU_MAT4_CONST_CAST(x) (const float (*)[4])(x) +# define _GPU_MAT4_CAST(x) (float (*)[4])(x) # endif /* C11 */ /* make matrix inputs generic, to avoid warnings */ diff --git a/source/blender/gpu/dummy/dummy_framebuffer.hh b/source/blender/gpu/dummy/dummy_framebuffer.hh index ba954beb2d2..8db863a2362 100644 --- a/source/blender/gpu/dummy/dummy_framebuffer.hh +++ b/source/blender/gpu/dummy/dummy_framebuffer.hh @@ -36,7 +36,7 @@ class DummyFrameBuffer : public FrameBuffer { void attachment_set_loadstore_op(GPUAttachmentType /*type*/, GPULoadStore /*ls*/) override {} void subpass_transition_impl(const GPUAttachmentState /*depth_attachment_state*/, - Span /*color_attachment_states*/) override{}; + Span /*color_attachment_states*/) override {}; void read(GPUFrameBufferBits /*planes*/, eGPUDataFormat /*format*/, diff --git a/source/blender/gpu/intern/gpu_batch_utils.cc b/source/blender/gpu/intern/gpu_batch_utils.cc index 7a60d35ff9f..6fc02629b7a 100644 --- a/source/blender/gpu/intern/gpu_batch_utils.cc +++ b/source/blender/gpu/intern/gpu_batch_utils.cc @@ -32,8 +32,8 @@ blender::gpu::Batch *GPU_batch_tris_from_poly_2d_encoded(const uchar *polys_flat BLI_assert(polys_flat_len == polys_len * 2); /* Over alloc in both cases */ - float(*verts)[2] = static_cast(MEM_mallocN(sizeof(*verts) * polys_len, __func__)); - float(*verts_step)[2] = verts; + float (*verts)[2] = static_cast(MEM_mallocN(sizeof(*verts) * polys_len, __func__)); + float (*verts_step)[2] = verts; uint(*tris)[3] = static_cast(MEM_mallocN(sizeof(*tris) * polys_len, __func__)); uint(*tris_step)[3] = tris; diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh index c68038378ed..21c9d162fb0 100644 --- a/source/blender/gpu/intern/gpu_context_private.hh +++ b/source/blender/gpu/intern/gpu_context_private.hh @@ -103,8 +103,8 @@ class Context { virtual void memory_statistics_get(int *r_total_mem, int *r_free_mem) = 0; - virtual void debug_group_begin(const char * /*name*/, int /*index*/){}; - virtual void debug_group_end(){}; + virtual void debug_group_begin(const char * /*name*/, int /*index*/) {}; + virtual void debug_group_end() {}; /* Returns true if capture successfully started. */ virtual bool debug_capture_begin(const char *title) = 0; diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index b5df424a906..20fc21cee51 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -615,7 +615,7 @@ void immUniform4fv(const char *name, const float data[4]) void immUniformArray4fv(const char *name, const float *data, int count) { - GPU_shader_uniform_4fv_array(imm->shader, name, count, (const float(*)[4])data); + GPU_shader_uniform_4fv_array(imm->shader, name, count, (const float (*)[4])data); } void immUniformMatrix4fv(const char *name, const float data[4][4]) diff --git a/source/blender/gpu/intern/gpu_material.cc b/source/blender/gpu/intern/gpu_material.cc index d67647e834c..e862f3d01b4 100644 --- a/source/blender/gpu/intern/gpu_material.cc +++ b/source/blender/gpu/intern/gpu_material.cc @@ -99,7 +99,7 @@ struct GPUMaterial { std::string name; - GPUMaterial(eGPUMaterialEngine engine) : engine(engine){}; + GPUMaterial(eGPUMaterialEngine engine) : engine(engine) {}; ~GPUMaterial() { diff --git a/source/blender/gpu/intern/gpu_matrix.cc b/source/blender/gpu/intern/gpu_matrix.cc index 0f1bce01c62..d80367bfa46 100644 --- a/source/blender/gpu/intern/gpu_matrix.cc +++ b/source/blender/gpu/intern/gpu_matrix.cc @@ -57,9 +57,7 @@ GPUMatrixState *GPU_matrix_state_create() #define MATRIX_4X4_IDENTITY \ { \ {1.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f, 0.0f}, \ - { \ - 0.0f, 0.0f, 0.0f, 1.0f \ - } \ + {0.0f, 0.0f, 0.0f, 1.0f} \ } GPUMatrixState *state = (GPUMatrixState *)MEM_mallocN(sizeof(*state), __func__); diff --git a/source/blender/gpu/intern/gpu_shader_create_info.hh b/source/blender/gpu/intern/gpu_shader_create_info.hh index 256e22e0d2c..1581b50cd51 100644 --- a/source/blender/gpu/intern/gpu_shader_create_info.hh +++ b/source/blender/gpu/intern/gpu_shader_create_info.hh @@ -641,7 +641,7 @@ struct StageInterfaceInfo { Vector inouts; StageInterfaceInfo(const char *name_, const char *instance_name_ = "") - : name(name_), instance_name(instance_name_){}; + : name(name_), instance_name(instance_name_) {}; ~StageInterfaceInfo() = default; using Self = StageInterfaceInfo; @@ -899,7 +899,7 @@ struct ShaderCreateInfo { StorageBuf storagebuf; }; - Resource(BindType type, int _slot) : bind_type(type), slot(_slot){}; + Resource(BindType type, int _slot) : bind_type(type), slot(_slot) {}; bool operator==(const Resource &b) const { @@ -1002,7 +1002,7 @@ struct ShaderCreateInfo { # endif public: - ShaderCreateInfo(const char *name) : name_(name){}; + ShaderCreateInfo(const char *name) : name_(name) {}; ~ShaderCreateInfo() = default; using Self = ShaderCreateInfo; diff --git a/source/blender/gpu/intern/gpu_shader_private.hh b/source/blender/gpu/intern/gpu_shader_private.hh index 72729453bbf..9e930352945 100644 --- a/source/blender/gpu/intern/gpu_shader_private.hh +++ b/source/blender/gpu/intern/gpu_shader_private.hh @@ -273,7 +273,7 @@ class ShaderCompiler { Shader *compile(const shader::ShaderCreateInfo &info, bool is_batch_compilation); virtual Shader *compile_shader(const shader::ShaderCreateInfo &info); - virtual void specialize_shader(ShaderSpecialization & /*specialization*/){}; + virtual void specialize_shader(ShaderSpecialization & /*specialization*/) {}; BatchHandle batch_compile(Span &infos, CompilationPriority priority); diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh index 8c73cf634ca..5d0751c7304 100644 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@ -324,7 +324,7 @@ class PixelBuffer { size_t size_ = 0; public: - PixelBuffer(size_t size) : size_(size){}; + PixelBuffer(size_t size) : size_(size) {}; virtual ~PixelBuffer() = default; virtual void *map() = 0; diff --git a/source/blender/gpu/metal/mtl_backend.mm b/source/blender/gpu/metal/mtl_backend.mm index 3bf194ba91f..7072ee3afbf 100644 --- a/source/blender/gpu/metal/mtl_backend.mm +++ b/source/blender/gpu/metal/mtl_backend.mm @@ -53,8 +53,8 @@ void MTLBackend::delete_resources() MEM_delete(compiler_); } -void MTLBackend::samplers_update(){ - /* Placeholder -- Handled in MTLContext. */ +void MTLBackend::samplers_update() { + /* Placeholder -- Handled in MTLContext. */ }; Context *MTLBackend::context_alloc(void *ghost_window, void *ghost_context) diff --git a/source/blender/gpu/metal/mtl_batch.hh b/source/blender/gpu/metal/mtl_batch.hh index 025747f9077..5213f192c59 100644 --- a/source/blender/gpu/metal/mtl_batch.hh +++ b/source/blender/gpu/metal/mtl_batch.hh @@ -55,7 +55,7 @@ class MTLBatch : public Batch { uint32_t cache_life_index_ = 0; public: - MTLVertexDescriptorCache(MTLBatch *batch) : batch_(batch){}; + MTLVertexDescriptorCache(MTLBatch *batch) : batch_(batch) {}; VertexDescriptorShaderInterfacePair *find(const ShaderInterface *interface); bool insert(VertexDescriptorShaderInterfacePair &data); diff --git a/source/blender/gpu/metal/mtl_context.hh b/source/blender/gpu/metal/mtl_context.hh index 57a521d619d..bd09a261678 100644 --- a/source/blender/gpu/metal/mtl_context.hh +++ b/source/blender/gpu/metal/mtl_context.hh @@ -105,7 +105,7 @@ class MTLRenderPassState { public: MTLRenderPassState(MTLContext &context, MTLCommandBufferManager &command_buffer_manager) - : ctx(context), cmd(command_buffer_manager){}; + : ctx(context), cmd(command_buffer_manager) {}; /* Given a RenderPassState is associated with a live RenderCommandEncoder, * this state sits within the MTLCommandBufferManager. */ @@ -153,7 +153,7 @@ class MTLComputeState { public: MTLComputeState(MTLContext &context, MTLCommandBufferManager &command_buffer_manager) - : ctx(context), cmd(command_buffer_manager){}; + : ctx(context), cmd(command_buffer_manager) {}; /* Given a ComputePassState is associated with a live ComputeCommandEncoder, * this state sits within the MTLCommandBufferManager. */ @@ -595,7 +595,7 @@ class MTLCommandBufferManager { public: MTLCommandBufferManager(MTLContext &context) - : context_(context), render_pass_state_(context, *this), compute_state_(context, *this){}; + : context_(context), render_pass_state_(context, *this), compute_state_(context, *this) {}; void prepare(bool supports_render = true); /* If wait is true, CPU will stall until GPU work has completed. */ @@ -824,8 +824,8 @@ class MTLContext : public Context { bool debug_capture_scope_begin(void *scope) override; void debug_capture_scope_end(void *scope) override; - void debug_unbind_all_ubo() override{}; - void debug_unbind_all_ssbo() override{}; + void debug_unbind_all_ubo() override {}; + void debug_unbind_all_ssbo() override {}; /*** MTLContext Utility functions. */ /* diff --git a/source/blender/gpu/metal/mtl_context.mm b/source/blender/gpu/metal/mtl_context.mm index 056d559456a..39074e4c8b0 100644 --- a/source/blender/gpu/metal/mtl_context.mm +++ b/source/blender/gpu/metal/mtl_context.mm @@ -849,7 +849,7 @@ void MTLContext::set_viewports(int count, const int (&viewports)[GPU_MAX_VIEWPOR BLI_assert(this); bool changed = (this->pipeline_state.num_active_viewports != count); for (int v = 0; v < count; v++) { - const int(&viewport_info)[4] = viewports[v]; + const int (&viewport_info)[4] = viewports[v]; BLI_assert(viewport_info[0] >= 0); BLI_assert(viewport_info[1] >= 0); diff --git a/source/blender/gpu/metal/mtl_memory.hh b/source/blender/gpu/metal/mtl_memory.hh index 566bb7945aa..99d4ffee374 100644 --- a/source/blender/gpu/metal/mtl_memory.hh +++ b/source/blender/gpu/metal/mtl_memory.hh @@ -495,7 +495,7 @@ class MTLScratchBufferManager { MTLCircularBuffer *scratch_buffers_[mtl_max_scratch_buffers_]; public: - MTLScratchBufferManager(MTLContext &context) : context_(context){}; + MTLScratchBufferManager(MTLContext &context) : context_(context) {}; ~MTLScratchBufferManager(); /* Explicit initialization and freeing of resources. diff --git a/source/blender/gpu/metal/mtl_shader_generator.hh b/source/blender/gpu/metal/mtl_shader_generator.hh index c74b016415f..34f14ebb907 100644 --- a/source/blender/gpu/metal/mtl_shader_generator.hh +++ b/source/blender/gpu/metal/mtl_shader_generator.hh @@ -406,7 +406,7 @@ class MSLGeneratorInterface { const shader::ShaderCreateInfo *create_info_; public: - MSLGeneratorInterface(MTLShader &shader) : parent_shader_(shader){}; + MSLGeneratorInterface(MTLShader &shader) : parent_shader_(shader) {}; /** Prepare MSLGeneratorInterface from create-info. **/ void prepare_from_createinfo(const shader::ShaderCreateInfo *info); diff --git a/source/blender/gpu/metal/mtl_state.hh b/source/blender/gpu/metal/mtl_state.hh index 5853effb621..70941133eff 100644 --- a/source/blender/gpu/metal/mtl_state.hh +++ b/source/blender/gpu/metal/mtl_state.hh @@ -99,7 +99,7 @@ class MTLFence : public Fence { uint64_t last_signalled_value_ = 0; public: - MTLFence() : Fence(){}; + MTLFence() : Fence() {}; ~MTLFence() override; void signal() override; diff --git a/source/blender/gpu/metal/mtl_storage_buffer.hh b/source/blender/gpu/metal/mtl_storage_buffer.hh index 57f5d03ffaa..04cc60d8e60 100644 --- a/source/blender/gpu/metal/mtl_storage_buffer.hh +++ b/source/blender/gpu/metal/mtl_storage_buffer.hh @@ -81,7 +81,7 @@ class MTLStorageBuf : public StorageBuf { void copy_sub(VertBuf *src, uint dst_offset, uint src_offset, uint copy_size) override; void read(void *data) override; void async_flush_to_host() override; - void sync_as_indirect_buffer() override{/* No-Op. */}; + void sync_as_indirect_buffer() override { /* No-Op. */ }; void init(); diff --git a/source/blender/gpu/opengl/gl_backend.hh b/source/blender/gpu/opengl/gl_backend.hh index 9313d1f87cf..0213822003a 100644 --- a/source/blender/gpu/opengl/gl_backend.hh +++ b/source/blender/gpu/opengl/gl_backend.hh @@ -178,9 +178,9 @@ class GLBackend : public GPUBackend { } /* Render Frame Coordination */ - void render_begin() override{}; - void render_end() override{}; - void render_step(bool /*force_resource_release*/) override{}; + void render_begin() override {}; + void render_end() override {}; + void render_step(bool /*force_resource_release*/) override {}; bool debug_capture_begin(const char *title); void debug_capture_end(); diff --git a/source/blender/gpu/opengl/gl_shader.hh b/source/blender/gpu/opengl/gl_shader.hh index b9a6f09edda..2ae9610b447 100644 --- a/source/blender/gpu/opengl/gl_shader.hh +++ b/source/blender/gpu/opengl/gl_shader.hh @@ -141,7 +141,7 @@ class GLShader : public Shader { void compute_shader_from_glsl(MutableSpan sources) override; bool finalize(const shader::ShaderCreateInfo *info = nullptr) override; bool post_finalize(const shader::ShaderCreateInfo *info = nullptr); - void warm_cache(int /*limit*/) override{}; + void warm_cache(int /*limit*/) override {}; std::string resources_declare(const shader::ShaderCreateInfo &info) const override; std::string constants_declare(const shader::SpecializationConstants &constants_state) const; @@ -198,7 +198,8 @@ class GLShader : public Shader { class GLShaderCompiler : public ShaderCompiler { public: GLShaderCompiler() - : ShaderCompiler(GPU_max_parallel_compilations(), GPUWorker::ContextType::PerThread, true){}; + : ShaderCompiler(GPU_max_parallel_compilations(), GPUWorker::ContextType::PerThread, true) { + }; virtual void specialize_shader(ShaderSpecialization &specialization) override; }; @@ -250,7 +251,8 @@ class GLSubprocessShaderCompiler : public ShaderCompiler { public: GLSubprocessShaderCompiler() - : ShaderCompiler(GPU_max_parallel_compilations(), GPUWorker::ContextType::PerThread, true){}; + : ShaderCompiler(GPU_max_parallel_compilations(), GPUWorker::ContextType::PerThread, true) { + }; virtual ~GLSubprocessShaderCompiler() override; virtual Shader *compile_shader(const shader::ShaderCreateInfo &info) override; diff --git a/source/blender/gpu/opengl/gl_state.hh b/source/blender/gpu/opengl/gl_state.hh index f3e2ebf0810..a2a60c5efd1 100644 --- a/source/blender/gpu/opengl/gl_state.hh +++ b/source/blender/gpu/opengl/gl_state.hh @@ -112,7 +112,7 @@ class GLFence : public Fence { GLsync gl_sync_ = 0; public: - GLFence() : Fence(){}; + GLFence() : Fence() {}; ~GLFence(); void signal() override; diff --git a/source/blender/gpu/tests/framebuffer_test.cc b/source/blender/gpu/tests/framebuffer_test.cc index d83c25da31d..16645ce503a 100644 --- a/source/blender/gpu/tests/framebuffer_test.cc +++ b/source/blender/gpu/tests/framebuffer_test.cc @@ -105,7 +105,7 @@ static void test_framebuffer_clear_multiple_color_multiple_attachments() const float4 clear_color[2] = {float4(0.1f, 0.2f, 0.5f, 1.0f), float4(0.5f, 0.2f, 0.1f, 1.0f)}; GPU_framebuffer_multi_clear( - framebuffer, static_cast(static_cast(clear_color))); + framebuffer, static_cast(static_cast(clear_color))); GPU_finish(); float4 *read_data1 = static_cast(GPU_texture_read(texture1, GPU_DATA_FLOAT, 0)); diff --git a/source/blender/gpu/vulkan/vk_descriptor_set.hh b/source/blender/gpu/vulkan/vk_descriptor_set.hh index 864710e8cc2..2470708b511 100644 --- a/source/blender/gpu/vulkan/vk_descriptor_set.hh +++ b/source/blender/gpu/vulkan/vk_descriptor_set.hh @@ -81,7 +81,7 @@ class VKDescriptorSet : NonCopyable { class VKDescriptorSetUpdator { public: - virtual ~VKDescriptorSetUpdator(){}; + virtual ~VKDescriptorSetUpdator() {}; virtual void allocate_new_descriptor_set(VKDevice &device, VKContext &context, diff --git a/source/blender/gpu/vulkan/vk_storage_buffer.hh b/source/blender/gpu/vulkan/vk_storage_buffer.hh index 32382e77cac..af5b4aee3aa 100644 --- a/source/blender/gpu/vulkan/vk_storage_buffer.hh +++ b/source/blender/gpu/vulkan/vk_storage_buffer.hh @@ -38,7 +38,7 @@ class VKStorageBuffer : public StorageBuf { void copy_sub(VertBuf *src, uint dst_offset, uint src_offset, uint copy_size) override; void read(void *data) override; void async_flush_to_host() override; - void sync_as_indirect_buffer() override{/* No-Op. */}; + void sync_as_indirect_buffer() override { /* No-Op. */ }; VkBuffer vk_handle() const { diff --git a/source/blender/imbuf/intern/thumbs.cc b/source/blender/imbuf/intern/thumbs.cc index a48495902e3..0a287f9e2a6 100644 --- a/source/blender/imbuf/intern/thumbs.cc +++ b/source/blender/imbuf/intern/thumbs.cc @@ -167,7 +167,7 @@ static void escape_uri_string(const char *string, const int escaped_string_size, const eUnsafeCharacterSet mask) { -#define ACCEPTABLE(a) ((a) >= 32 && (a) < 128 && (acceptable[(a)-32] & mask)) +#define ACCEPTABLE(a) ((a) >= 32 && (a) < 128 && (acceptable[(a) - 32] & mask)) BLI_assert(escaped_string_size > 0); /* Remove space for \0. */ diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.cc b/source/blender/io/alembic/exporter/abc_writer_hair.cc index 9796e86e536..b520b103ed5 100644 --- a/source/blender/io/alembic/exporter/abc_writer_hair.cc +++ b/source/blender/io/alembic/exporter/abc_writer_hair.cc @@ -168,8 +168,8 @@ void ABCHairWriter::write_hair_sample(const HierarchyContext &context, uv_values.emplace_back(uv[0], uv[1]); psys_interpolate_face(mesh, - reinterpret_cast(positions.data()), - reinterpret_cast(vert_normals.data()), + reinterpret_cast(positions.data()), + reinterpret_cast(vert_normals.data()), face, tface, nullptr, @@ -286,8 +286,8 @@ void ABCHairWriter::write_hair_child_sample(const HierarchyContext &context, uv_values.emplace_back(uv[0], uv[1]); psys_interpolate_face(mesh, - reinterpret_cast(positions.data()), - reinterpret_cast(vert_normals.data()), + reinterpret_cast(positions.data()), + reinterpret_cast(vert_normals.data()), face, tface, nullptr, diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index f26d346d571..4d83596cb8e 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -370,7 +370,7 @@ bool ABCGenericMeshWriter::get_velocities(Mesh *mesh, std::vector &v } const int totverts = mesh->verts_num; - const float(*mesh_velocities)[3] = reinterpret_cast(velocity_layer->data); + const float (*mesh_velocities)[3] = reinterpret_cast(velocity_layer->data); vels.clear(); vels.resize(totverts); diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index 3603d7c3578..08ffe15f827 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -248,7 +248,7 @@ void write_generated_coordinates(const OCompoundProperty &prop, CDStreamConfig & /* Data not available, so don't even bother creating an Alembic property for it. */ return; } - const float(*orcodata)[3] = static_cast(customdata); + const float (*orcodata)[3] = static_cast(customdata); /* Convert 3D vertices from float[3] z=up to V3f y=up. */ std::vector coords(config.totvert); @@ -261,7 +261,7 @@ void write_generated_coordinates(const OCompoundProperty &prop, CDStreamConfig & /* ORCOs are always stored in the normalized 0..1 range in Blender, but Alembic stores them * unnormalized, so we need to unnormalize (invert transform) them. */ BKE_mesh_orco_verts_transform( - mesh, reinterpret_cast(coords.data()), mesh->verts_num, true); + mesh, reinterpret_cast(coords.data()), mesh->verts_num, true); if (!config.abc_orco.valid()) { /* Create the Alembic property and keep a reference so future frames can reuse it. */ @@ -524,7 +524,7 @@ void read_velocity(const V3fArraySamplePtr &velocities, AttributeOwner owner = AttributeOwner::from_id(&config.mesh->id); CustomDataLayer *velocity_layer = BKE_attribute_new( owner, "velocity", CD_PROP_FLOAT3, bke::AttrDomain::Point, nullptr); - float(*velocity)[3] = (float(*)[3])velocity_layer->data; + float (*velocity)[3] = (float (*)[3])velocity_layer->data; for (int i = 0; i < num_velocity_vectors; i++) { const Imath::V3f &vel_in = (*velocities)[i]; @@ -571,7 +571,7 @@ void read_generated_coordinates(const ICompoundProperty &prop, cd_data = CustomData_add_layer(&mesh->vert_data, CD_ORCO, CD_CONSTRUCT, totvert); } - float(*orcodata)[3] = static_cast(cd_data); + float (*orcodata)[3] = static_cast(cd_data); for (int vertex_idx = 0; vertex_idx < totvert; ++vertex_idx) { const Imath::V3f &abc_coords = (*abc_orco)[vertex_idx]; copy_zup_from_yup(orcodata[vertex_idx], abc_coords.getValue()); diff --git a/source/blender/io/usd/intern/usd_blend_shape_utils.cc b/source/blender/io/usd/intern/usd_blend_shape_utils.cc index c66b761dd03..5f4d8c3d338 100644 --- a/source/blender/io/usd/intern/usd_blend_shape_utils.cc +++ b/source/blender/io/usd/intern/usd_blend_shape_utils.cc @@ -250,9 +250,9 @@ void create_blend_shapes(pxr::UsdStageRefPtr stage, pxr::VtIntArray indices(kb->totelem); std::iota(indices.begin(), indices.end(), 0); - const float(*fp)[3] = static_cast(kb->data); + const float (*fp)[3] = static_cast(kb->data); - const float(*basis_fp)[3] = static_cast(basis_key->data); + const float (*basis_fp)[3] = static_cast(basis_key->data); for (int i = 0; i < kb->totelem; ++i) { /* Subtract the key positions from the diff --git a/source/blender/io/usd/intern/usd_hook.cc b/source/blender/io/usd/intern/usd_hook.cc index c8119bce234..61dc7baf565 100644 --- a/source/blender/io/usd/intern/usd_hook.cc +++ b/source/blender/io/usd/intern/usd_hook.cc @@ -426,8 +426,8 @@ class USDHookInvoker { * python::call_method(hook_obj, function_name(), arg1, arg2); */ virtual void call_hook(PyObject *hook_obj) = 0; - virtual void init_in_gil(){}; - virtual void release_in_gil(){}; + virtual void init_in_gil() {}; + virtual void release_in_gil() {}; }; class OnExportInvoker final : public USDHookInvoker { diff --git a/source/blender/io/usd/intern/usd_reader_domelight.hh b/source/blender/io/usd/intern/usd_reader_domelight.hh index 13183971c56..368ba399aff 100644 --- a/source/blender/io/usd/intern/usd_reader_domelight.hh +++ b/source/blender/io/usd/intern/usd_reader_domelight.hh @@ -32,7 +32,7 @@ class USDDomeLightReader : public USDPrimReader { /* Until Blender supports DomeLight objects natively, use a separate create_object overload that * allows the caller to pass in the required Scene data. */ - void create_object(Main * /*bmain*/) override{}; + void create_object(Main * /*bmain*/) override {}; void create_object(Scene *scene, Main *bmain); }; diff --git a/source/blender/io/usd/intern/usd_reader_prim.hh b/source/blender/io/usd/intern/usd_reader_prim.hh index fb8950292bd..ea964baa3a9 100644 --- a/source/blender/io/usd/intern/usd_reader_prim.hh +++ b/source/blender/io/usd/intern/usd_reader_prim.hh @@ -94,7 +94,7 @@ class USDPrimReader { virtual bool valid() const; virtual void create_object(Main *bmain) = 0; - virtual void read_object_data(Main * /*bmain*/, pxr::UsdTimeCode /*time*/){}; + virtual void read_object_data(Main * /*bmain*/, pxr::UsdTimeCode /*time*/) {}; Object *object() const; void object(Object *ob); diff --git a/source/blender/io/usd/intern/usd_skel_convert.cc b/source/blender/io/usd/intern/usd_skel_convert.cc index c79d2115687..499a9e5bd3b 100644 --- a/source/blender/io/usd/intern/usd_skel_convert.cc +++ b/source/blender/io/usd/intern/usd_skel_convert.cc @@ -705,7 +705,7 @@ static void set_rest_pose(Main *bmain, xf = xf * bind_xf.GetInverse(); pxr::GfMatrix4f mat(xf); - BKE_pchan_apply_mat4(pchan, (float(*)[4])mat.data(), false); + BKE_pchan_apply_mat4(pchan, (float (*)[4])mat.data(), false); i++; } diff --git a/source/blender/makesrna/RNA_types.hh b/source/blender/makesrna/RNA_types.hh index 8b6bb5d04c0..d0460b57ac5 100644 --- a/source/blender/makesrna/RNA_types.hh +++ b/source/blender/makesrna/RNA_types.hh @@ -670,16 +670,10 @@ struct EnumPropertyItem { * By convention the value should be a non-empty string or NULL when there is no description * (never an empty string). */ -#define RNA_ENUM_ITEM_HEADING(name, description) \ - { \ - 0, "", 0, name, description \ - } +#define RNA_ENUM_ITEM_HEADING(name, description) {0, "", 0, name, description} /** Separator for RNA enum items (shown in the UI). */ -#define RNA_ENUM_ITEM_SEPR \ - { \ - 0, "", 0, NULL, NULL \ - } +#define RNA_ENUM_ITEM_SEPR {0, "", 0, NULL, NULL} /** Separator for RNA enum that begins a new column in menus (shown in the UI). */ #define RNA_ENUM_ITEM_SEPR_COLUMN RNA_ENUM_ITEM_HEADING("", NULL) @@ -833,7 +827,7 @@ using EnumPropertyGetTransformFunc = int (*)(PointerRNA *ptr, using EnumPropertySetTransformFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set); /* same as PropEnumItemFunc */ -using EnumPropertyItemFunc = const EnumPropertyItem *(*)(bContext *C, +using EnumPropertyItemFunc = const EnumPropertyItem *(*)(bContext * C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free); @@ -994,7 +988,7 @@ using StructCallbackFunc = int (*)(bContext *C, FunctionRNA *func, ParameterList *list); using StructFreeFunc = void (*)(void *data); -using StructRegisterFunc = StructRNA *(*)(Main *bmain, +using StructRegisterFunc = StructRNA *(*)(Main * bmain, ReportList *reports, void *data, const char *identifier, @@ -1003,7 +997,7 @@ using StructRegisterFunc = StructRNA *(*)(Main *bmain, StructFreeFunc free); /** Return true when `type` was successfully unregistered & freed. */ using StructUnregisterFunc = bool (*)(Main *bmain, StructRNA *type); -using StructInstanceFunc = void **(*)(PointerRNA *ptr); +using StructInstanceFunc = void **(*)(PointerRNA * ptr); struct StructRNA; diff --git a/source/blender/makesrna/intern/rna_armature.cc b/source/blender/makesrna/intern/rna_armature.cc index c8c4f5771c2..7c992ccc034 100644 --- a/source/blender/makesrna/intern/rna_armature.cc +++ b/source/blender/makesrna/intern/rna_armature.cc @@ -934,13 +934,13 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value, ReportLis static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values) { EditBone *ebone = (EditBone *)(ptr->data); - ED_armature_ebone_to_mat4(ebone, (float(*)[4])values); + ED_armature_ebone_to_mat4(ebone, (float (*)[4])values); } static void rna_EditBone_matrix_set(PointerRNA *ptr, const float *values) { EditBone *ebone = (EditBone *)(ptr->data); - ED_armature_ebone_from_mat4(ebone, (float(*)[4])values); + ED_armature_ebone_from_mat4(ebone, (float (*)[4])values); } static float rna_EditBone_length_get(PointerRNA *ptr) @@ -1127,7 +1127,7 @@ static bool rna_Armature_is_editmode_get(PointerRNA *ptr) static void rna_Armature_transform(bArmature *arm, const float mat[16]) { - ED_armature_transform(arm, (const float(*)[4])mat, true); + ED_armature_transform(arm, (const float (*)[4])mat, true); } static int rna_Armature_relation_line_position_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_armature_api.cc b/source/blender/makesrna/intern/rna_armature_api.cc index 62dddd5e2ef..abcce6eb8ed 100644 --- a/source/blender/makesrna/intern/rna_armature_api.cc +++ b/source/blender/makesrna/intern/rna_armature_api.cc @@ -58,9 +58,9 @@ static void rna_Bone_convert_local_to_pose(Bone *bone, { BoneParentTransform bpt; float offs_bone[4][4]; - float(*bone_arm_mat)[4] = (float(*)[4])matrix_local; - float(*parent_pose_mat)[4] = (float(*)[4])parent_matrix; - float(*parent_arm_mat)[4] = (float(*)[4])parent_matrix_local; + float (*bone_arm_mat)[4] = (float (*)[4])matrix_local; + float (*parent_pose_mat)[4] = (float (*)[4])parent_matrix; + float (*parent_arm_mat)[4] = (float (*)[4])parent_matrix_local; if (is_zero_m4(parent_pose_mat) || is_zero_m4(parent_arm_mat)) { /* No parent case. */ @@ -79,12 +79,12 @@ static void rna_Bone_convert_local_to_pose(Bone *bone, BKE_bone_parent_transform_invert(&bpt); } - BKE_bone_parent_transform_apply(&bpt, (float(*)[4])matrix, (float(*)[4])r_matrix); + BKE_bone_parent_transform_apply(&bpt, (float (*)[4])matrix, (float (*)[4])r_matrix); } static void rna_Bone_MatrixFromAxisRoll(const float axis[3], float roll, float r_matrix[9]) { - vec_roll_to_mat3(axis, roll, (float(*)[3])r_matrix); + vec_roll_to_mat3(axis, roll, (float (*)[3])r_matrix); } static void rna_Bone_AxisRollFromMatrix(const float matrix[9], @@ -94,7 +94,7 @@ static void rna_Bone_AxisRollFromMatrix(const float matrix[9], { float mat[3][3]; - normalize_m3_m3(mat, (float(*)[3])matrix); + normalize_m3_m3(mat, (float (*)[3])matrix); if (normalize_v3_v3(r_axis, axis_override) != 0.0f) { mat3_vec_to_roll(mat, r_axis, r_roll); diff --git a/source/blender/makesrna/intern/rna_curve_api.cc b/source/blender/makesrna/intern/rna_curve_api.cc index e1bccbf8273..da937c8cc6a 100644 --- a/source/blender/makesrna/intern/rna_curve_api.cc +++ b/source/blender/makesrna/intern/rna_curve_api.cc @@ -23,7 +23,7 @@ static void rna_Curve_transform(Curve *cu, const float mat[16], bool shape_keys) { - BKE_curve_transform(cu, (const float(*)[4])mat, shape_keys, true); + BKE_curve_transform(cu, (const float (*)[4])mat, shape_keys, true); DEG_id_tag_update(&cu->id, 0); } diff --git a/source/blender/makesrna/intern/rna_curves.cc b/source/blender/makesrna/intern/rna_curves.cc index 8665d08a7f3..c3ddd943f7b 100644 --- a/source/blender/makesrna/intern/rna_curves.cc +++ b/source/blender/makesrna/intern/rna_curves.cc @@ -125,19 +125,19 @@ static bool rna_Curves_curve_offset_data_lookup_int(PointerRNA *ptr, int index, static float (*get_curves_positions_for_write(Curves &curves))[3] { - return reinterpret_cast(curves.geometry.wrap().positions_for_write().data()); + return reinterpret_cast(curves.geometry.wrap().positions_for_write().data()); } static const float (*get_curves_positions(const Curves &curves))[3] { - return reinterpret_cast(curves.geometry.wrap().positions().data()); + return reinterpret_cast(curves.geometry.wrap().positions().data()); } static int rna_CurvePoint_index_get_const(const PointerRNA *ptr) { const Curves *curves = rna_curves(ptr); - const float(*co)[3] = static_cast(ptr->data); - const float(*positions)[3] = get_curves_positions(*curves); + const float (*co)[3] = static_cast(ptr->data); + const float (*positions)[3] = get_curves_positions(*curves); return int(co - positions); } @@ -289,15 +289,15 @@ static void rna_CurveSlice_points_begin(CollectionPropertyIterator *iter, Pointe Curves *curves = rna_curves(ptr); const int offset = rna_CurveSlice_first_point_index_get(ptr); const int size = rna_CurveSlice_points_length_get(ptr); - float(*positions)[3] = get_curves_positions_for_write(*curves); - float(*co)[3] = positions + offset; + float (*positions)[3] = get_curves_positions_for_write(*curves); + float (*co)[3] = positions + offset; rna_iterator_array_begin(iter, ptr, co, sizeof(float[3]), size, 0, nullptr); } static void rna_Curves_normals_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Curves *curves = rna_curves(ptr); - float(*positions)[3] = blender::ed::curves::point_normals_array_create(curves); + float (*positions)[3] = blender::ed::curves::point_normals_array_create(curves); const int size = curves->geometry.point_num; rna_iterator_array_begin(iter, ptr, positions, sizeof(float[3]), size, true, nullptr); } diff --git a/source/blender/makesrna/intern/rna_depsgraph.cc b/source/blender/makesrna/intern/rna_depsgraph.cc index c5edab325cd..3e2393d5c6b 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.cc +++ b/source/blender/makesrna/intern/rna_depsgraph.cc @@ -167,13 +167,13 @@ static void rna_DepsgraphObjectInstance_matrix_world_get(PointerRNA *ptr, float RNA_DepsgraphIterator *di = static_cast(ptr->data); DEGObjectIterData *deg_iter = (DEGObjectIterData *)di->iter.data; if (deg_iter->dupli_object_current != nullptr) { - copy_m4_m4((float(*)[4])mat, deg_iter->dupli_object_current->mat); + copy_m4_m4((float (*)[4])mat, deg_iter->dupli_object_current->mat); } else { /* We can return actual object's matrix here, no reason to return identity matrix * when this is not actually an instance... */ Object *ob = (Object *)di->iter.current; - copy_m4_m4((float(*)[4])mat, ob->object_to_world().ptr()); + copy_m4_m4((float (*)[4])mat, ob->object_to_world().ptr()); } } diff --git a/source/blender/makesrna/intern/rna_internal_types.hh b/source/blender/makesrna/intern/rna_internal_types.hh index c6e4096af18..e07f2da0ddc 100644 --- a/source/blender/makesrna/intern/rna_internal_types.hh +++ b/source/blender/makesrna/intern/rna_internal_types.hh @@ -53,8 +53,8 @@ using ContextUpdateFunc = void (*)(bContext *C, PointerRNA *ptr); using EditableFunc = int (*)(const PointerRNA *ptr, const char **r_info); using ItemEditableFunc = int (*)(const PointerRNA *ptr, int index); -using IDPropertiesFunc = IDProperty **(*)(PointerRNA *ptr); -using StructRefineFunc = StructRNA *(*)(PointerRNA *ptr); +using IDPropertiesFunc = IDProperty **(*)(PointerRNA * ptr); +using StructRefineFunc = StructRNA *(*)(PointerRNA * ptr); using StructPathFunc = std::optional (*)(const PointerRNA *ptr); using PropArrayLengthGetFunc = int (*)(const PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]); @@ -78,12 +78,12 @@ using PropStringLengthFunc = int (*)(PointerRNA *ptr); using PropStringSetFunc = void (*)(PointerRNA *ptr, const char *value); using PropEnumGetFunc = int (*)(PointerRNA *ptr); using PropEnumSetFunc = void (*)(PointerRNA *ptr, int value); -using PropEnumItemFunc = const EnumPropertyItem *(*)(bContext *C, +using PropEnumItemFunc = const EnumPropertyItem *(*)(bContext * C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free); using PropPointerGetFunc = PointerRNA (*)(PointerRNA *ptr); -using PropPointerTypeFunc = StructRNA *(*)(PointerRNA *ptr); +using PropPointerTypeFunc = StructRNA *(*)(PointerRNA * ptr); using PropPointerSetFunc = void (*)(PointerRNA *ptr, const PointerRNA value, ReportList *reports); using PropPointerPollFunc = bool (*)(PointerRNA *ptr, const PointerRNA value); using PropPointerPollFuncPy = bool (*)(PointerRNA *ptr, diff --git a/source/blender/makesrna/intern/rna_key.cc b/source/blender/makesrna/intern/rna_key.cc index c63224702da..9875eb39898 100644 --- a/source/blender/makesrna/intern/rna_key.cc +++ b/source/blender/makesrna/intern/rna_key.cc @@ -220,7 +220,7 @@ static void rna_KeyBlock_normals_vert_calc(ID *id, *normals = MEM_malloc_arrayN(size_t(*normals_num), __func__); - BKE_keyblock_mesh_calc_normals(data, mesh, (float(*)[3])(*normals), nullptr, nullptr); + BKE_keyblock_mesh_calc_normals(data, mesh, (float (*)[3])(*normals), nullptr, nullptr); } static int rna_KeyBlock_normals_poly_len(const PointerRNA *ptr, @@ -250,7 +250,7 @@ static void rna_KeyBlock_normals_poly_calc(ID *id, *normals = MEM_malloc_arrayN(size_t(*normals_num), __func__); - BKE_keyblock_mesh_calc_normals(data, mesh, nullptr, (float(*)[3])(*normals), nullptr); + BKE_keyblock_mesh_calc_normals(data, mesh, nullptr, (float (*)[3])(*normals), nullptr); } static int rna_KeyBlock_normals_loop_len(const PointerRNA *ptr, @@ -280,7 +280,7 @@ static void rna_KeyBlock_normals_loop_calc(ID *id, *normals = MEM_malloc_arrayN(size_t(*normals_num), __func__); - BKE_keyblock_mesh_calc_normals(data, mesh, nullptr, nullptr, (float(*)[3])(*normals)); + BKE_keyblock_mesh_calc_normals(data, mesh, nullptr, nullptr, (float (*)[3])(*normals)); } PointerRNA rna_object_shapekey_index_get(ID *id, int value) diff --git a/source/blender/makesrna/intern/rna_lattice_api.cc b/source/blender/makesrna/intern/rna_lattice_api.cc index d603b60ca38..692056fbcac 100644 --- a/source/blender/makesrna/intern/rna_lattice_api.cc +++ b/source/blender/makesrna/intern/rna_lattice_api.cc @@ -30,7 +30,7 @@ static const char *rna_Lattice_unit_test_compare(Lattice *lt, Lattice *lt2, floa static void rna_Lattice_transform(Lattice *lt, const float mat[16], bool shape_keys) { - BKE_lattice_transform(lt, (const float(*)[4])mat, shape_keys); + BKE_lattice_transform(lt, (const float (*)[4])mat, shape_keys); DEG_id_tag_update(<->id, 0); } diff --git a/source/blender/makesrna/intern/rna_linestyle.cc b/source/blender/makesrna/intern/rna_linestyle.cc index 97f3a43456e..77e5175f9df 100644 --- a/source/blender/makesrna/intern/rna_linestyle.cc +++ b/source/blender/makesrna/intern/rna_linestyle.cc @@ -1765,16 +1765,20 @@ static void rna_def_linestyle(BlenderRNA *brna) PropertyRNA *prop; static const EnumPropertyItem panel_items[] = { - {LS_PANEL_STROKES, "STROKES", 0, "Strokes", "Show the panel for stroke construction"}, - {LS_PANEL_COLOR, "COLOR", 0, "Color", "Show the panel for line color options"}, - {LS_PANEL_ALPHA, "ALPHA", 0, "Alpha", "Show the panel for alpha transparency options"}, - {LS_PANEL_THICKNESS, "THICKNESS", 0, "Thickness", "Show the panel for line thickness options"}, - {LS_PANEL_GEOMETRY, "GEOMETRY", 0, "Geometry", "Show the panel for stroke geometry options"}, - {LS_PANEL_TEXTURE, "TEXTURE", 0, "Texture", "Show the panel for stroke texture options"}, + {LS_PANEL_STROKES, "STROKES", 0, "Strokes", "Show the panel for stroke construction"}, + {LS_PANEL_COLOR, "COLOR", 0, "Color", "Show the panel for line color options"}, + {LS_PANEL_ALPHA, "ALPHA", 0, "Alpha", "Show the panel for alpha transparency options"}, + {LS_PANEL_THICKNESS, + "THICKNESS", + 0, + "Thickness", + "Show the panel for line thickness options"}, + {LS_PANEL_GEOMETRY, "GEOMETRY", 0, "Geometry", "Show the panel for stroke geometry options"}, + {LS_PANEL_TEXTURE, "TEXTURE", 0, "Texture", "Show the panel for stroke texture options"}, # if 0 /* hidden for now */ {LS_PANEL_MISC, "MISC", 0, "Misc", "Show the panel for miscellaneous options"}, # endif - {0, nullptr, 0, nullptr, nullptr}, + {0, nullptr, 0, nullptr, nullptr}, }; static const EnumPropertyItem chaining_items[] = { {LS_CHAINING_PLAIN, "PLAIN", 0, "Plain", "Plain chaining"}, diff --git a/source/blender/makesrna/intern/rna_meta_api.cc b/source/blender/makesrna/intern/rna_meta_api.cc index 18dfa4e80ad..f16688bef6c 100644 --- a/source/blender/makesrna/intern/rna_meta_api.cc +++ b/source/blender/makesrna/intern/rna_meta_api.cc @@ -22,7 +22,7 @@ static void rna_Meta_transform(MetaBall *mb, const float mat[16]) { - BKE_mball_transform(mb, (const float(*)[4])mat, true); + BKE_mball_transform(mb, (const float (*)[4])mat, true); DEG_id_tag_update(&mb->id, 0); } diff --git a/source/blender/makesrna/intern/rna_modifier.cc b/source/blender/makesrna/intern/rna_modifier.cc index 0c06828d294..e954ee28e52 100644 --- a/source/blender/makesrna/intern/rna_modifier.cc +++ b/source/blender/makesrna/intern/rna_modifier.cc @@ -6406,16 +6406,16 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) PropertyRNA *prop; static const EnumPropertyItem geometry_items[] = { - {MOD_OCEAN_GEOM_GENERATE, - "GENERATE", - 0, - "Generate", - "Generate ocean surface geometry at the specified resolution"}, - {MOD_OCEAN_GEOM_DISPLACE, - "DISPLACE", - 0, - "Displace", - "Displace existing geometry according to simulation"}, + {MOD_OCEAN_GEOM_GENERATE, + "GENERATE", + 0, + "Generate", + "Generate ocean surface geometry at the specified resolution"}, + {MOD_OCEAN_GEOM_DISPLACE, + "DISPLACE", + 0, + "Displace", + "Displace existing geometry according to simulation"}, # if 0 {MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", @@ -6423,7 +6423,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"}, # endif - {0, nullptr, 0, nullptr, nullptr}, + {0, nullptr, 0, nullptr, nullptr}, }; static const EnumPropertyItem spectrum_items[] = { diff --git a/source/blender/makesrna/intern/rna_object.cc b/source/blender/makesrna/intern/rna_object.cc index 248dfd12c87..55855edb9d3 100644 --- a/source/blender/makesrna/intern/rna_object.cc +++ b/source/blender/makesrna/intern/rna_object.cc @@ -160,14 +160,10 @@ static const EnumPropertyItem parent_type_items[] = { #define INSTANCE_ITEMS_SHARED \ {0, "NONE", 0, "None", ""}, \ {OB_DUPLIVERTS, "VERTS", 0, "Vertices", "Instantiate child objects on all vertices"}, \ - { \ - OB_DUPLIFACES, "FACES", 0, "Faces", "Instantiate child objects on all faces" \ - } + {OB_DUPLIFACES, "FACES", 0, "Faces", "Instantiate child objects on all faces"} #define INSTANCE_ITEM_COLLECTION \ - { \ - OB_DUPLICOLLECTION, "COLLECTION", 0, "Collection", "Enable collection instancing" \ - } + {OB_DUPLICOLLECTION, "COLLECTION", 0, "Collection", "Enable collection instancing"} static const EnumPropertyItem instance_items[] = { INSTANCE_ITEMS_SHARED, INSTANCE_ITEM_COLLECTION, @@ -212,18 +208,9 @@ const EnumPropertyItem rna_enum_lightprobes_type_items[] = { }; /* used for 2 enums */ -#define OBTYPE_CU_CURVE \ - { \ - OB_CURVES_LEGACY, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve", "" \ - } -#define OBTYPE_CU_SURF \ - { \ - OB_SURF, "SURFACE", ICON_OUTLINER_OB_SURFACE, "Surface", "" \ - } -#define OBTYPE_CU_FONT \ - { \ - OB_FONT, "FONT", ICON_OUTLINER_OB_FONT, "Text", "" \ - } +#define OBTYPE_CU_CURVE {OB_CURVES_LEGACY, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve", ""} +#define OBTYPE_CU_SURF {OB_SURF, "SURFACE", ICON_OUTLINER_OB_SURFACE, "Surface", ""} +#define OBTYPE_CU_FONT {OB_FONT, "FONT", ICON_OUTLINER_OB_FONT, "Text", ""} const EnumPropertyItem rna_enum_object_type_items[] = { {OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, "Mesh", ""}, @@ -400,7 +387,7 @@ static void rna_Object_matrix_world_set(PointerRNA *ptr, const float *values) static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) { Object *ob = reinterpret_cast(ptr->owner_id); - BKE_object_matrix_local_get(ob, (float(*)[4])values); + BKE_object_matrix_local_get(ob, (float (*)[4])values); } static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) @@ -414,10 +401,10 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) if (ob->parent) { float invmat[4][4]; invert_m4_m4(invmat, ob->parentinv); - mul_m4_m4m4(local_mat, invmat, (float(*)[4])values); + mul_m4_m4m4(local_mat, invmat, (float (*)[4])values); } else { - copy_m4_m4(local_mat, (float(*)[4])values); + copy_m4_m4(local_mat, (float (*)[4])values); } /* Don't use compatible so we get predictable rotation, and do not use parenting either, @@ -428,13 +415,13 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) static void rna_Object_matrix_basis_get(PointerRNA *ptr, float values[16]) { Object *ob = reinterpret_cast(ptr->owner_id); - BKE_object_to_mat4(ob, (float(*)[4])values); + BKE_object_to_mat4(ob, (float (*)[4])values); } static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16]) { Object *ob = reinterpret_cast(ptr->owner_id); - BKE_object_apply_mat4(ob, (float(*)[4])values, false, false); + BKE_object_apply_mat4(ob, (float (*)[4])values, false, false); } void rna_Object_internal_update_data_impl(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_object_api.cc b/source/blender/makesrna/intern/rna_object_api.cc index 2e40bd1d977..feccc8397e1 100644 --- a/source/blender/makesrna/intern/rna_object_api.cc +++ b/source/blender/makesrna/intern/rna_object_api.cc @@ -285,7 +285,7 @@ static void rna_Object_mat_convert_space(Object *ob, int from, int to) { - copy_m4_m4((float(*)[4])mat_ret, (float(*)[4])mat); + copy_m4_m4((float (*)[4])mat_ret, (float (*)[4])mat); BLI_assert(!ELEM(from, CONSTRAINT_SPACE_OWNLOCAL)); BLI_assert(!ELEM(to, CONSTRAINT_SPACE_OWNLOCAL)); @@ -331,7 +331,7 @@ static void rna_Object_mat_convert_space(Object *ob, return; } - BKE_constraint_mat_convertspace(ob, pchan, nullptr, (float(*)[4])mat_ret, from, to, false); + BKE_constraint_mat_convertspace(ob, pchan, nullptr, (float (*)[4])mat_ret, from, to, false); } static void rna_Object_calc_matrix_camera(Object *ob, @@ -353,7 +353,7 @@ static void rna_Object_calc_matrix_camera(Object *ob, BKE_camera_params_compute_viewplane(¶ms, width, height, scalex, scaley); BKE_camera_params_compute_matrix(¶ms); - copy_m4_m4((float(*)[4])mat_ret, params.winmat); + copy_m4_m4((float (*)[4])mat_ret, params.winmat); } static void rna_Object_camera_fit_coords(Object *ob, @@ -364,7 +364,7 @@ static void rna_Object_camera_fit_coords(Object *ob, float *scale_ret) { BKE_camera_view_frame_fit_to_coords( - depsgraph, (const float(*)[3])cos, cos_num / 3, ob, co_ret, scale_ret); + depsgraph, (const float (*)[3])cos, cos_num / 3, ob, co_ret, scale_ret); } static void rna_Object_crazyspace_eval(Object *object, diff --git a/source/blender/makesrna/intern/rna_particle.cc b/source/blender/makesrna/intern/rna_particle.cc index dd1df47baa4..2f938c496fa 100644 --- a/source/blender/makesrna/intern/rna_particle.cc +++ b/source/blender/makesrna/intern/rna_particle.cc @@ -680,7 +680,7 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, } { - float(*fuv)[4]; + float (*fuv)[4]; /* Note all sanity checks are done in this helper func. */ const int num = rna_ParticleSystem_tessfaceidx_on_emitter( particlesystem, modifier, particle, particle_no, &fuv); @@ -716,7 +716,7 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, } { - float(*fuv)[4]; + float (*fuv)[4]; /* Note all sanity checks are done in this helper func. */ const int num = rna_ParticleSystem_tessfaceidx_on_emitter( particlesystem, modifier, particle, particle_no, &fuv); diff --git a/source/blender/makesrna/intern/rna_pose.cc b/source/blender/makesrna/intern/rna_pose.cc index 26d4eb4f037..d1bdbf56d48 100644 --- a/source/blender/makesrna/intern/rna_pose.cc +++ b/source/blender/makesrna/intern/rna_pose.cc @@ -606,14 +606,14 @@ static bool rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, Pointe static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; - BKE_pchan_to_mat4(pchan, (float(*)[4])values); + BKE_pchan_to_mat4(pchan, (float (*)[4])values); } static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *values) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; /* No compatibility for predictable result. */ - BKE_pchan_apply_mat4(pchan, (const float(*)[4])values, false); + BKE_pchan_apply_mat4(pchan, (const float (*)[4])values, false); } static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values) @@ -622,7 +622,7 @@ static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values) Object *ob = (Object *)ptr->owner_id; float tmat[4][4]; - BKE_armature_mat_pose_to_bone_ex(nullptr, ob, pchan, (const float(*)[4])values, tmat); + BKE_armature_mat_pose_to_bone_ex(nullptr, ob, pchan, (const float (*)[4])values, tmat); /* No compatibility for predictable result. */ BKE_pchan_apply_mat4(pchan, tmat, false); diff --git a/source/blender/makesrna/intern/rna_pose_api.cc b/source/blender/makesrna/intern/rna_pose_api.cc index 15ba1281322..a7ea60b09f5 100644 --- a/source/blender/makesrna/intern/rna_pose_api.cc +++ b/source/blender/makesrna/intern/rna_pose_api.cc @@ -87,10 +87,10 @@ static void rna_PoseBone_bbone_segment_matrix( } if (rest) { - copy_m4_m4((float(*)[4])mat_ret, pchan->runtime.bbone_rest_mats[index].mat); + copy_m4_m4((float (*)[4])mat_ret, pchan->runtime.bbone_rest_mats[index].mat); } else { - copy_m4_m4((float(*)[4])mat_ret, pchan->runtime.bbone_pose_mats[index].mat); + copy_m4_m4((float (*)[4])mat_ret, pchan->runtime.bbone_pose_mats[index].mat); } } diff --git a/source/blender/makesrna/intern/rna_scene.cc b/source/blender/makesrna/intern/rna_scene.cc index a8e93567e68..58cda8bb30b 100644 --- a/source/blender/makesrna/intern/rna_scene.cc +++ b/source/blender/makesrna/intern/rna_scene.cc @@ -255,18 +255,10 @@ const EnumPropertyItem rna_enum_curve_fit_method_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -#define MEDIA_TYPE_ENUM_IMAGE \ - { \ - MEDIA_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", "" \ - } +#define MEDIA_TYPE_ENUM_IMAGE {MEDIA_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", ""} #define MEDIA_TYPE_ENUM_MULTI_LAYER_IMAGE \ - { \ - MEDIA_TYPE_MULTI_LAYER_IMAGE, "MULTI_LAYER_IMAGE", ICON_NONE, "Multi-Layer EXR", "" \ - } -#define MEDIA_TYPE_ENUM_VIDEO \ - { \ - MEDIA_TYPE_VIDEO, "VIDEO", ICON_NONE, "Video", "" \ - } + {MEDIA_TYPE_MULTI_LAYER_IMAGE, "MULTI_LAYER_IMAGE", ICON_NONE, "Multi-Layer EXR", ""} +#define MEDIA_TYPE_ENUM_VIDEO {MEDIA_TYPE_VIDEO, "VIDEO", ICON_NONE, "Video", ""} static const EnumPropertyItem rna_enum_media_type_all_items[] = { MEDIA_TYPE_ENUM_IMAGE, @@ -2391,14 +2383,14 @@ static void rna_View3DCursor_rotation_axis_angle_set(PointerRNA *ptr, const floa static void rna_View3DCursor_matrix_get(PointerRNA *ptr, float *values) { const View3DCursor *cursor = static_cast(ptr->data); - copy_m4_m4((float(*)[4])values, cursor->matrix().ptr()); + copy_m4_m4((float (*)[4])values, cursor->matrix().ptr()); } static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values) { View3DCursor *cursor = static_cast(ptr->data); float unit_mat[4][4]; - normalize_m4_m4(unit_mat, (const float(*)[4])values); + normalize_m4_m4(unit_mat, (const float (*)[4])values); cursor->set_matrix(blender::float4x4(unit_mat), false); } diff --git a/source/blender/makesrna/intern/rna_scene_api.cc b/source/blender/makesrna/intern/rna_scene_api.cc index 2ada7e6e933..077bdb630b3 100644 --- a/source/blender/makesrna/intern/rna_scene_api.cc +++ b/source/blender/makesrna/intern/rna_scene_api.cc @@ -169,7 +169,7 @@ static void rna_Scene_ray_cast(Scene *scene, r_normal, r_index, (const Object **)(r_ob), - (float(*)[4])r_obmat); + (float (*)[4])r_obmat); blender::ed::transform::snap_object_context_destroy(sctx); @@ -183,7 +183,7 @@ static void rna_Scene_ray_cast(Scene *scene, else { *r_success = false; - unit_m4((float(*)[4])r_obmat); + unit_m4((float (*)[4])r_obmat); zero_v3(r_location); zero_v3(r_normal); } diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index 4d49da7d4f1..dde0f2ef719 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -209,33 +209,33 @@ const EnumPropertyItem rna_enum_space_file_browse_mode_items[] = { }; #define SACT_ITEM_DOPESHEET \ - { \ - SACTCONT_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dope Sheet", "Edit all keyframes in scene" \ - } + {SACTCONT_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dope Sheet", "Edit all keyframes in scene"} #define SACT_ITEM_ACTION \ - { \ - SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", \ - "Edit keyframes in active object's Object-level action" \ - } + {SACTCONT_ACTION, \ + "ACTION", \ + ICON_OBJECT_DATA, \ + "Action Editor", \ + "Edit keyframes in active object's Object-level action"} #define SACT_ITEM_SHAPEKEY \ - { \ - SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "Shape Key Editor", \ - "Edit keyframes in active object's Shape Keys action" \ - } + {SACTCONT_SHAPEKEY, \ + "SHAPEKEY", \ + ICON_SHAPEKEY_DATA, \ + "Shape Key Editor", \ + "Edit keyframes in active object's Shape Keys action"} #define SACT_ITEM_GPENCIL \ - { \ - SACTCONT_GPENCIL, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", \ - "Edit timings for all Grease Pencil sketches in file" \ - } + {SACTCONT_GPENCIL, \ + "GPENCIL", \ + ICON_OUTLINER_OB_GREASEPENCIL, \ + "Grease Pencil", \ + "Edit timings for all Grease Pencil sketches in file"} #define SACT_ITEM_MASK \ - { \ - SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines" \ - } + {SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines"} #define SACT_ITEM_CACHEFILE \ - { \ - SACTCONT_CACHEFILE, "CACHEFILE", ICON_FILE, "Cache File", \ - "Edit timings for Cache File data-blocks" \ - } + {SACTCONT_CACHEFILE, \ + "CACHEFILE", \ + ICON_FILE, \ + "Cache File", \ + "Edit timings for Cache File data-blocks"} #ifndef RNA_RUNTIME /* XXX: action-editor is currently for object-level only actions, @@ -268,21 +268,10 @@ static EnumPropertyItem rna_enum_space_action_ui_mode_items[] = { #undef SACT_ITEM_CACHEFILE #define SI_ITEM_VIEW(identifier, name, icon) \ - { \ - SI_MODE_VIEW, identifier, icon, name, "Inspect images or render results" \ - } -#define SI_ITEM_UV \ - { \ - SI_MODE_UV, "UV", ICON_UV, "UV Editor", "View and edit UVs" \ - } -#define SI_ITEM_PAINT \ - { \ - SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "Paint images in 2D" \ - } -#define SI_ITEM_MASK \ - { \ - SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "View and edit masks" \ - } + {SI_MODE_VIEW, identifier, icon, name, "Inspect images or render results"} +#define SI_ITEM_UV {SI_MODE_UV, "UV", ICON_UV, "UV Editor", "View and edit UVs"} +#define SI_ITEM_PAINT {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "Paint images in 2D"} +#define SI_ITEM_MASK {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "View and edit masks"} const EnumPropertyItem rna_enum_space_image_mode_all_items[] = { SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE), @@ -1273,7 +1262,7 @@ static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *value { RegionView3D *rv3d = (RegionView3D *)(ptr->data); float mat[4][4]; - invert_m4_m4(mat, (float(*)[4])values); + invert_m4_m4(mat, (float (*)[4])values); ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist); rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d); } diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index 21fe29efd8f..4d7058be6f8 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -5892,14 +5892,18 @@ static void rna_def_userdef_system(BlenderRNA *brna) {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"}, {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"}, # endif - {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"}, - {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"}, + {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"}, + {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"}, # if 0 {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"}, # endif - {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"}, - {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"}, - {0, nullptr, 0, nullptr, nullptr}, + {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"}, + {192000, + "RATE_192000", + 0, + "192 kHz", + "Set audio sampling rate to 192000 samples per second"}, + {0, nullptr, 0, nullptr, nullptr}, }; static const EnumPropertyItem audio_format_items[] = { diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.cc b/source/blender/makesrna/intern/rna_wm_gizmo.cc index 5b513e29264..9d01d4d3d43 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.cc +++ b/source/blender/makesrna/intern/rna_wm_gizmo.cc @@ -362,7 +362,7 @@ RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_offset, matrix_offset, 16); static void rna_Gizmo_matrix_world_get(PointerRNA *ptr, float value[16]) { wmGizmo *gz = static_cast(ptr->data); - WM_gizmo_calc_matrix_final(gz, (float(*)[4])value); + WM_gizmo_calc_matrix_final(gz, (float (*)[4])value); } RNA_GIZMO_GENERIC_FLOAT_RW_DEF(scale_basis, scale_basis); diff --git a/source/blender/makesrna/intern/rna_wm_gizmo_api.cc b/source/blender/makesrna/intern/rna_wm_gizmo_api.cc index 5c1281fcf1c..e67f31c26ce 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo_api.cc +++ b/source/blender/makesrna/intern/rna_wm_gizmo_api.cc @@ -29,7 +29,7 @@ static void rna_gizmo_draw_preset_box(wmGizmo *gz, const float matrix[16], int select_id) { - ED_gizmo_draw_preset_box(gz, (const float(*)[4])matrix, select_id); + ED_gizmo_draw_preset_box(gz, (const float (*)[4])matrix, select_id); } static void rna_gizmo_draw_preset_arrow(wmGizmo *gz, @@ -37,7 +37,7 @@ static void rna_gizmo_draw_preset_arrow(wmGizmo *gz, int axis, int select_id) { - ED_gizmo_draw_preset_arrow(gz, (const float(*)[4])matrix, axis, select_id); + ED_gizmo_draw_preset_arrow(gz, (const float (*)[4])matrix, axis, select_id); } static void rna_gizmo_draw_preset_circle(wmGizmo *gz, @@ -45,7 +45,7 @@ static void rna_gizmo_draw_preset_circle(wmGizmo *gz, int axis, int select_id) { - ED_gizmo_draw_preset_circle(gz, (const float(*)[4])matrix, axis, select_id); + ED_gizmo_draw_preset_circle(gz, (const float (*)[4])matrix, axis, select_id); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/modifiers/intern/MOD_armature.cc b/source/blender/modifiers/intern/MOD_armature.cc index a9f3204f083..d02bd62c7f5 100644 --- a/source/blender/modifiers/intern/MOD_armature.cc +++ b/source/blender/modifiers/intern/MOD_armature.cc @@ -127,7 +127,7 @@ static void deform_verts(ModifierData *md, } /* if next modifier needs original vertices */ - MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); + MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); BKE_armature_deform_coords_with_mesh(*amd->object, *ctx->object, @@ -161,7 +161,7 @@ static void deform_verts_EM(ModifierData *md, } /* if next modifier needs original vertices */ - MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); + MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); BKE_armature_deform_coords_with_editmesh(*amd->object, *ctx->object, diff --git a/source/blender/modifiers/intern/MOD_cloth.cc b/source/blender/modifiers/intern/MOD_cloth.cc index 74b18fc1bfe..94f9990e7de 100644 --- a/source/blender/modifiers/intern/MOD_cloth.cc +++ b/source/blender/modifiers/intern/MOD_cloth.cc @@ -97,10 +97,10 @@ static void deform_verts(ModifierData *md, KeyBlock *kb = BKE_keyblock_find_by_index(BKE_key_from_object(ctx->object), clmd->sim_parms->shapekey_rest); if (kb && kb->data != nullptr) { - float(*layerorco)[3] = static_cast( + float (*layerorco)[3] = static_cast( CustomData_get_layer_for_write(&mesh->vert_data, CD_CLOTH_ORCO, mesh->verts_num)); if (!layerorco) { - layerorco = static_cast(CustomData_add_layer( + layerorco = static_cast(CustomData_add_layer( &mesh->vert_data, CD_CLOTH_ORCO, CD_SET_DEFAULT, mesh->verts_num)); } @@ -116,7 +116,7 @@ static void deform_verts(ModifierData *md, scene, ctx->object, mesh, - reinterpret_cast(positions.data())); + reinterpret_cast(positions.data())); } static void update_depsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) diff --git a/source/blender/modifiers/intern/MOD_collision.cc b/source/blender/modifiers/intern/MOD_collision.cc index 1bdc547444f..e4bae385039 100644 --- a/source/blender/modifiers/intern/MOD_collision.cc +++ b/source/blender/modifiers/intern/MOD_collision.cc @@ -133,17 +133,18 @@ static void deform_verts(ModifierData *md, mul_m4_v3(ob->object_to_world().ptr(), collmd->x[i]); } - collmd->xnew = static_cast(MEM_dupallocN(collmd->x)); /* Frame end position. */ - collmd->current_x = static_cast(MEM_dupallocN(collmd->x)); /* Inter-frame. */ - collmd->current_xnew = static_cast(MEM_dupallocN(collmd->x)); /* Inter-frame. */ - collmd->current_v = static_cast(MEM_dupallocN(collmd->x)); /* Inter-frame. */ + collmd->xnew = static_cast(MEM_dupallocN(collmd->x)); /* Frame end position. */ + collmd->current_x = static_cast(MEM_dupallocN(collmd->x)); /* Inter-frame. */ + collmd->current_xnew = static_cast( + MEM_dupallocN(collmd->x)); /* Inter-frame. */ + collmd->current_v = static_cast(MEM_dupallocN(collmd->x)); /* Inter-frame. */ collmd->mvert_num = mvert_num; { const blender::Span corner_tris = mesh->corner_tris(); collmd->tri_num = corner_tris.size(); - int(*vert_tris)[3] = MEM_malloc_arrayN(collmd->tri_num, __func__); + int (*vert_tris)[3] = MEM_malloc_arrayN(collmd->tri_num, __func__); blender::bke::mesh::vert_tris_from_corner_tris( mesh->corner_verts(), corner_tris, @@ -163,7 +164,7 @@ static void deform_verts(ModifierData *md, } else if (mvert_num == collmd->mvert_num) { /* put positions to old positions */ - float(*temp)[3] = collmd->x; + float (*temp)[3] = collmd->x; collmd->x = collmd->xnew; collmd->xnew = temp; collmd->time_x = collmd->time_xnew; diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.cc b/source/blender/modifiers/intern/MOD_correctivesmooth.cc index dd7bf16b974..bfda2f6f8ec 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.cc +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.cc @@ -447,7 +447,7 @@ static void calc_tangent_spaces(const Mesh *mesh, for (; next_corner != term_corner; prev_corner = curr_corner, curr_corner = next_corner, next_corner++) { - float(*ts)[3] = r_tangent_spaces[curr_corner]; + float (*ts)[3] = r_tangent_spaces[curr_corner]; /* re-use the previous value */ #if 0 @@ -511,8 +511,8 @@ static void calc_deltas(CorrectiveSmoothModifierData *csmd, uint l_index; - float(*tangent_spaces)[3][3] = MEM_malloc_arrayN(size_t(corner_verts.size()), - __func__); + float (*tangent_spaces)[3][3] = MEM_malloc_arrayN(size_t(corner_verts.size()), + __func__); if (csmd->delta_cache.deltas_num != uint(corner_verts.size())) { MEM_SAFE_FREE(csmd->delta_cache.deltas); @@ -693,8 +693,8 @@ static void correctivesmooth_modifier_do(ModifierData *md, const float scale = csmd->scale; - float(*tangent_spaces)[3][3] = MEM_malloc_arrayN(size_t(corner_verts.size()), - __func__); + float (*tangent_spaces)[3][3] = MEM_malloc_arrayN(size_t(corner_verts.size()), + __func__); float *tangent_weights = MEM_malloc_arrayN(size_t(corner_verts.size()), __func__); float *tangent_weights_per_vertex = MEM_malloc_arrayN(size_t(vertexCos.size()), __func__); diff --git a/source/blender/modifiers/intern/MOD_curve.cc b/source/blender/modifiers/intern/MOD_curve.cc index 6fe9e8882e9..c2794c502ae 100644 --- a/source/blender/modifiers/intern/MOD_curve.cc +++ b/source/blender/modifiers/intern/MOD_curve.cc @@ -107,7 +107,7 @@ static void deform_verts(ModifierData *md, const int defaxis = std::clamp(cmd->defaxis - 1, 0, 5); BKE_curve_deform_coords(cmd->object, ctx->object, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), dvert, defgrp_index, @@ -141,7 +141,7 @@ static void deform_verts_EM(ModifierData *md, if (use_dverts) { BKE_curve_deform_coords_with_editmesh(cmd->object, ctx->object, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), defgrp_index, cmd->flag, @@ -151,7 +151,7 @@ static void deform_verts_EM(ModifierData *md, else { BKE_curve_deform_coords(cmd->object, ctx->object, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), nullptr, defgrp_index, diff --git a/source/blender/modifiers/intern/MOD_displace.cc b/source/blender/modifiers/intern/MOD_displace.cc index 0a235ea2158..9e3065af3ae 100644 --- a/source/blender/modifiers/intern/MOD_displace.cc +++ b/source/blender/modifiers/intern/MOD_displace.cc @@ -160,7 +160,7 @@ static void displaceModifier_do_task(void *__restrict userdata, int defgrp_index = data->defgrp_index; int direction = data->direction; bool use_global_direction = data->use_global_direction; - float(*tex_co)[3] = data->tex_co; + float (*tex_co)[3] = data->tex_co; blender::MutableSpan positions = data->positions; /* When no texture is used, we fall back to white. */ @@ -251,7 +251,7 @@ static void displaceModifier_do(DisplaceModifierData *dmd, const MDeformVert *dvert; int direction = dmd->direction; int defgrp_index; - float(*tex_co)[3]; + float (*tex_co)[3]; float weight = 1.0f; /* init value unused but some compilers may complain */ const bool use_global_direction = dmd->space == MOD_DISP_SPACE_GLOBAL; @@ -276,7 +276,7 @@ static void displaceModifier_do(DisplaceModifierData *dmd, ctx, ob, mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), tex_co); MOD_init_texture((MappingInfoModifierData *)dmd, ctx); diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.cc b/source/blender/modifiers/intern/MOD_laplaciandeform.cc index 9e790147bc4..f85f5fe9fc0 100644 --- a/source/blender/modifiers/intern/MOD_laplaciandeform.cc +++ b/source/blender/modifiers/intern/MOD_laplaciandeform.cc @@ -638,7 +638,7 @@ static int isSystemDifferent(LaplacianDeformModifierData *lmd, static void LaplacianDeformModifier_do( LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, float (*vertexCos)[3], int verts_num) { - float(*filevertexCos)[3]; + float (*filevertexCos)[3]; int sysdif; LaplacianSystem *sys = nullptr; filevertexCos = nullptr; @@ -768,7 +768,7 @@ static void deform_verts(ModifierData *md, LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.cc b/source/blender/modifiers/intern/MOD_laplaciansmooth.cc index b0e74bcc590..63f5b40cd1b 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.cc +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.cc @@ -511,7 +511,7 @@ static void deform_verts(ModifierData *md, laplaciansmoothModifier_do((LaplacianSmoothModifierData *)md, ctx->object, mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_lattice.cc b/source/blender/modifiers/intern/MOD_lattice.cc index ad5ad033265..562c584edc1 100644 --- a/source/blender/modifiers/intern/MOD_lattice.cc +++ b/source/blender/modifiers/intern/MOD_lattice.cc @@ -92,11 +92,11 @@ static void deform_verts(ModifierData *md, LatticeModifierData *lmd = (LatticeModifierData *)md; /* if next modifier needs original vertices */ - MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); + MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); BKE_lattice_deform_coords_with_mesh(lmd->object, ctx->object, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), lmd->flag, lmd->name, @@ -118,11 +118,11 @@ static void deform_verts_EM(ModifierData *md, LatticeModifierData *lmd = (LatticeModifierData *)md; /* if next modifier needs original vertices */ - MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); + MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); BKE_lattice_deform_coords_with_editmesh(lmd->object, ctx->object, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), lmd->flag, lmd->name, diff --git a/source/blender/modifiers/intern/MOD_meshcache.cc b/source/blender/modifiers/intern/MOD_meshcache.cc index b4c05c28294..74d48128f42 100644 --- a/source/blender/modifiers/intern/MOD_meshcache.cc +++ b/source/blender/modifiers/intern/MOD_meshcache.cc @@ -79,11 +79,11 @@ static void meshcache_do(MeshCacheModifierData *mcmd, const MDeformVert *dvert; MOD_get_vgroup(ob, mesh, mcmd->defgrp_name, &dvert, &influence_group_index); - float(*vertexCos_Store)[3] = (use_factor || influence_group_index != -1 || - (mcmd->deform_mode == MOD_MESHCACHE_DEFORM_INTEGRATE)) ? - MEM_malloc_arrayN(size_t(verts_num), __func__) : - nullptr; - float(*vertexCos)[3] = vertexCos_Store ? vertexCos_Store : vertexCos_Real; + float (*vertexCos_Store)[3] = (use_factor || influence_group_index != -1 || + (mcmd->deform_mode == MOD_MESHCACHE_DEFORM_INTEGRATE)) ? + MEM_malloc_arrayN(size_t(verts_num), __func__) : + nullptr; + float (*vertexCos)[3] = vertexCos_Store ? vertexCos_Store : vertexCos_Real; const float fps = scene->frames_per_second(); @@ -172,7 +172,7 @@ static void meshcache_do(MeshCacheModifierData *mcmd, BKE_modifier_set_error(ob, &mcmd->modifier, "'Integrate' requires faces"); } else { - float(*vertexCos_New)[3] = MEM_malloc_arrayN(size_t(verts_num), __func__); + float (*vertexCos_New)[3] = MEM_malloc_arrayN(size_t(verts_num), __func__); BKE_mesh_calc_relative_deform( mesh->face_offsets().data(), @@ -180,11 +180,11 @@ static void meshcache_do(MeshCacheModifierData *mcmd, mesh->corner_verts().data(), mesh->verts_num, /* From the original Mesh. */ - reinterpret_cast(mesh->vert_positions().data()), + reinterpret_cast(mesh->vert_positions().data()), /* the input we've been given (shape keys!) */ - const_cast(vertexCos_Real), + const_cast(vertexCos_Real), /* The result of this modifier. */ - const_cast(vertexCos), + const_cast(vertexCos), /* The result of this function. */ vertexCos_New); @@ -282,7 +282,7 @@ static void deform_verts(ModifierData *md, scene, ctx->object, mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_meshdeform.cc b/source/blender/modifiers/intern/MOD_meshdeform.cc index 5cb35fa3ada..be94ee93a06 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.cc +++ b/source/blender/modifiers/intern/MOD_meshdeform.cc @@ -254,8 +254,8 @@ static void meshdeform_vert_task(void *__restrict userdata, const int defgrp_index = data->defgrp_index; const int *offsets = mmd->bindoffsets; const MDefInfluence *__restrict influences = mmd->bindinfluences; - /*const*/ float(*__restrict dco)[3] = data->dco; - float(*vertexCos)[3] = data->vertexCos; + /*const*/ float (*__restrict dco)[3] = data->dco; + float (*vertexCos)[3] = data->vertexCos; float co[3]; float weight, totweight, fac = 1.0f; @@ -314,7 +314,7 @@ static void meshdeformModifier_do(ModifierData *md, Mesh *cagemesh; const MDeformVert *dvert = nullptr; float imat[4][4], cagemat[4][4], iobmat[4][4], icagemat[3][3], cmat[4][4]; - const float(*bindcagecos)[3]; + const float (*bindcagecos)[3]; int a, cage_verts_num, defgrp_index; MeshdeformUserdata data; @@ -389,7 +389,7 @@ static void meshdeformModifier_do(ModifierData *md, /* setup deformation data */ BKE_mesh_wrapper_vert_coords_copy(cagemesh, dco.as_mutable_span().take_front(cage_verts_num)); - bindcagecos = (const float(*)[3])mmd->bindcagecos; + bindcagecos = (const float (*)[3])mmd->bindcagecos; for (a = 0; a < cage_verts_num; a++) { /* Get cage vertex in world-space with binding transform. */ @@ -404,7 +404,7 @@ static void meshdeformModifier_do(ModifierData *md, /* Initialize data to be pass to the for body function. */ data.mmd = mmd; data.dvert = dvert; - data.dco = reinterpret_cast(dco.data()); + data.dco = reinterpret_cast(dco.data()); data.defgrp_index = defgrp_index; data.vertexCos = vertexCos; data.cagemat = cagemat; @@ -423,9 +423,9 @@ static void deform_verts(ModifierData *md, blender::MutableSpan positions) { /* if next modifier needs original vertices */ - MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); + MOD_previous_vcos_store(md, reinterpret_cast(positions.data())); meshdeformModifier_do( - md, ctx, mesh, reinterpret_cast(positions.data()), positions.size()); + md, ctx, mesh, reinterpret_cast(positions.data()), positions.size()); } #define MESHDEFORM_MIN_INFLUENCE 0.00001f diff --git a/source/blender/modifiers/intern/MOD_normal_edit.cc b/source/blender/modifiers/intern/MOD_normal_edit.cc index c81acd1c25a..cb52dea9c89 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.cc +++ b/source/blender/modifiers/intern/MOD_normal_edit.cc @@ -226,7 +226,7 @@ static void normalEditModifier_do_radial(NormalEditModifierData *enmd, const bool do_facenors_fix = (enmd->flag & MOD_NORMALEDIT_NO_POLYNORS_FIX) == 0; - float(*cos)[3] = MEM_malloc_arrayN(size_t(vert_positions.size()), __func__); + float (*cos)[3] = MEM_malloc_arrayN(size_t(vert_positions.size()), __func__); blender::Array nos(corner_verts.size()); float3 size; @@ -375,7 +375,7 @@ static void normalEditModifier_do_directional(NormalEditModifierData *enmd, } } else { - float(*cos)[3] = MEM_malloc_arrayN(size_t(positions.size()), __func__); + float (*cos)[3] = MEM_malloc_arrayN(size_t(positions.size()), __func__); generate_vert_coordinates(mesh, ob, ob_target, nullptr, positions.size(), cos, nullptr); BLI_bitmap *done_verts = BLI_BITMAP_NEW(size_t(positions.size()), __func__); diff --git a/source/blender/modifiers/intern/MOD_ocean.cc b/source/blender/modifiers/intern/MOD_ocean.cc index e8754386ec5..8bf1cc8c536 100644 --- a/source/blender/modifiers/intern/MOD_ocean.cc +++ b/source/blender/modifiers/intern/MOD_ocean.cc @@ -196,7 +196,7 @@ static void generate_ocean_geometry_uvs(void *__restrict userdata, for (x = 0; x < gogd->res_x; x++) { const int i = y * gogd->res_x + x; - float(*luv)[2] = &gogd->uv_map[i * 4]; + float (*luv)[2] = &gogd->uv_map[i * 4]; (*luv)[0] = x * gogd->ix; (*luv)[1] = y * gogd->iy; @@ -264,7 +264,7 @@ static Mesh *generate_ocean_geometry(OceanModifierData *omd, Mesh *mesh_orig, co /* add uvs */ if (CustomData_number_of_layers(&result->corner_data, CD_PROP_FLOAT2) < MAX_MTFACE) { - gogd.uv_map = static_cast(CustomData_add_layer_named( + gogd.uv_map = static_cast(CustomData_add_layer_named( &result->corner_data, CD_PROP_FLOAT2, CD_SET_DEFAULT, faces_num * 4, "UVMap")); if (gogd.uv_map) { /* unlikely to fail */ diff --git a/source/blender/modifiers/intern/MOD_screw.cc b/source/blender/modifiers/intern/MOD_screw.cc index 7130ad7e164..8e6f1137b3d 100644 --- a/source/blender/modifiers/intern/MOD_screw.cc +++ b/source/blender/modifiers/intern/MOD_screw.cc @@ -81,7 +81,7 @@ struct ScrewVertIter { }; #define SV_UNUSED (UINT_MAX) -#define SV_INVALID ((UINT_MAX)-1) +#define SV_INVALID ((UINT_MAX) - 1) #define SV_IS_VALID(v) ((v) < SV_INVALID) static void screwvert_iter_init(ScrewVertIter *iter, diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.cc b/source/blender/modifiers/intern/MOD_shrinkwrap.cc index 3ba0d63a256..4a716bb80c7 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.cc +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.cc @@ -95,7 +95,7 @@ static void deform_verts(ModifierData *md, mesh, dvert, defgrp_index, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_simpledeform.cc b/source/blender/modifiers/intern/MOD_simpledeform.cc index 58bd1d1deaa..066efdd211a 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.cc +++ b/source/blender/modifiers/intern/MOD_simpledeform.cc @@ -431,7 +431,7 @@ static void deform_verts(ModifierData *md, ctx, ctx->object, mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_smooth.cc b/source/blender/modifiers/intern/MOD_smooth.cc index 3357dcbd0af..14b5a42aaaf 100644 --- a/source/blender/modifiers/intern/MOD_smooth.cc +++ b/source/blender/modifiers/intern/MOD_smooth.cc @@ -70,7 +70,7 @@ static void smoothModifier_do( return; } - float(*accumulated_vecs)[3] = MEM_calloc_arrayN(verts_num, __func__); + float (*accumulated_vecs)[3] = MEM_calloc_arrayN(verts_num, __func__); if (!accumulated_vecs) { return; } @@ -172,7 +172,7 @@ static void deform_verts(ModifierData *md, { SmoothModifierData *smd = (SmoothModifierData *)md; smoothModifier_do( - smd, ctx->object, mesh, reinterpret_cast(positions.data()), positions.size()); + smd, ctx->object, mesh, reinterpret_cast(positions.data()), positions.size()); } static void panel_draw(const bContext * /*C*/, Panel *panel) diff --git a/source/blender/modifiers/intern/MOD_softbody.cc b/source/blender/modifiers/intern/MOD_softbody.cc index 145a7d60840..bffde563c46 100644 --- a/source/blender/modifiers/intern/MOD_softbody.cc +++ b/source/blender/modifiers/intern/MOD_softbody.cc @@ -36,7 +36,7 @@ static void deform_verts(ModifierData * /*md*/, scene, ctx->object, DEG_get_ctime(ctx->depsgraph), - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.cc b/source/blender/modifiers/intern/MOD_solidify_extrude.cc index ea22727e00e..6ac132fa793 100644 --- a/source/blender/modifiers/intern/MOD_solidify_extrude.cc +++ b/source/blender/modifiers/intern/MOD_solidify_extrude.cc @@ -174,7 +174,7 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex uint *edge_users = nullptr; int *edge_order = nullptr; - float(*vert_nors)[3] = nullptr; + float (*vert_nors)[3] = nullptr; blender::Span face_normals; const bool need_face_normals = (smd->flag & MOD_SOLIDIFY_NORMAL_CALC) || diff --git a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc index ccb1658c02c..c0c4e33be8f 100644 --- a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc +++ b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc @@ -298,7 +298,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, /* Vert edge adjacent map. */ OldVertEdgeRef **vert_adj_edges = MEM_calloc_arrayN(verts_num, __func__); /* Original vertex positions (changed for degenerated geometry). */ - float(*orig_mvert_co)[3] = MEM_malloc_arrayN(verts_num, __func__); + float (*orig_mvert_co)[3] = MEM_malloc_arrayN(verts_num, __func__); /* Fill in the original vertex positions. */ for (uint i = 0; i < verts_num; i++) { orig_mvert_co[i][0] = orig_vert_positions[i][0]; @@ -1427,7 +1427,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, NewEdgeRef *first_edge = nullptr; NewEdgeRef **edge_ptr = g->edges; /* Contains normal and offset `[nx, ny, nz, ofs]`. */ - float(*planes_queue)[4] = MEM_malloc_arrayN(g->edges_len + 1, __func__); + float (*planes_queue)[4] = MEM_malloc_arrayN(g->edges_len + 1, __func__); uint queue_index = 0; float fallback_nor[3]; diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.cc b/source/blender/modifiers/intern/MOD_surfacedeform.cc index 4e04d18a7cb..343c5e55913 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.cc +++ b/source/blender/modifiers/intern/MOD_surfacedeform.cc @@ -1370,7 +1370,7 @@ static void deformVert(void *__restrict userdata, } normal_poly_v3( - norm, reinterpret_cast(coords_buffer.data()), sdbind->verts_num); + norm, reinterpret_cast(coords_buffer.data()), sdbind->verts_num); zero_v3(temp); switch (sdbind->mode) { @@ -1394,7 +1394,7 @@ static void deformVert(void *__restrict userdata, case MOD_SDEF_MODE_CENTROID: { float cent[3]; mid_v3_v3_array( - cent, reinterpret_cast(coords_buffer.data()), sdbind->verts_num); + cent, reinterpret_cast(coords_buffer.data()), sdbind->verts_num); madd_v3_v3fl(temp, data->targetCos[sdbind->vert_inds[0]], sdbind->vert_weights[0]); madd_v3_v3fl(temp, data->targetCos[sdbind->vert_inds[1]], sdbind->vert_weights[1]); @@ -1565,7 +1565,7 @@ static void deform_verts(ModifierData *md, { surfacedeformModifier_do(md, ctx, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size(), ctx->object, mesh); diff --git a/source/blender/modifiers/intern/MOD_util.cc b/source/blender/modifiers/intern/MOD_util.cc index 752271ceb20..97f8fac69de 100644 --- a/source/blender/modifiers/intern/MOD_util.cc +++ b/source/blender/modifiers/intern/MOD_util.cc @@ -144,7 +144,7 @@ void MOD_previous_vcos_store(ModifierData *md, const float (*vert_coords)[3]) while ((md = md->next) && md->type == eModifierType_Armature) { ArmatureModifierData *amd = (ArmatureModifierData *)md; if (amd->multi && amd->vert_coords_prev == nullptr) { - amd->vert_coords_prev = static_cast(MEM_dupallocN(vert_coords)); + amd->vert_coords_prev = static_cast(MEM_dupallocN(vert_coords)); } else { break; diff --git a/source/blender/modifiers/intern/MOD_uvwarp.cc b/source/blender/modifiers/intern/MOD_uvwarp.cc index 52a259694a7..82e17d8d923 100644 --- a/source/blender/modifiers/intern/MOD_uvwarp.cc +++ b/source/blender/modifiers/intern/MOD_uvwarp.cc @@ -105,7 +105,7 @@ static void uv_warp_compute(void *__restrict userdata, const MDeformVert *dvert = data->dvert; const int defgrp_index = data->defgrp_index; - float(*warp_mat)[4] = data->warp_mat; + float (*warp_mat)[4] = data->warp_mat; int l; diff --git a/source/blender/modifiers/intern/MOD_warp.cc b/source/blender/modifiers/intern/MOD_warp.cc index 537f0d30f8d..22abaa19847 100644 --- a/source/blender/modifiers/intern/MOD_warp.cc +++ b/source/blender/modifiers/intern/MOD_warp.cc @@ -190,7 +190,7 @@ static void warpModifier_do(WarpModifierData *wmd, int defgrp_index; const MDeformVert *dvert, *dv = nullptr; const bool invert_vgroup = (wmd->flag & MOD_WARP_INVERT_VGROUP) != 0; - float(*tex_co)[3] = nullptr; + float (*tex_co)[3] = nullptr; if (!(wmd->object_from && wmd->object_to)) { return; @@ -336,7 +336,7 @@ static void deform_verts(ModifierData *md, { WarpModifierData *wmd = (WarpModifierData *)md; warpModifier_do( - wmd, ctx, mesh, reinterpret_cast(positions.data()), positions.size()); + wmd, ctx, mesh, reinterpret_cast(positions.data()), positions.size()); } static void panel_draw(const bContext * /*C*/, Panel *panel) diff --git a/source/blender/modifiers/intern/MOD_wave.cc b/source/blender/modifiers/intern/MOD_wave.cc index 3809c0f21e7..0d64321f982 100644 --- a/source/blender/modifiers/intern/MOD_wave.cc +++ b/source/blender/modifiers/intern/MOD_wave.cc @@ -126,7 +126,7 @@ static void waveModifier_do(WaveModifierData *wmd, float ctime = DEG_get_ctime(ctx->depsgraph); float minfac = float(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow)); float lifefac = wmd->height; - float(*tex_co)[3] = nullptr; + float (*tex_co)[3] = nullptr; const int wmd_axis = wmd->flag & (MOD_WAVE_X | MOD_WAVE_Y); const float falloff = wmd->falloff; float falloff_fac = 1.0f; /* when falloff == 0.0f this stays at 1.0f */ @@ -286,7 +286,7 @@ static void deform_verts(ModifierData *md, ctx, ctx->object, mesh, - reinterpret_cast(positions.data()), + reinterpret_cast(positions.data()), positions.size()); } diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.cc b/source/blender/modifiers/intern/MOD_weightvg_util.cc index 5547e40a27d..c076c6ada6b 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.cc +++ b/source/blender/modifiers/intern/MOD_weightvg_util.cc @@ -133,7 +133,7 @@ void weightvg_do_mask(const ModifierEvalContext *ctx, /* If we want to mask vgroup weights from a texture. */ if (texture != nullptr) { /* The texture coordinates. */ - float(*tex_co)[3]; + float (*tex_co)[3]; /* See mapping note below... */ MappingInfoModifierData t_map; const int verts_num = mesh->verts_num; diff --git a/source/blender/modifiers/intern/lineart/MOD_lineart.hh b/source/blender/modifiers/intern/lineart/MOD_lineart.hh index 1c1e88bee03..62d7c629e2f 100644 --- a/source/blender/modifiers/intern/lineart/MOD_lineart.hh +++ b/source/blender/modifiers/intern/lineart/MOD_lineart.hh @@ -604,10 +604,10 @@ struct LineartBoundingArea { #define LRT_MIN3_INDEX_ABC(x, y, z) (x < y ? (x < z ? a : (y < z ? b : c)) : (y < z ? b : c)) #define DBL_LOOSER 1e-5 -#define LRT_DOUBLE_CLOSE_LOOSER(a, b) (((a) + DBL_LOOSER) >= (b) && ((a)-DBL_LOOSER) <= (b)) -#define LRT_DOUBLE_CLOSE_ENOUGH(a, b) (((a) + DBL_EDGE_LIM) >= (b) && ((a)-DBL_EDGE_LIM) <= (b)) +#define LRT_DOUBLE_CLOSE_LOOSER(a, b) (((a) + DBL_LOOSER) >= (b) && ((a) - DBL_LOOSER) <= (b)) +#define LRT_DOUBLE_CLOSE_ENOUGH(a, b) (((a) + DBL_EDGE_LIM) >= (b) && ((a) - DBL_EDGE_LIM) <= (b)) #define LRT_DOUBLE_CLOSE_ENOUGH_TRI(a, b) \ - (((a) + DBL_TRIANGLE_LIM) >= (b) && ((a)-DBL_TRIANGLE_LIM) <= (b)) + (((a) + DBL_TRIANGLE_LIM) >= (b) && ((a) - DBL_TRIANGLE_LIM) <= (b)) #define LRT_CLOSE_LOOSER_v3(a, b) \ (LRT_DOUBLE_CLOSE_LOOSER(a[0], b[0]) && LRT_DOUBLE_CLOSE_LOOSER(a[1], b[1]) && \ diff --git a/source/blender/modifiers/intern/lineart/lineart_cpu.cc b/source/blender/modifiers/intern/lineart/lineart_cpu.cc index cce5b6f7c59..c6e8ea1f116 100644 --- a/source/blender/modifiers/intern/lineart/lineart_cpu.cc +++ b/source/blender/modifiers/intern/lineart/lineart_cpu.cc @@ -1216,7 +1216,7 @@ void lineart_main_cull_triangles(LineartData *ld, bool clip_far) { LineartTriangle *tri; LineartElementLinkNode *v_eln, *t_eln, *e_eln; - double(*m_view_projection)[4] = ld->conf.view_projection; + double (*m_view_projection)[4] = ld->conf.view_projection; int i; int v_count = 0, t_count = 0, e_count = 0; Object *ob; diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.cc b/source/blender/nodes/composite/nodes/node_composite_glare.cc index 312107ca711..b733205b60c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_glare.cc +++ b/source/blender/nodes/composite/nodes/node_composite_glare.cc @@ -1412,7 +1412,7 @@ class GlareOperation : public NodeOperation { GPU_shader_uniform_4fv_array(shader, "color_modulators", color_modulators.size(), - (const float(*)[4])color_modulators.data()); + (const float (*)[4])color_modulators.data()); /* Zero initialize output image where ghosts will be accumulated. */ const float4 zero_color = float4(0.0f); diff --git a/source/blender/nodes/function/nodes/node_fn_bit_math.cc b/source/blender/nodes/function/nodes/node_fn_bit_math.cc index 709041532c0..2c9108cda91 100644 --- a/source/blender/nodes/function/nodes/node_fn_bit_math.cc +++ b/source/blender/nodes/function/nodes/node_fn_bit_math.cc @@ -143,8 +143,7 @@ static const mf::MultiFunction *get_multi_function(const bNode &bnode) "Or", [](int a, int b) { return a | b; }, exec_preset); static auto xor_fn = mf::build::SI2_SO( "Xor", [](int a, int b) { return a ^ b; }, exec_preset); - static auto not_fn = mf::build::SI1_SO( - "Not", [](int a) { return ~a; }, exec_preset); + static auto not_fn = mf::build::SI1_SO("Not", [](int a) { return ~a; }, exec_preset); static auto shift_fn = mf::build::SI2_SO( "Shift", [](int a, int b) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc b/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc index 92b5b8683bb..b602e348f99 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc @@ -31,7 +31,7 @@ static void node_declare(NodeDeclarationBuilder &b) static Mesh *hull_from_bullet(const Mesh *mesh, Span coords) { - plConvexHull hull = plConvexHullCompute((float(*)[3])coords.data(), coords.size()); + plConvexHull hull = plConvexHullCompute((float (*)[3])coords.data(), coords.size()); const int verts_num = plConvexHullNumVertices(hull); const int faces_num = verts_num <= 2 ? 0 : plConvexHullNumFaces(hull); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc index 76275d82d4f..d6b198209ab 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc @@ -415,41 +415,39 @@ NODE_SHADER_MATERIALX_BEGIN /* NOTE: commented inputs aren't used for node creation. */ auto bsdf_inputs = [&]() -> InputsType { - return - { - {"base_color", get_input_value("Base Color", NodeItem::Type::Color3)}, - {"diffuse_roughness", get_input_value("Diffuse Roughness", NodeItem::Type::Float)}, - {"subsurface", get_input_value("Subsurface Weight", NodeItem::Type::Float)}, - {"subsurface_scale", get_input_value("Subsurface Scale", NodeItem::Type::Float)}, + return { + {"base_color", get_input_value("Base Color", NodeItem::Type::Color3)}, + {"diffuse_roughness", get_input_value("Diffuse Roughness", NodeItem::Type::Float)}, + {"subsurface", get_input_value("Subsurface Weight", NodeItem::Type::Float)}, + {"subsurface_scale", get_input_value("Subsurface Scale", NodeItem::Type::Float)}, # if MATERIALX_MAJOR_VERSION <= 1 && MATERIALX_MINOR_VERSION <= 38 - {"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Vector3)}, + {"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Vector3)}, # else - {"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Color3)}, + {"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Color3)}, # endif - //{"subsurface_ior", get_input_value("Subsurface IOR", NodeItem::Type::Vector3)}, - {"subsurface_anisotropy", - get_input_value("Subsurface Anisotropy", NodeItem::Type::Float)}, - {"metallic", get_input_value("Metallic", NodeItem::Type::Float)}, - {"specular", get_input_value("Specular IOR Level", NodeItem::Type::Float)}, - {"specular_tint", get_input_value("Specular Tint", NodeItem::Type::Color3)}, - {"roughness", get_input_value("Roughness", NodeItem::Type::Float)}, - {"anisotropic", get_input_value("Anisotropic", NodeItem::Type::Float)}, - {"anisotropic_rotation", get_input_value("Anisotropic Rotation", NodeItem::Type::Float)}, - {"sheen", get_input_value("Sheen Weight", NodeItem::Type::Float)}, - {"sheen_roughness", get_input_value("Sheen Roughness", NodeItem::Type::Float)}, - {"sheen_tint", get_input_value("Sheen Tint", NodeItem::Type::Color3)}, - {"coat", get_input_value("Coat Weight", NodeItem::Type::Float)}, - {"coat_roughness", get_input_value("Coat Roughness", NodeItem::Type::Float)}, - {"coat_ior", get_input_value("Coat IOR", NodeItem::Type::Float)}, - {"coat_tint", get_input_value("Coat Tint", NodeItem::Type::Color3)}, - {"ior", get_input_value("IOR", NodeItem::Type::Float)}, - {"transmission", get_input_value("Transmission Weight", NodeItem::Type::Float)}, - {"thin_film_thickness", get_input_value("Thin Film Thickness", NodeItem::Type::Float)}, - {"thin_film_IOR", get_input_value("Thin Film IOR", NodeItem::Type::Float)}, - {"alpha", get_input_value("Alpha", NodeItem::Type::Float)}, - {"normal", get_input_link("Normal", NodeItem::Type::Vector3)}, - {"coat_normal", get_input_link("Coat Normal", NodeItem::Type::Vector3)}, - {"tangent", get_input_link("Tangent", NodeItem::Type::Vector3)}, + //{"subsurface_ior", get_input_value("Subsurface IOR", NodeItem::Type::Vector3)}, + {"subsurface_anisotropy", get_input_value("Subsurface Anisotropy", NodeItem::Type::Float)}, + {"metallic", get_input_value("Metallic", NodeItem::Type::Float)}, + {"specular", get_input_value("Specular IOR Level", NodeItem::Type::Float)}, + {"specular_tint", get_input_value("Specular Tint", NodeItem::Type::Color3)}, + {"roughness", get_input_value("Roughness", NodeItem::Type::Float)}, + {"anisotropic", get_input_value("Anisotropic", NodeItem::Type::Float)}, + {"anisotropic_rotation", get_input_value("Anisotropic Rotation", NodeItem::Type::Float)}, + {"sheen", get_input_value("Sheen Weight", NodeItem::Type::Float)}, + {"sheen_roughness", get_input_value("Sheen Roughness", NodeItem::Type::Float)}, + {"sheen_tint", get_input_value("Sheen Tint", NodeItem::Type::Color3)}, + {"coat", get_input_value("Coat Weight", NodeItem::Type::Float)}, + {"coat_roughness", get_input_value("Coat Roughness", NodeItem::Type::Float)}, + {"coat_ior", get_input_value("Coat IOR", NodeItem::Type::Float)}, + {"coat_tint", get_input_value("Coat Tint", NodeItem::Type::Color3)}, + {"ior", get_input_value("IOR", NodeItem::Type::Float)}, + {"transmission", get_input_value("Transmission Weight", NodeItem::Type::Float)}, + {"thin_film_thickness", get_input_value("Thin Film Thickness", NodeItem::Type::Float)}, + {"thin_film_IOR", get_input_value("Thin Film IOR", NodeItem::Type::Float)}, + {"alpha", get_input_value("Alpha", NodeItem::Type::Float)}, + {"normal", get_input_link("Normal", NodeItem::Type::Vector3)}, + {"coat_normal", get_input_link("Coat Normal", NodeItem::Type::Vector3)}, + {"tangent", get_input_link("Tangent", NodeItem::Type::Vector3)}, }; }; diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.cc b/source/blender/nodes/texture/nodes/node_texture_proc.cc index bc1b77db038..7287d4670a5 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.cc +++ b/source/blender/nodes/texture/nodes/node_texture_proc.cc @@ -28,10 +28,7 @@ static blender::bke::bNodeSocketTemplate outputs_color_only[] = {{SOCK_RGBA, N_( /* Inputs common to all, #defined because nodes will need their own inputs too */ #define I 2 /* count */ #define COMMON_INPUTS \ - {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, \ - { \ - SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f \ - } + {SOCK_RGBA, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f}, {SOCK_RGBA, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f} /* Calls multitex and copies the result to the outputs. * Called by xxx_exec, which handles inputs. */ diff --git a/source/blender/python/bmesh/bmesh_py_types.cc b/source/blender/python/bmesh/bmesh_py_types.cc index 3ed7db4357c..c652e3a59f9 100644 --- a/source/blender/python/bmesh/bmesh_py_types.cc +++ b/source/blender/python/bmesh/bmesh_py_types.cc @@ -1542,14 +1542,14 @@ static PyObject *bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject if (!filter_flags) { BM_ITER_MESH (eve, &iter, self->bm, BM_VERTS_OF_MESH) { - mul_m4_v3((float(*)[4])mat_ptr, eve->co); + mul_m4_v3((float (*)[4])mat_ptr, eve->co); } } else { const char filter_flags_ch = char(filter_flags); BM_ITER_MESH (eve, &iter, self->bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(eve, filter_flags_ch)) { - mul_m4_v3((float(*)[4])mat_ptr, eve->co); + mul_m4_v3((float (*)[4])mat_ptr, eve->co); } } } diff --git a/source/blender/python/bmesh/bmesh_py_utils.cc b/source/blender/python/bmesh/bmesh_py_utils.cc index e864367eb41..8ec1e03afe8 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.cc +++ b/source/blender/python/bmesh/bmesh_py_utils.cc @@ -498,7 +498,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject * /*self*/, PyObject *args, Py py_face->f, l_a, l_b, - (float(*)[3])coords, + (float (*)[3])coords, ncoords, &l_new, py_edge_example ? py_edge_example->e : nullptr); diff --git a/source/blender/python/gpu/gpu_py_offscreen.cc b/source/blender/python/gpu/gpu_py_offscreen.cc index 89249c23f97..87280fa5e41 100644 --- a/source/blender/python/gpu/gpu_py_offscreen.cc +++ b/source/blender/python/gpu/gpu_py_offscreen.cc @@ -483,8 +483,8 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar region, GPU_offscreen_width(self->ofs), GPU_offscreen_height(self->ofs), - (const float(*)[4])py_mat_view->matrix, - (const float(*)[4])py_mat_projection->matrix, + (const float (*)[4])py_mat_view->matrix, + (const float (*)[4])py_mat_projection->matrix, true, draw_background, "", diff --git a/source/blender/python/intern/bpy_rna.cc b/source/blender/python/intern/bpy_rna.cc index 41d1ba8fe4c..05f301e7de9 100644 --- a/source/blender/python/intern/bpy_rna.cc +++ b/source/blender/python/intern/bpy_rna.cc @@ -8295,7 +8295,7 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna) /* Stupid/simple case. */ if (srna == nullptr) { newclass = nullptr; /* Nothing to do. */ - } /* The class may have already been declared & allocated. */ + } /* The class may have already been declared & allocated. */ else if ((newclass = static_cast(RNA_struct_py_type_get(srna)))) { /* Add a reference for the return value. */ Py_INCREF(newclass); diff --git a/source/blender/python/mathutils/mathutils_Euler.cc b/source/blender/python/mathutils/mathutils_Euler.cc index a08a6d0f7e5..459fc87a529 100644 --- a/source/blender/python/mathutils/mathutils_Euler.cc +++ b/source/blender/python/mathutils/mathutils_Euler.cc @@ -192,7 +192,7 @@ static PyObject *Euler_to_matrix(EulerObject *self) return nullptr; } - eulO_to_mat3((float(*)[3])mat, self->eul, self->order); + eulO_to_mat3((float (*)[3])mat, self->eul, self->order); return Matrix_CreatePyObject(mat, 3, 3, nullptr); } diff --git a/source/blender/python/mathutils/mathutils_Matrix.cc b/source/blender/python/mathutils/mathutils_Matrix.cc index 9e679f278c7..5a488f524bf 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.cc +++ b/source/blender/python/mathutils/mathutils_Matrix.cc @@ -139,7 +139,7 @@ static float matrix_determinant_internal(const MatrixObject *self) MATRIX_ITEM(self, 2, 2)); } - return determinant_m4((const float(*)[4])self->matrix); + return determinant_m4((const float (*)[4])self->matrix); } static void adjoint_matrix_n(float *mat_dst, const float *mat_src, const ushort dim) @@ -147,15 +147,15 @@ static void adjoint_matrix_n(float *mat_dst, const float *mat_src, const ushort /* calculate the classical adjoint */ switch (dim) { case 2: { - adjoint_m2_m2((float(*)[2])mat_dst, (const float(*)[2])mat_src); + adjoint_m2_m2((float (*)[2])mat_dst, (const float (*)[2])mat_src); break; } case 3: { - adjoint_m3_m3((float(*)[3])mat_dst, (const float(*)[3])mat_src); + adjoint_m3_m3((float (*)[3])mat_dst, (const float (*)[3])mat_src); break; } case 4: { - adjoint_m4_m4((float(*)[4])mat_dst, (const float(*)[4])mat_src); + adjoint_m4_m4((float (*)[4])mat_dst, (const float (*)[4])mat_src); break; } default: @@ -222,10 +222,10 @@ static void matrix_invert_safe_internal(const MatrixObject *self, float *r_mat) switch (self->col_num) { case 2: { - float(*mat)[2] = (float(*)[2])in_mat; + float (*mat)[2] = (float (*)[2])in_mat; if (in_mat != self->matrix) { - copy_m2_m2(mat, (const float(*)[2])self->matrix); + copy_m2_m2(mat, (const float (*)[2])self->matrix); } mat[0][0] += eps; mat[1][1] += eps; @@ -237,10 +237,10 @@ static void matrix_invert_safe_internal(const MatrixObject *self, float *r_mat) break; } case 3: { - float(*mat)[3] = (float(*)[3])in_mat; + float (*mat)[3] = (float (*)[3])in_mat; if (in_mat != self->matrix) { - copy_m3_m3(mat, (const float(*)[3])self->matrix); + copy_m3_m3(mat, (const float (*)[3])self->matrix); } mat[0][0] += eps; mat[1][1] += eps; @@ -253,10 +253,10 @@ static void matrix_invert_safe_internal(const MatrixObject *self, float *r_mat) break; } case 4: { - float(*mat)[4] = (float(*)[4])in_mat; + float (*mat)[4] = (float (*)[4])in_mat; if (in_mat != self->matrix) { - copy_m4_m4(mat, (const float(*)[4])self->matrix); + copy_m4_m4(mat, (const float (*)[4])self->matrix); } mat[0][0] += eps; mat[1][1] += eps; @@ -757,14 +757,14 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) return nullptr; } - axis_angle_to_mat3((float(*)[3])mat, tvec, angle); + axis_angle_to_mat3((float (*)[3])mat, tvec, angle); } else if (matSize == 2) { - angle_to_mat2((float(*)[2])mat, angle); + angle_to_mat2((float (*)[2])mat, angle); } else { /* valid axis checked above */ - axis_angle_to_mat3_single((float(*)[3])mat, axis[0], angle); + axis_angle_to_mat3_single((float (*)[3])mat, axis[0], angle); } if (matSize == 4) { @@ -1215,7 +1215,7 @@ static PyObject *C_Matrix_LocRotScale(PyObject *cls, PyObject *args) } if (mat_obj->col_num == 3 && mat_obj->row_num == 3) { - copy_m4_m3(mat, (const float(*)[3])mat_obj->matrix); + copy_m4_m3(mat, (const float (*)[3])mat_obj->matrix); } else { PyErr_SetString(PyExc_ValueError, @@ -1280,10 +1280,10 @@ static PyObject *Matrix_to_quaternion(MatrixObject *self) return nullptr; } if (self->row_num == 3) { - mat3_to_quat(quat, (const float(*)[3])self->matrix); + mat3_to_quat(quat, (const float (*)[3])self->matrix); } else { - mat4_to_quat(quat, (const float(*)[4])self->matrix); + mat4_to_quat(quat, (const float (*)[4])self->matrix); } return Quaternion_CreatePyObject(quat, nullptr); } @@ -1337,10 +1337,10 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args) /* Must be 3-4 cols, 3-4 rows, square matrix. */ if (self->row_num == 3 && self->col_num == 3) { - copy_m3_m3(mat, (const float(*)[3])self->matrix); + copy_m3_m3(mat, (const float (*)[3])self->matrix); } else if (self->row_num == 4 && self->col_num == 4) { - copy_m3_m4(mat, (const float(*)[4])self->matrix); + copy_m3_m4(mat, (const float (*)[4])self->matrix); } else { PyErr_SetString(PyExc_ValueError, @@ -1416,7 +1416,7 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self) memcpy(mat[col], MATRIX_COL_PTR(self, col), self->row_num * sizeof(float)); } - copy_m4_m4((float(*)[4])self->matrix, (const float(*)[4])mat); + copy_m4_m4((float (*)[4])self->matrix, (const float (*)[4])mat); self->col_num = 4; self->row_num = 4; @@ -1903,7 +1903,7 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value) matrix_as_3x3(self_rmat, self); mul_m3_m3m3(rmat, other_rmat, self_rmat); - copy_m3_m3((float(*)[3])(self->matrix), rmat); + copy_m3_m3((float (*)[3])(self->matrix), rmat); (void)BaseMath_WriteCallback(self); Py_RETURN_NONE; @@ -1943,7 +1943,7 @@ static PyObject *Matrix_decompose(MatrixObject *self) return nullptr; } - mat4_to_loc_rot_size(loc, rot, size, (const float(*)[4])self->matrix); + mat4_to_loc_rot_size(loc, rot, size, (const float (*)[4])self->matrix); mat3_normalized_to_quat_fast(quat, rot); ret = PyTuple_New(3); @@ -1997,16 +1997,16 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args) /* TODO: different sized matrix. */ if (self->col_num == 4 && self->row_num == 4) { #ifdef MATH_STANDALONE - blend_m4_m4m4((float(*)[4])mat, (float(*)[4])self->matrix, (float(*)[4])mat2->matrix, fac); + blend_m4_m4m4((float (*)[4])mat, (float (*)[4])self->matrix, (float (*)[4])mat2->matrix, fac); #else - interp_m4_m4m4((float(*)[4])mat, (float(*)[4])self->matrix, (float(*)[4])mat2->matrix, fac); + interp_m4_m4m4((float (*)[4])mat, (float (*)[4])self->matrix, (float (*)[4])mat2->matrix, fac); #endif } else if (self->col_num == 3 && self->row_num == 3) { #ifdef MATH_STANDALONE - blend_m3_m3m3((float(*)[3])mat, (float(*)[3])self->matrix, (float(*)[3])mat2->matrix, fac); + blend_m3_m3m3((float (*)[3])mat, (float (*)[3])self->matrix, (float (*)[3])mat2->matrix, fac); #else - interp_m3_m3m3((float(*)[3])mat, (float(*)[3])self->matrix, (float(*)[3])mat2->matrix, fac); + interp_m3_m3m3((float (*)[3])mat, (float (*)[3])self->matrix, (float (*)[3])mat2->matrix, fac); #endif } else { @@ -2079,10 +2079,10 @@ static PyObject *Matrix_transpose(MatrixObject *self) MATRIX_ITEM(self, 0, 1) = t; } else if (self->col_num == 3) { - transpose_m3((float(*)[3])self->matrix); + transpose_m3((float (*)[3])self->matrix); } else { - transpose_m4((float(*)[4])self->matrix); + transpose_m4((float (*)[4])self->matrix); } (void)BaseMath_WriteCallback(self); @@ -2131,10 +2131,10 @@ static PyObject *Matrix_normalize(MatrixObject *self) } if (self->col_num == 3) { - normalize_m3((float(*)[3])self->matrix); + normalize_m3((float (*)[3])self->matrix); } else if (self->col_num == 4) { - normalize_m4((float(*)[4])self->matrix); + normalize_m4((float (*)[4])self->matrix); } else { PyErr_SetString(PyExc_ValueError, @@ -2200,13 +2200,13 @@ static void matrix_identity_internal(MatrixObject *self) BLI_assert((self->col_num == self->row_num) && (self->row_num <= 4)); if (self->col_num == 2) { - unit_m2((float(*)[2])self->matrix); + unit_m2((float (*)[2])self->matrix); } else if (self->col_num == 3) { - unit_m3((float(*)[3])self->matrix); + unit_m3((float (*)[3])self->matrix); } else { - unit_m4((float(*)[4])self->matrix); + unit_m4((float (*)[4])self->matrix); } } @@ -3219,7 +3219,7 @@ static int Matrix_translation_set(MatrixObject *self, PyObject *value, void * /* return -1; } - copy_v3_v3(((float(*)[4])self->matrix)[3], tvec); + copy_v3_v3(((float (*)[4])self->matrix)[3], tvec); (void)BaseMath_WriteCallback(self); @@ -3304,10 +3304,10 @@ static PyObject *Matrix_is_negative_get(MatrixObject *self, void * /*closure*/) /* Must be 3-4 cols, 3-4 rows, square matrix. */ if (self->row_num == 4 && self->col_num == 4) { - return PyBool_FromLong(is_negative_m4((const float(*)[4])self->matrix)); + return PyBool_FromLong(is_negative_m4((const float (*)[4])self->matrix)); } if (self->row_num == 3 && self->col_num == 3) { - return PyBool_FromLong(is_negative_m3((const float(*)[3])self->matrix)); + return PyBool_FromLong(is_negative_m3((const float (*)[3])self->matrix)); } PyErr_SetString(PyExc_AttributeError, @@ -3330,10 +3330,10 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void * /*closure*/ /* Must be 3-4 cols, 3-4 rows, square matrix. */ if (self->row_num == 4 && self->col_num == 4) { - return PyBool_FromLong(is_orthonormal_m4((const float(*)[4])self->matrix)); + return PyBool_FromLong(is_orthonormal_m4((const float (*)[4])self->matrix)); } if (self->row_num == 3 && self->col_num == 3) { - return PyBool_FromLong(is_orthonormal_m3((const float(*)[3])self->matrix)); + return PyBool_FromLong(is_orthonormal_m3((const float (*)[3])self->matrix)); } PyErr_SetString(PyExc_AttributeError, @@ -3357,10 +3357,10 @@ static PyObject *Matrix_is_orthogonal_axis_vectors_get(MatrixObject *self, void /* Must be 3-4 cols, 3-4 rows, square matrix. */ if (self->row_num == 4 && self->col_num == 4) { - return PyBool_FromLong(is_orthogonal_m4((const float(*)[4])self->matrix)); + return PyBool_FromLong(is_orthogonal_m4((const float (*)[4])self->matrix)); } if (self->row_num == 3 && self->col_num == 3) { - return PyBool_FromLong(is_orthogonal_m3((const float(*)[3])self->matrix)); + return PyBool_FromLong(is_orthogonal_m3((const float (*)[3])self->matrix)); } PyErr_SetString(PyExc_AttributeError, diff --git a/source/blender/python/mathutils/mathutils_Quaternion.cc b/source/blender/python/mathutils/mathutils_Quaternion.cc index 1c508719076..fe9574b2e53 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.cc +++ b/source/blender/python/mathutils/mathutils_Quaternion.cc @@ -266,7 +266,7 @@ static PyObject *Quaternion_to_matrix(QuaternionObject *self) return nullptr; } - quat_to_mat3((float(*)[3])mat, self->quat); + quat_to_mat3((float (*)[3])mat, self->quat); return Matrix_CreatePyObject(mat, 3, 3, nullptr); } diff --git a/source/blender/python/mathutils/mathutils_Vector.cc b/source/blender/python/mathutils/mathutils_Vector.cc index 5ba3962e469..5debe86f807 100644 --- a/source/blender/python/mathutils/mathutils_Vector.cc +++ b/source/blender/python/mathutils/mathutils_Vector.cc @@ -1494,7 +1494,7 @@ static PyObject *Vector_rotate(VectorObject *self, PyObject *value) if (!Matrix_Parse2x2(value, &pymat)) { return nullptr; } - normalize_m2_m2(other_rmat, (const float(*)[2])pymat->matrix); + normalize_m2_m2(other_rmat, (const float (*)[2])pymat->matrix); /* Equivalent to a rotation along the Z axis. */ mul_m2_v2(other_rmat, self->vec); } @@ -2914,31 +2914,46 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure #define VECTOR_SWIZZLE2_RW_DEF(attr, a, b) \ { \ - attr, (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, Vector_swizzle_doc, \ - SWIZZLE2(a, b), \ + attr, \ + (getter)Vector_swizzle_get, \ + (setter)Vector_swizzle_set, \ + Vector_swizzle_doc, \ + SWIZZLE2(a, b), \ } #define VECTOR_SWIZZLE2_RO_DEF(attr, a, b) \ { \ - attr, (getter)Vector_swizzle_get, (setter) nullptr, Vector_swizzle_doc, SWIZZLE2(a, b), \ + attr, \ + (getter)Vector_swizzle_get, \ + (setter) nullptr, \ + Vector_swizzle_doc, \ + SWIZZLE2(a, b), \ } #define VECTOR_SWIZZLE3_RW_DEF(attr, a, b, c) \ { \ - attr, (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, Vector_swizzle_doc, \ - SWIZZLE3(a, b, c), \ + attr, \ + (getter)Vector_swizzle_get, \ + (setter)Vector_swizzle_set, \ + Vector_swizzle_doc, \ + SWIZZLE3(a, b, c), \ } #define VECTOR_SWIZZLE3_RO_DEF(attr, a, b, c) \ { \ - attr, (getter)Vector_swizzle_get, (setter) nullptr, Vector_swizzle_doc, SWIZZLE3(a, b, c), \ + attr, \ + (getter)Vector_swizzle_get, \ + (setter) nullptr, \ + Vector_swizzle_doc, \ + SWIZZLE3(a, b, c), \ } #define VECTOR_SWIZZLE4_RW_DEF(attr, a, b, c, d) \ { \ - attr, (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, Vector_swizzle_doc, \ - SWIZZLE4(a, b, c, d), \ + attr, \ + (getter)Vector_swizzle_get, \ + (setter)Vector_swizzle_set, \ + Vector_swizzle_doc, \ + SWIZZLE4(a, b, c, d), \ } #define VECTOR_SWIZZLE4_RO_DEF(attr, a, b, c, d) \ - { \ - attr, (getter)Vector_swizzle_get, (setter) nullptr, Vector_swizzle_doc, SWIZZLE4(a, b, c, d) \ - } + {attr, (getter)Vector_swizzle_get, (setter) nullptr, Vector_swizzle_doc, SWIZZLE4(a, b, c, d)} /** \} */ diff --git a/source/blender/python/mathutils/mathutils_bvhtree.cc b/source/blender/python/mathutils/mathutils_bvhtree.cc index bb7fa882b89..7d4fd7de9f5 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.cc +++ b/source/blender/python/mathutils/mathutils_bvhtree.cc @@ -263,7 +263,7 @@ static void py_bvhtree_raycast_cb(void *userdata, { const PyBVHTree *self = static_cast(userdata); - const float(*coords)[3] = self->coords; + const float (*coords)[3] = self->coords; const uint *tri = self->tris[index]; const float *tri_co[3] = {coords[tri[0]], coords[tri[1]], coords[tri[2]]}; float dist; @@ -296,7 +296,7 @@ static void py_bvhtree_nearest_point_cb(void *userdata, { PyBVHTree *self = static_cast(userdata); - const float(*coords)[3] = (const float(*)[3])self->coords; + const float (*coords)[3] = (const float (*)[3])self->coords; const uint *tri = self->tris[index]; const float *tri_co[3] = {coords[tri[0]], coords[tri[1]], coords[tri[2]]}; float nearest_tmp[3], dist_sq; @@ -429,7 +429,7 @@ static void py_bvhtree_nearest_point_range_cb(void *userdata, PyBVH_RangeData *data = static_cast(userdata); PyBVHTree *self = data->self; - const float(*coords)[3] = self->coords; + const float (*coords)[3] = self->coords; const uint *tri = self->tris[index]; const float *tri_co[3] = {coords[tri[0]], coords[tri[1]], coords[tri[2]]}; float nearest_tmp[3], dist_sq; @@ -658,7 +658,7 @@ static PyObject *C_BVHTree_FromPolygons(PyObject * /*cls*/, PyObject *args, PyOb MemArena *poly_arena = nullptr; MemArena *pf_arena = nullptr; - float(*coords)[3] = nullptr; + float (*coords)[3] = nullptr; uint(*tris)[3] = nullptr; uint coords_len, tris_len; float epsilon = 0.0f; @@ -666,7 +666,7 @@ static PyObject *C_BVHTree_FromPolygons(PyObject * /*cls*/, PyObject *args, PyOb /* when all_triangles is False */ int *orig_index = nullptr; - float(*orig_normal)[3] = nullptr; + float (*orig_normal)[3] = nullptr; uint i; bool valid = true; @@ -833,7 +833,7 @@ static PyObject *C_BVHTree_FromPolygons(PyObject * /*cls*/, PyObject *args, PyOb i++; } else if (plink->len > 3) { - float(*proj_coords)[2] = static_cast( + float (*proj_coords)[2] = static_cast( BLI_memarena_alloc(pf_arena, sizeof(*proj_coords) * plink->len)); float *normal = orig_normal[poly_index]; const float *co_prev; @@ -940,7 +940,7 @@ static PyObject *C_BVHTree_FromBMesh(PyObject * /*cls*/, PyObject *args, PyObjec BPy_BMesh *py_bm; - float(*coords)[3] = nullptr; + float (*coords)[3] = nullptr; uint(*tris)[3] = nullptr; uint coords_len, tris_len; float epsilon = 0.0f; @@ -977,7 +977,7 @@ static PyObject *C_BVHTree_FromBMesh(PyObject * /*cls*/, PyObject *args, PyObjec uint i; int *orig_index = nullptr; - float(*orig_normal)[3] = nullptr; + float (*orig_normal)[3] = nullptr; tree = BLI_bvhtree_new(int(tris_len), epsilon, PY_BVH_TREE_TYPE_DEFAULT, PY_BVH_AXIS_DEFAULT); if (tree) { @@ -1188,7 +1188,7 @@ static PyObject *C_BVHTree_FromObject(PyObject * /*cls*/, PyObject *args, PyObje const uint coords_len = uint(mesh->verts_num); - float(*coords)[3] = MEM_malloc_arrayN(size_t(coords_len), __func__); + float (*coords)[3] = MEM_malloc_arrayN(size_t(coords_len), __func__); uint(*tris)[3] = MEM_malloc_arrayN(size_t(corner_tris.size()), __func__); memcpy(coords, mesh->vert_positions().data(), sizeof(float[3]) * size_t(mesh->verts_num)); @@ -1236,7 +1236,7 @@ static PyObject *C_BVHTree_FromObject(PyObject * /*cls*/, PyObject *args, PyObje tris, uint(corner_tris.size()), orig_index, - reinterpret_cast(orig_normal)); + reinterpret_cast(orig_normal)); } #endif /* MATH_STANDALONE */ diff --git a/source/blender/python/mathutils/mathutils_geometry.cc b/source/blender/python/mathutils/mathutils_geometry.cc index 1920e6caa00..4d31c2005e9 100644 --- a/source/blender/python/mathutils/mathutils_geometry.cc +++ b/source/blender/python/mathutils/mathutils_geometry.cc @@ -352,7 +352,7 @@ PyDoc_STRVAR( " :rtype: :class:`mathutils.Vector`\n"); static PyObject *M_Geometry_normal(PyObject * /*self*/, PyObject *args) { - float(*coords)[3]; + float (*coords)[3]; int coords_len; float n[3]; PyObject *ret = nullptr; @@ -1228,7 +1228,7 @@ PyDoc_STRVAR( static PyObject *M_Geometry_points_in_planes(PyObject * /*self*/, PyObject *args) { PyObject *py_planes; - float(*planes)[4]; + float (*planes)[4]; float eps_coplanar = 1e-4f; float eps_isect = 1e-6f; uint planes_len; @@ -1577,7 +1577,7 @@ PyDoc_STRVAR( " :rtype: float\n"); static PyObject *M_Geometry_box_fit_2d(PyObject * /*self*/, PyObject *pointlist) { - float(*points)[2]; + float (*points)[2]; Py_ssize_t len; float angle = 0.0f; @@ -1610,7 +1610,7 @@ PyDoc_STRVAR( " :rtype: list[int]\n"); static PyObject *M_Geometry_convex_hull_2d(PyObject * /*self*/, PyObject *pointlist) { - float(*points)[2]; + float (*points)[2]; Py_ssize_t len; PyObject *ret; @@ -1718,8 +1718,8 @@ static PyObject *M_Geometry_delaunay_2d_cdt(PyObject * /*self*/, PyObject *args) int output_type; float epsilon; bool need_ids = true; - float(*in_coords)[2] = nullptr; - int(*in_edges)[2] = nullptr; + float (*in_coords)[2] = nullptr; + int (*in_edges)[2] = nullptr; Py_ssize_t vert_coords_len, edges_len; PyObject *out_vert_coords = nullptr; PyObject *out_edges = nullptr; diff --git a/source/blender/python/mathutils/mathutils_interpolate.cc b/source/blender/python/mathutils/mathutils_interpolate.cc index 661923739dc..555956254a3 100644 --- a/source/blender/python/mathutils/mathutils_interpolate.cc +++ b/source/blender/python/mathutils/mathutils_interpolate.cc @@ -37,7 +37,7 @@ PyDoc_STRVAR( static PyObject *M_Interpolate_poly_3d_calc(PyObject * /*self*/, PyObject *args) { float fp[3]; - float(*vecs)[3]; + float (*vecs)[3]; Py_ssize_t len; PyObject *point, *veclist, *ret; diff --git a/source/blender/render/intern/engine.cc b/source/blender/render/intern/engine.cc index 05c8d736e84..41ef228e4e6 100644 --- a/source/blender/render/intern/engine.cc +++ b/source/blender/render/intern/engine.cc @@ -607,10 +607,10 @@ void RE_engine_get_camera_model_matrix(RenderEngine *engine, * leaving stereo to be handled by the engine. */ Render *re = engine->re; if (use_spherical_stereo || re == nullptr) { - BKE_camera_multiview_model_matrix(nullptr, camera, nullptr, (float(*)[4])r_modelmat); + BKE_camera_multiview_model_matrix(nullptr, camera, nullptr, (float (*)[4])r_modelmat); } else { - BKE_camera_multiview_model_matrix(&re->r, camera, re->viewname, (float(*)[4])r_modelmat); + BKE_camera_multiview_model_matrix(&re->r, camera, re->viewname, (float (*)[4])r_modelmat); } } diff --git a/source/blender/render/intern/texture_image.cc b/source/blender/render/intern/texture_image.cc index dddf658860e..1aca5bd7fe1 100644 --- a/source/blender/render/intern/texture_image.cc +++ b/source/blender/render/intern/texture_image.cc @@ -685,7 +685,7 @@ static int ibuf_get_color_clip(float col[4], ImBuf *ibuf, int x, int y, int extf x = std::max(x, 0); /* TXF alpha: clip = 1; } */ if (x >= ibuf->x) { x = ibuf->x - 1; - } /* TXF alpha: clip = 1; } */ + } /* TXF alpha: clip = 1; } */ y = std::max(y, 0); /* TXF alpha: clip = 1; } */ if (y >= ibuf->y) { y = ibuf->y - 1; diff --git a/source/blender/simulation/intern/SIM_mass_spring.cc b/source/blender/simulation/intern/SIM_mass_spring.cc index 7fd4cc41c2f..fd3fb090848 100644 --- a/source/blender/simulation/intern/SIM_mass_spring.cc +++ b/source/blender/simulation/intern/SIM_mass_spring.cc @@ -277,7 +277,7 @@ static int UNUSED_FUNCTION(cloth_calc_helper_forces)( Object * /*ob*/, ClothModifierData *clmd, float (*initial_cos)[3], float /*step*/, float dt) { Cloth *cloth = clmd->clothObject; - float(*cos)[3] = MEM_calloc_arrayN(cloth->mvert_num, "cos cloth_calc_helper_forces"); + float (*cos)[3] = MEM_calloc_arrayN(cloth->mvert_num, "cos cloth_calc_helper_forces"); float *masses = MEM_calloc_arrayN(cloth->mvert_num, "cos cloth_calc_helper_forces"); LinkNode *node; ClothSpring *spring; @@ -699,8 +699,8 @@ static void cloth_calc_force( bool has_wind = false, has_force = false; /* cache per-vertex forces to avoid redundant calculation */ - float(*winvec)[3] = MEM_calloc_arrayN(mvert_num * 2, "effector forces"); - float(*forcevec)[3] = is_not_hair ? winvec + mvert_num : winvec; + float (*winvec)[3] = MEM_calloc_arrayN(mvert_num * 2, "effector forces"); + float (*forcevec)[3] = is_not_hair ? winvec + mvert_num : winvec; for (i = 0; i < cloth->mvert_num; i++) { float x[3], v[3]; diff --git a/source/blender/windowmanager/WM_api.hh b/source/blender/windowmanager/WM_api.hh index e94674330d2..bb7ab80a4eb 100644 --- a/source/blender/windowmanager/WM_api.hh +++ b/source/blender/windowmanager/WM_api.hh @@ -2103,7 +2103,7 @@ bool WM_event_is_ime_switch(const wmEvent *event); /* `wm_tooltip.cc` */ -using wmTooltipInitFn = ARegion *(*)(bContext *C, +using wmTooltipInitFn = ARegion *(*)(bContext * C, ARegion *region, int *pass, double *r_pass_delay, diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc index 7d6ebff8ad8..64694452ec8 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc @@ -523,12 +523,12 @@ void WM_gizmo_calc_matrix_final_params(const wmGizmo *gz, const WM_GizmoMatrixParams *params, float r_mat[4][4]) { - const float(*const matrix_space)[4] = params->matrix_space ? params->matrix_space : - gz->matrix_space; - const float(*const matrix_basis)[4] = params->matrix_basis ? params->matrix_basis : - gz->matrix_basis; - const float(*const matrix_offset)[4] = params->matrix_offset ? params->matrix_offset : - gz->matrix_offset; + const float (*const matrix_space)[4] = params->matrix_space ? params->matrix_space : + gz->matrix_space; + const float (*const matrix_basis)[4] = params->matrix_basis ? params->matrix_basis : + gz->matrix_basis; + const float (*const matrix_offset)[4] = params->matrix_offset ? params->matrix_offset : + gz->matrix_offset; const float *scale_final = params->scale_final ? params->scale_final : &gz->scale_final; float final_matrix[4][4]; diff --git a/source/blender/windowmanager/intern/wm_gesture.cc b/source/blender/windowmanager/intern/wm_gesture.cc index 5ad01260ca5..5095a9af8bf 100644 --- a/source/blender/windowmanager/intern/wm_gesture.cc +++ b/source/blender/windowmanager/intern/wm_gesture.cc @@ -381,7 +381,7 @@ static void draw_filled_lasso(wmGesture *gt, const blender::int2 *lasso_pt_extra * tool, and this common logic. */ static void draw_lasso_smooth_stroke_indicator(wmGesture *gt, const uint shdr_pos) { - float(*lasso)[2] = static_cast(gt->customdata); + float (*lasso)[2] = static_cast(gt->customdata); float last_x = lasso[gt->points - 1][0]; float last_y = lasso[gt->points - 1][1]; @@ -466,7 +466,7 @@ static void draw_start_vertex_circle(const wmGesture >, const uint shdr_pos) const int numverts = gt.points; /* Draw the circle around the starting vertex. */ - const short(*border)[2] = static_cast(gt.customdata); + const short (*border)[2] = static_cast(gt.customdata); const float start_pos[2] = {float(border[0][0]), float(border[0][1])}; const float current_pos[2] = {float(gt.mval.x), float(gt.mval.y)}; diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.cc b/source/blender/windowmanager/intern/wm_gesture_ops.cc index f72f55942f7..0d5c013b791 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.cc +++ b/source/blender/windowmanager/intern/wm_gesture_ops.cc @@ -583,7 +583,7 @@ wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEve } { - float(*lasso)[2] = static_cast(gesture->customdata); + float (*lasso)[2] = static_cast(gesture->customdata); const float2 current_mouse_position = float2(gesture->mval); const float2 last_position(lasso[gesture->points - 1][0], lasso[gesture->points - 1][1]); @@ -756,7 +756,7 @@ static int gesture_polyline_valid_points(const wmGesture &wmGesture, const bool return num_points; } - short(*points)[2] = static_cast(wmGesture.customdata); + short (*points)[2] = static_cast(wmGesture.customdata); const short prev_x = points[num_points - 1][0]; const short prev_y = points[num_points - 1][1]; @@ -834,7 +834,7 @@ wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wm break; case GESTURE_MODAL_SELECT: { wm_gesture_tag_redraw(CTX_wm_window(C)); - short(*border)[2] = static_cast(gesture->customdata); + short (*border)[2] = static_cast(gesture->customdata); const short prev_x = border[gesture->points - 1][0]; const short prev_y = border[gesture->points - 1][1]; @@ -880,7 +880,7 @@ wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wm gesture->customdata = MEM_reallocN(gesture->customdata, sizeof(short[2]) * gesture->points_alloc); } - short(*border)[2] = static_cast(gesture->customdata); + short (*border)[2] = static_cast(gesture->customdata); /* move the lasso */ if (gesture->move) { diff --git a/source/blender/windowmanager/xr/intern/wm_xr_action.cc b/source/blender/windowmanager/xr/intern/wm_xr_action.cc index 50d56d0fd5f..84149de41d0 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_action.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_action.cc @@ -491,7 +491,7 @@ bool WM_xr_action_state_get(const wmXrData *xr, r_state->state_float = ((float *)action->states)[i]; break; case XR_VECTOR2F_INPUT: - copy_v2_v2(r_state->state_vector2f, ((float(*)[2])action->states)[i]); + copy_v2_v2(r_state->state_vector2f, ((float (*)[2])action->states)[i]); break; case XR_POSE_INPUT: { const GHOST_XrPose *pose = &((GHOST_XrPose *)action->states)[i]; diff --git a/source/blender/windowmanager/xr/intern/wm_xr_draw.cc b/source/blender/windowmanager/xr/intern/wm_xr_draw.cc index 0f77254eb53..1aa1d8dd433 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_draw.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_draw.cc @@ -371,7 +371,7 @@ static void wm_xr_controller_aim_draw(const XrSessionSettings *settings, wmXrSes immBegin(GPU_PRIM_LINES, 2); - const float(*mat)[4] = controller->aim_mat; + const float (*mat)[4] = controller->aim_mat; madd_v3_v3v3fl(ray, mat[3], mat[2], -scale); immAttrSkip(col); @@ -399,7 +399,7 @@ static void wm_xr_controller_aim_draw(const XrSessionSettings *settings, wmXrSes immBegin(GPU_PRIM_LINES, 6); - const float(*mat)[4] = controller->aim_mat; + const float (*mat)[4] = controller->aim_mat; madd_v3_v3v3fl(x_axis, mat[3], mat[0], scale); madd_v3_v3v3fl(y_axis, mat[3], mat[1], scale); madd_v3_v3v3fl(z_axis, mat[3], mat[2], scale); diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.cc b/source/blender/windowmanager/xr/intern/wm_xr_session.cc index d5173d24f31..9f2b5f9d8b6 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_session.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_session.cc @@ -941,8 +941,8 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, break; } case XR_VECTOR2F_INPUT: { - const float(*state)[2] = &((float(*)[2])action->states)[subaction_idx]; - float(*state_prev)[2] = &((float(*)[2])action->states_prev)[subaction_idx]; + const float (*state)[2] = &((float (*)[2])action->states)[subaction_idx]; + float (*state_prev)[2] = &((float (*)[2])action->states_prev)[subaction_idx]; if (test_vec2f_state( *state, action->float_thresholds[subaction_idx], action->axis_flags[subaction_idx])) { @@ -1079,7 +1079,7 @@ static bool wm_xr_session_action_test_bimanual(const wmXrSessionState *session_s break; } case XR_VECTOR2F_INPUT: { - const float(*state)[2] = &((float(*)[2])action->states)[*r_subaction_idx_other]; + const float (*state)[2] = &((float (*)[2])action->states)[*r_subaction_idx_other]; if (test_vec2f_state(*state, action->float_thresholds[*r_subaction_idx_other], action->axis_flags[*r_subaction_idx_other])) @@ -1134,9 +1134,9 @@ static wmXrActionData *wm_xr_session_event_create(const char *action_set_name, data->float_threshold = action->float_thresholds[subaction_idx]; break; case XR_VECTOR2F_INPUT: - copy_v2_v2(data->state, ((float(*)[2])action->states)[subaction_idx]); + copy_v2_v2(data->state, ((float (*)[2])action->states)[subaction_idx]); if (bimanual) { - copy_v2_v2(data->state_other, ((float(*)[2])action->states)[subaction_idx_other]); + copy_v2_v2(data->state_other, ((float (*)[2])action->states)[subaction_idx_other]); } data->float_threshold = action->float_thresholds[subaction_idx]; break; diff --git a/source/creator/creator_args.cc b/source/creator/creator_args.cc index f2adfdfa2d7..9d114f2ef7d 100644 --- a/source/creator/creator_args.cc +++ b/source/creator/creator_args.cc @@ -389,7 +389,7 @@ static int (*parse_int_range_relative_clamp_n(const char *str, } } - int(*values)[2] = MEM_malloc_arrayN(size_t(len), __func__); + int (*values)[2] = MEM_malloc_arrayN(size_t(len), __func__); int i = 0; while (true) { const char *str_end_range; @@ -2318,7 +2318,7 @@ static int arg_handle_render_frame(int argc, const char **argv, void *data) Render *re; ReportList reports; - int(*frame_range_arr)[2], frames_range_len; + int (*frame_range_arr)[2], frames_range_len; if ((frame_range_arr = parse_int_range_relative_clamp_n(argv[1], scene->r.sfra, scene->r.efra,