From fd589fdca4bb080fc6f7314e59e4618b4635b6fa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Apr 2024 13:09:21 +1000 Subject: [PATCH] Cleanup: various non functional C++ changes --- intern/ghost/intern/GHOST_SystemWayland.cc | 8 ++++---- intern/ghost/intern/GHOST_WindowWayland.cc | 10 +++++----- intern/guardedalloc/intern/mallocn.cc | 6 +++--- source/blender/blenkernel/intern/colortools.cc | 2 +- source/blender/blenkernel/intern/pbvh.cc | 2 +- source/blender/blenkernel/intern/softbody.cc | 3 +-- source/blender/blenlib/intern/array_store.cc | 2 +- source/blender/blenloader/intern/versioning_400.cc | 4 +--- source/blender/blenloader/intern/writefile.cc | 6 +++--- .../compositor/operations/COM_SunBeamsOperation.cc | 2 +- .../draw/engines/eevee/eevee_shaders_extra.cc | 6 +++--- .../blender/draw/engines/eevee/eevee_shadows_cube.cc | 4 ++-- .../blender/draw/engines/eevee_next/eevee_shader.cc | 12 ++++++------ .../blender/draw/engines/gpencil/gpencil_engine_c.cc | 2 +- source/blender/editors/animation/time_scrub_ui.cc | 2 +- .../interface/templates/interface_templates.cc | 6 +++--- source/blender/editors/space_console/console_ops.cc | 2 +- .../space_sequencer/sequencer_preview_draw.cc | 2 +- .../blender/editors/space_userpref/userpref_ops.cc | 2 +- .../editors/transform/transform_convert_mesh.cc | 2 +- .../editors/transform/transform_convert_mesh_uv.cc | 2 +- source/blender/geometry/intern/extend_curves.cc | 4 ++-- source/blender/gpu/vulkan/vk_data_conversion.cc | 4 ++-- .../blender/gpu/vulkan/vk_descriptor_set_layouts.cc | 2 +- source/blender/gpu/vulkan/vk_device.cc | 2 +- .../modifiers/intern/MOD_grease_pencil_envelope.cc | 6 +++--- source/blender/sequencer/intern/render.cc | 2 +- source/blender/sequencer/intern/strip_transform.cc | 5 +---- 28 files changed, 53 insertions(+), 59 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index 2a9b3f183a0..9ada3687190 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -3616,7 +3616,7 @@ static void cursor_surface_handle_leave(void *data, wl_surface *wl_surface, wl_o } static void cursor_surface_handle_preferred_buffer_scale(void * /*data*/, - struct wl_surface * /*wl_surface*/, + wl_surface * /*wl_surface*/, int32_t factor) { /* Only available in interface version 6. */ @@ -3624,7 +3624,7 @@ static void cursor_surface_handle_preferred_buffer_scale(void * /*data*/, } static void cursor_surface_handle_preferred_buffer_transform(void * /*data*/, - struct wl_surface * /*wl_surface*/, + wl_surface * /*wl_surface*/, uint32_t transform) { /* Only available in interface version 6. */ @@ -6143,13 +6143,13 @@ static void output_handle_scale(void *data, wl_output * /*wl_output*/, const int output->system->output_scale_update(output); } -static void output_handle_name(void * /*data*/, struct wl_output * /*wl_output*/, const char *name) +static void output_handle_name(void * /*data*/, wl_output * /*wl_output*/, const char *name) { /* Only available in interface version 4. */ CLOG_INFO(LOG, 2, "name (%s)", name); } static void output_handle_description(void * /*data*/, - struct wl_output * /*wl_output*/, + wl_output * /*wl_output*/, const char *description) { /* Only available in interface version 4. */ diff --git a/intern/ghost/intern/GHOST_WindowWayland.cc b/intern/ghost/intern/GHOST_WindowWayland.cc index 41c0d624ec2..782642c144b 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cc +++ b/intern/ghost/intern/GHOST_WindowWayland.cc @@ -1197,7 +1197,7 @@ static void xdg_toplevel_handle_close(void *data, xdg_toplevel * /*xdg_toplevel* } static void xdg_toplevel_handle_configure_bounds(void *data, - struct xdg_toplevel * /*xdg_toplevel*/, + xdg_toplevel * /*xdg_toplevel*/, int32_t width, int32_t height) { @@ -1213,8 +1213,8 @@ static void xdg_toplevel_handle_configure_bounds(void *data, } } static void xdg_toplevel_handle_wm_capabilities(void * /*data*/, - struct xdg_toplevel * /*xdg_toplevel*/, - struct wl_array * /*capabilities*/) + xdg_toplevel * /*xdg_toplevel*/, + wl_array * /*capabilities*/) { /* Only available in interface version 5. */ CLOG_INFO(LOG, 2, "wm_capabilities"); @@ -1595,7 +1595,7 @@ static void surface_handle_leave(void *data, wl_surface * /*wl_surface*/, wl_out } static void surface_handle_preferred_buffer_scale(void * /*data*/, - struct wl_surface * /*wl_surface*/, + wl_surface * /*wl_surface*/, int32_t factor) { /* Only available in interface version 6. */ @@ -1603,7 +1603,7 @@ static void surface_handle_preferred_buffer_scale(void * /*data*/, } static void surface_handle_preferred_buffer_transform(void * /*data*/, - struct wl_surface * /*wl_surface*/, + wl_surface * /*wl_surface*/, uint32_t transform) { /* Only available in interface version 6. */ diff --git a/intern/guardedalloc/intern/mallocn.cc b/intern/guardedalloc/intern/mallocn.cc index e6b22840173..7fcd708f45c 100644 --- a/intern/guardedalloc/intern/mallocn.cc +++ b/intern/guardedalloc/intern/mallocn.cc @@ -101,7 +101,7 @@ void aligned_free(void *ptr) * Helps catching issues (in debug build) caused by an unintended allocator type change when there * are allocation happened. */ -static void assert_for_allocator_change(void) +static void assert_for_allocator_change() { /* NOTE: Assume that there is no "sticky" internal state which would make switching allocator * type after all allocations are freed unsafe. In fact, it should be safe to change allocator @@ -110,7 +110,7 @@ static void assert_for_allocator_change(void) assert(MEM_get_memory_blocks_in_use() == 0); } -void MEM_use_lockfree_allocator(void) +void MEM_use_lockfree_allocator() { /* NOTE: Keep in sync with static initialization of the variables. */ @@ -150,7 +150,7 @@ void MEM_use_lockfree_allocator(void) #endif } -void MEM_use_guarded_allocator(void) +void MEM_use_guarded_allocator() { assert_for_allocator_change(); diff --git a/source/blender/blenkernel/intern/colortools.cc b/source/blender/blenkernel/intern/colortools.cc index 593c8f70054..5d373b5f3b7 100644 --- a/source/blender/blenkernel/intern/colortools.cc +++ b/source/blender/blenkernel/intern/colortools.cc @@ -365,7 +365,7 @@ void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope break; case CURVE_PRESET_MID8: { for (int i = 0; i < cuma->totpoint; i++) { - cuma->curve[i].x = i / (float(cuma->totpoint)); + cuma->curve[i].x = i / float(cuma->totpoint); cuma->curve[i].y = 0.5; } break; diff --git a/source/blender/blenkernel/intern/pbvh.cc b/source/blender/blenkernel/intern/pbvh.cc index ebf0c560ef5..d2fa10c2cce 100644 --- a/source/blender/blenkernel/intern/pbvh.cc +++ b/source/blender/blenkernel/intern/pbvh.cc @@ -2982,7 +2982,7 @@ bool pbvh_has_mask(const PBVH *pbvh) return pbvh->mesh->attributes().contains(".sculpt_mask"); case PBVH_BMESH: return pbvh->header.bm && - (CustomData_has_layer_named(&pbvh->header.bm->vdata, CD_PROP_FLOAT, ".sculpt_mask")); + CustomData_has_layer_named(&pbvh->header.bm->vdata, CD_PROP_FLOAT, ".sculpt_mask"); } return false; diff --git a/source/blender/blenkernel/intern/softbody.cc b/source/blender/blenkernel/intern/softbody.cc index 89e9105c77a..b8b974ccc07 100644 --- a/source/blender/blenkernel/intern/softbody.cc +++ b/source/blender/blenkernel/intern/softbody.cc @@ -2976,7 +2976,6 @@ static void curve_surf_to_softbody(Object *ob) SoftBody *sb; BodyPoint *bp; BodySpring *bs; - Nurb *nu; BezTriple *bezt; BPoint *bpnt; int a, curindex = 0; @@ -3005,7 +3004,7 @@ static void curve_surf_to_softbody(Object *ob) setgoal = 1; } - for (nu = static_cast(cu->nurb.first); nu; nu = nu->next) { + LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) { if (nu->bezt) { /* Bezier case; this is nicely said naive; who ever wrote this part, * it was not me (JOW) :). diff --git a/source/blender/blenlib/intern/array_store.cc b/source/blender/blenlib/intern/array_store.cc index 0449142b21a..babc30b41ca 100644 --- a/source/blender/blenlib/intern/array_store.cc +++ b/source/blender/blenlib/intern/array_store.cc @@ -472,7 +472,7 @@ static void bchunk_list_ensure_min_size_last(const BArrayInfo *info, BArrayMemory *bs_mem, BChunkList *chunk_list) { - BChunkRef *cref = static_cast((chunk_list->chunk_refs.last)); + BChunkRef *cref = static_cast(chunk_list->chunk_refs.last); if (cref && cref->prev) { /* Both are decrefed after use (end of this block). */ BChunk *chunk_curr = cref->link; diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index 79b3bfb0119..87288d66d64 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -1060,9 +1060,7 @@ static void versioning_replace_musgrave_texture_node(bNodeTree *ntree) } else { if (*detail < 1.0f) { - if ((noise_type != SHD_NOISE_RIDGED_MULTIFRACTAL) && - (noise_type != SHD_NOISE_HETERO_TERRAIN)) - { + if (!ELEM(noise_type, SHD_NOISE_RIDGED_MULTIFRACTAL, SHD_NOISE_HETERO_TERRAIN)) { /* Add Multiply Math node behind Fac output. */ bNode *mul_node = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc index 7768a682c55..d33d723f712 100644 --- a/source/blender/blenloader/intern/writefile.cc +++ b/source/blender/blenloader/intern/writefile.cc @@ -621,9 +621,9 @@ static void mywrite_id_begin(WriteData *wd, ID *id) MemFileChunk *prev_memchunk = curr_memchunk != nullptr ? static_cast(curr_memchunk->prev) : nullptr; - if ((curr_memchunk == nullptr || curr_memchunk->id_session_uid != id->session_uid || - (prev_memchunk != nullptr && - (prev_memchunk->id_session_uid == curr_memchunk->id_session_uid)))) + if (curr_memchunk == nullptr || curr_memchunk->id_session_uid != id->session_uid || + (prev_memchunk != nullptr && + (prev_memchunk->id_session_uid == curr_memchunk->id_session_uid))) { if (MemFileChunk *ref = wd->mem.id_session_uid_mapping.lookup_default(id->session_uid, nullptr)) diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cc b/source/blender/compositor/operations/COM_SunBeamsOperation.cc index 8091523c979..8b80b24a65d 100644 --- a/source/blender/compositor/operations/COM_SunBeamsOperation.cc +++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cc @@ -64,7 +64,7 @@ void SunBeamsOperation::update_memory_buffer_partial(MemoryBuffer *output, /* Attenuate the contributions of pixels that are further away from the source using a * quadratic falloff. Also weight by the alpha to give more significance to opaque pixels. */ - const float weight = (math::square(1.0f - i / float(steps))) * sample_color.w; + const float weight = math::square(1.0f - i / float(steps)) * sample_color.w; accumulated_weight += weight; accumulated_color += sample_color * weight; diff --git a/source/blender/draw/engines/eevee/eevee_shaders_extra.cc b/source/blender/draw/engines/eevee/eevee_shaders_extra.cc index 74bd82d09be..f1597f2fbcb 100644 --- a/source/blender/draw/engines/eevee/eevee_shaders_extra.cc +++ b/source/blender/draw/engines/eevee/eevee_shaders_extra.cc @@ -131,7 +131,7 @@ void eevee_shader_material_create_info_amend(GPUMaterial *gpumat, attr_load << "void attrib_load()\n"; attr_load << "{\n"; - attr_load << ((!codegen.attr_load.empty()) ? codegen.attr_load : ""); + attr_load << (!codegen.attr_load.empty() ? codegen.attr_load : ""); attr_load << "}\n\n"; std::stringstream vert_gen, frag_gen, geom_gen; @@ -156,10 +156,10 @@ void eevee_shader_material_create_info_amend(GPUMaterial *gpumat, frag_gen << "Closure nodetree_exec()\n"; frag_gen << "{\n"; if (is_volume) { - frag_gen << ((!codegen.volume.empty()) ? codegen.volume : "return CLOSURE_DEFAULT;\n"); + frag_gen << (!codegen.volume.empty() ? codegen.volume : "return CLOSURE_DEFAULT;\n"); } else { - frag_gen << ((!codegen.surface.empty()) ? codegen.surface : "return CLOSURE_DEFAULT;\n"); + frag_gen << (!codegen.surface.empty() ? codegen.surface : "return CLOSURE_DEFAULT;\n"); } frag_gen << "}\n\n"; diff --git a/source/blender/draw/engines/eevee/eevee_shadows_cube.cc b/source/blender/draw/engines/eevee/eevee_shadows_cube.cc index 79f4f128242..90783233f94 100644 --- a/source/blender/draw/engines/eevee/eevee_shadows_cube.cc +++ b/source/blender/draw/engines/eevee/eevee_shadows_cube.cc @@ -189,13 +189,13 @@ void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, for (int j = 0; j < 6; j++) { /* Optimization: Only render the needed faces. */ /* Skip all but -Z face. */ - if ((ELEM(evli->light_type, LA_SPOT, LAMPTYPE_SPOT_DISK)) && j != 5 && + if (ELEM(evli->light_type, LA_SPOT, LAMPTYPE_SPOT_DISK) && j != 5 && spot_angle_fit_single_face(evli)) { continue; } /* Skip +Z face. */ - if (!(ELEM(evli->light_type, LA_LOCAL, LAMPTYPE_OMNI_DISK)) && j == 4) { + if (!ELEM(evli->light_type, LA_LOCAL, LAMPTYPE_OMNI_DISK) && j == 4) { continue; } /* TODO(fclem): some cube sides can be invisible in the main views. Cull them. */ diff --git a/source/blender/draw/engines/eevee_next/eevee_shader.cc b/source/blender/draw/engines/eevee_next/eevee_shader.cc index 0993677acd7..83d6de14ae1 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shader.cc +++ b/source/blender/draw/engines/eevee_next/eevee_shader.cc @@ -589,7 +589,7 @@ void ShaderModule::material_create_info_ammend(GPUMaterial *gpumat, GPUCodegenOu std::stringstream attr_load; attr_load << "void attrib_load()\n"; attr_load << "{\n"; - attr_load << ((!codegen.attr_load.empty()) ? codegen.attr_load : ""); + attr_load << (!codegen.attr_load.empty() ? codegen.attr_load : ""); attr_load << "}\n\n"; std::stringstream vert_gen, frag_gen, comp_gen; @@ -604,9 +604,9 @@ void ShaderModule::material_create_info_ammend(GPUMaterial *gpumat, GPUCodegenOu } { - const bool use_vertex_displacement = (!codegen.displacement.empty()) && + const bool use_vertex_displacement = !codegen.displacement.empty() && (displacement_type != MAT_DISPLACEMENT_BUMP) && - (!ELEM(geometry_type, MAT_GEOM_WORLD, MAT_GEOM_VOLUME)); + !ELEM(geometry_type, MAT_GEOM_WORLD, MAT_GEOM_VOLUME); vert_gen << "vec3 nodetree_displacement()\n"; vert_gen << "{\n"; @@ -617,7 +617,7 @@ void ShaderModule::material_create_info_ammend(GPUMaterial *gpumat, GPUCodegenOu } if (pipeline_type != MAT_PIPE_VOLUME_OCCUPANCY) { - frag_gen << ((!codegen.material_functions.empty()) ? codegen.material_functions : "\n"); + frag_gen << (!codegen.material_functions.empty() ? codegen.material_functions : "\n"); if (!codegen.displacement.empty()) { /* Bump displacement. Needed to recompute normals after displacement. */ @@ -632,7 +632,7 @@ void ShaderModule::material_create_info_ammend(GPUMaterial *gpumat, GPUCodegenOu frag_gen << "Closure nodetree_surface(float closure_rand)\n"; frag_gen << "{\n"; frag_gen << " closure_weights_reset(closure_rand);\n"; - frag_gen << ((!codegen.surface.empty()) ? codegen.surface : "return Closure(0);\n"); + frag_gen << (!codegen.surface.empty() ? codegen.surface : "return Closure(0);\n"); frag_gen << "}\n\n"; frag_gen << "float nodetree_thickness()\n"; @@ -662,7 +662,7 @@ void ShaderModule::material_create_info_ammend(GPUMaterial *gpumat, GPUCodegenOu frag_gen << "Closure nodetree_volume()\n"; frag_gen << "{\n"; frag_gen << " closure_weights_reset(0.0);\n"; - frag_gen << ((!codegen.volume.empty()) ? codegen.volume : "return Closure(0);\n"); + frag_gen << (!codegen.volume.empty() ? codegen.volume : "return Closure(0);\n"); frag_gen << "}\n\n"; info.fragment_source_generated = frag_gen.str(); diff --git a/source/blender/draw/engines/gpencil/gpencil_engine_c.cc b/source/blender/draw/engines/gpencil/gpencil_engine_c.cc index a65ebcd727e..1e206ad4766 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine_c.cc +++ b/source/blender/draw/engines/gpencil/gpencil_engine_c.cc @@ -1217,7 +1217,7 @@ void GPENCIL_draw_scene(void *ved) /* Fade 3D objects. */ if ((!pd->is_render) && (pd->fade_3d_object_opacity > -1.0f) && (pd->obact != nullptr) && - (ELEM(pd->obact->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL))) + ELEM(pd->obact->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)) { float background_color[3]; ED_view3d_background_color_get(pd->scene, pd->v3d, background_color); diff --git a/source/blender/editors/animation/time_scrub_ui.cc b/source/blender/editors/animation/time_scrub_ui.cc index ea2d2359d7e..90987a87f39 100644 --- a/source/blender/editors/animation/time_scrub_ui.cc +++ b/source/blender/editors/animation/time_scrub_ui.cc @@ -133,7 +133,7 @@ static void draw_current_frame(const Scene *scene, uchar text_color[4]; UI_GetThemeColor4ubv(TH_HEADER_TEXT_HI, text_color); - const int y = BLI_rcti_cent_y(scrub_region_rect) - int((fstyle->points * UI_SCALE_FAC * 0.35f)); + const int y = BLI_rcti_cent_y(scrub_region_rect) - int(fstyle->points * UI_SCALE_FAC * 0.35f); UI_fontstyle_draw_simple( +fstyle, frame_x - text_width / 2 + U.pixelsize / 2, y, frame_str, text_color); diff --git a/source/blender/editors/interface/templates/interface_templates.cc b/source/blender/editors/interface/templates/interface_templates.cc index e3526e9b201..2fa7e79c891 100644 --- a/source/blender/editors/interface/templates/interface_templates.cc +++ b/source/blender/editors/interface/templates/interface_templates.cc @@ -1259,7 +1259,7 @@ static uiBut *template_id_def_new_but(uiBlock *block, int w = id ? UI_UNIT_X : id_open ? UI_UNIT_X * 3 : UI_UNIT_X * 6; if (!id) { - w = std::max(UI_fontstyle_string_width(fstyle, button_text) + int((UI_UNIT_X * 1.5f)), w); + w = std::max(UI_fontstyle_string_width(fstyle, button_text) + int(UI_UNIT_X * 1.5f), w); } if (newop) { @@ -1544,7 +1544,7 @@ static void template_ID(const bContext *C, int w = id ? UI_UNIT_X : (flag & UI_ID_ADD_NEW) ? UI_UNIT_X * 3 : UI_UNIT_X * 6; if (!id) { - w = std::max(UI_fontstyle_string_width(fstyle, button_text) + int((UI_UNIT_X * 1.5f)), w); + w = std::max(UI_fontstyle_string_width(fstyle, button_text) + int(UI_UNIT_X * 1.5f), w); } if (openop) { @@ -2827,7 +2827,7 @@ static eAutoPropButsReturn template_operator_property_buts_draw_single( * - this is used for allowing operators with popups to rename stuff with fewer clicks */ if (is_popup) { - if ((but->rnaprop == op->type->prop) && (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM))) { + if ((but->rnaprop == op->type->prop) && ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM)) { UI_but_focus_on_enter_event(CTX_wm_window(C), but); } } diff --git a/source/blender/editors/space_console/console_ops.cc b/source/blender/editors/space_console/console_ops.cc index 84a037067bf..752d0966299 100644 --- a/source/blender/editors/space_console/console_ops.cc +++ b/source/blender/editors/space_console/console_ops.cc @@ -1386,7 +1386,7 @@ static int console_modal_select_all_invoke(bContext *C, int offset = strlen(sc->prompt); - for (ConsoleLine *cl = static_cast(sc->scrollback.first); cl; cl = cl->next) { + LISTBASE_FOREACH (ConsoleLine *, cl, &sc->scrollback) { offset += cl->len + 1; } diff --git a/source/blender/editors/space_sequencer/sequencer_preview_draw.cc b/source/blender/editors/space_sequencer/sequencer_preview_draw.cc index a3c394a54dc..36376e50288 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview_draw.cc +++ b/source/blender/editors/space_sequencer/sequencer_preview_draw.cc @@ -895,7 +895,7 @@ static void sequencer_draw_scopes(Scene *scene, ARegion *region, SpaceSeq *sseq) if (sseq->mainb == SEQ_DRAW_IMG_HISTOGRAM) { draw_histogram(region, scopes->histogram, quads, preview); } - if (sseq->mainb == SEQ_DRAW_IMG_WAVEFORM || sseq->mainb == SEQ_DRAW_IMG_RGBPARADE) { + if (ELEM(sseq->mainb, SEQ_DRAW_IMG_WAVEFORM, SEQ_DRAW_IMG_RGBPARADE)) { use_blend = true; draw_waveform_graticule(region, quads, preview); } diff --git a/source/blender/editors/space_userpref/userpref_ops.cc b/source/blender/editors/space_userpref/userpref_ops.cc index 5c2d18f21c7..adcfc8c8bc7 100644 --- a/source/blender/editors/space_userpref/userpref_ops.cc +++ b/source/blender/editors/space_userpref/userpref_ops.cc @@ -937,7 +937,7 @@ static bool drop_extension_url_poll(bContext * /*C*/, wmDrag *drag, const wmEven /* Check the URL has a `.zip` suffix OR has a known repository as a prefix. * This is needed to support redirects which don't contain an extension. */ if (!(cstr_ext && STRCASEEQ(cstr_ext, ".zip")) && - !(BKE_preferences_extension_repo_find_by_remote_path_prefix(&U, cstr, true))) + !BKE_preferences_extension_repo_find_by_remote_path_prefix(&U, cstr, true)) { return false; } diff --git a/source/blender/editors/transform/transform_convert_mesh.cc b/source/blender/editors/transform/transform_convert_mesh.cc index 00adfc040ee..cb7fe93f5ff 100644 --- a/source/blender/editors/transform/transform_convert_mesh.cc +++ b/source/blender/editors/transform/transform_convert_mesh.cc @@ -2426,7 +2426,7 @@ Array transform_mesh_edge_slide_data_create(const TransD * Find the best direction to slide among the ones already computed. * * \param curr_side_other: previous state of the #SlideTempDataMesh where the faces are - linked to the previous edge. + * linked to the previous edge. * \param l_src: the source corner in the edge to slide. * \param l_dst: the current destination corner. */ diff --git a/source/blender/editors/transform/transform_convert_mesh_uv.cc b/source/blender/editors/transform/transform_convert_mesh_uv.cc index 81760f1af90..98b7dc9c98b 100644 --- a/source/blender/editors/transform/transform_convert_mesh_uv.cc +++ b/source/blender/editors/transform/transform_convert_mesh_uv.cc @@ -945,7 +945,7 @@ Array transform_mesh_uv_edge_slide_data_create(const Tra * Find the best direction to slide among the ones already computed. * * \param curr_prev: prev state of the #SlideTempDataUV where the faces are linked to the - previous edge. + * previous edge. * \param l_src: the source corner in the edge to slide. * \param l_dst: the current destination corner. */ diff --git a/source/blender/geometry/intern/extend_curves.cc b/source/blender/geometry/intern/extend_curves.cc index d856a0aa95e..94689095982 100644 --- a/source/blender/geometry/intern/extend_curves.cc +++ b/source/blender/geometry/intern/extend_curves.cc @@ -257,10 +257,10 @@ bke::CurvesGeometry extend_curves(bke::CurvesGeometry &src_curves, } const int count_start = (use_start_lengths[curve] > 0) ? - (math::ceil(use_start_lengths[curve] * point_density)) : + math::ceil(use_start_lengths[curve] * point_density) : 0; const int count_end = (use_end_lengths[curve] > 0) ? - (math::ceil(use_end_lengths[curve] * point_density)) : + math::ceil(use_end_lengths[curve] * point_density) : 0; dst_points_by_curve[curve] += count_start; dst_points_by_curve[curve] += count_end; diff --git a/source/blender/gpu/vulkan/vk_data_conversion.cc b/source/blender/gpu/vulkan/vk_data_conversion.cc index af936061829..c954ec647cd 100644 --- a/source/blender/gpu/vulkan/vk_data_conversion.cc +++ b/source/blender/gpu/vulkan/vk_data_conversion.cc @@ -748,7 +748,7 @@ template void convert(SignedNormalized &dst, static constexpr int32_t scalar = SignedNormalized::scalar(); static constexpr int32_t delta = SignedNormalized::delta(); static constexpr int32_t max = SignedNormalized::max(); - dst.value = (clamp_i((src.value * scalar + delta), 0, max)); + dst.value = clamp_i((src.value * scalar + delta), 0, max); } template void convert(F32 &dst, const SignedNormalized &src) @@ -762,7 +762,7 @@ template void convert(UnsignedNormalized &dst { static constexpr uint32_t scalar = UnsignedNormalized::scalar(); static constexpr uint32_t max = scalar; - dst.value = (clamp_f((src.value * float(scalar)), 0, float(max))); + dst.value = clamp_f((src.value * float(scalar)), 0, float(max)); } template void convert(F32 &dst, const UnsignedNormalized &src) diff --git a/source/blender/gpu/vulkan/vk_descriptor_set_layouts.cc b/source/blender/gpu/vulkan/vk_descriptor_set_layouts.cc index 4fe8cbc8618..2c96e49fb62 100644 --- a/source/blender/gpu/vulkan/vk_descriptor_set_layouts.cc +++ b/source/blender/gpu/vulkan/vk_descriptor_set_layouts.cc @@ -28,7 +28,7 @@ VkDescriptorSetLayout VKDescriptorSetLayouts::get_or_create(const VKDescriptorSe bool &r_needed) { r_created = false; - r_needed = !(info.bindings.is_empty()); + r_needed = !info.bindings.is_empty(); if (r_needed == false) { return VK_NULL_HANDLE; } diff --git a/source/blender/gpu/vulkan/vk_device.cc b/source/blender/gpu/vulkan/vk_device.cc index 6ea21289882..ef2e7f75f7b 100644 --- a/source/blender/gpu/vulkan/vk_device.cc +++ b/source/blender/gpu/vulkan/vk_device.cc @@ -300,7 +300,7 @@ std::string VKDevice::driver_version() const /* When using Mesa driver we should use VK_VERSION_*. */ if (major > 30) { return std::to_string((driver_version >> 14) & 0x3FFFF) + "." + - std::to_string((driver_version & 0x3FFF)); + std::to_string(driver_version & 0x3FFF); } break; } diff --git a/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc b/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc index 4b551e4423f..345ee7ed95d 100644 --- a/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc +++ b/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc @@ -316,9 +316,9 @@ static void deform_drawing_as_envelope(const GreasePencilEnvelopeModifierData &e const IndexRange points = points_by_curve[curve_i]; const bool cyclic = cyclic_flags[curve_i]; const int point_num = points.size(); - const int spread = cyclic ? (math::abs(((emd.spread + point_num / 2) % point_num) - - point_num / 2)) : - std::min(emd.spread, point_num - 1); + const int spread = cyclic ? + math::abs(((emd.spread + point_num / 2) % point_num) - point_num / 2) : + std::min(emd.spread, point_num - 1); for (const int64_t i : points.index_range()) { const int64_t point_i = points[i]; diff --git a/source/blender/sequencer/intern/render.cc b/source/blender/sequencer/intern/render.cc index c83562a8097..5ded86e0ac3 100644 --- a/source/blender/sequencer/intern/render.cc +++ b/source/blender/sequencer/intern/render.cc @@ -1569,7 +1569,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, is_frame_update = (orig_data.timeline_frame != scene->r.cfra) || (orig_data.subframe != scene->r.subframe); - if ((sequencer_view3d_fn && do_seq_gl && camera)) { + if (sequencer_view3d_fn && do_seq_gl && camera) { char err_out[256] = "unknown"; int width, height; BKE_render_resolution(&scene->r, false, &width, &height); diff --git a/source/blender/sequencer/intern/strip_transform.cc b/source/blender/sequencer/intern/strip_transform.cc index 72e8ac27bf7..b7950efcb1b 100644 --- a/source/blender/sequencer/intern/strip_transform.cc +++ b/source/blender/sequencer/intern/strip_transform.cc @@ -116,10 +116,7 @@ void SEQ_transform_translate_sequence(Scene *evil_scene, Sequence *seq, int delt * updated based on nested strips. This won't work for empty meta-strips, * so they can be treated as normal strip. */ if (seq->type == SEQ_TYPE_META && !BLI_listbase_is_empty(&seq->seqbase)) { - Sequence *seq_child; - for (seq_child = static_cast(seq->seqbase.first); seq_child; - seq_child = seq_child->next) - { + LISTBASE_FOREACH (Sequence *, seq_child, &seq->seqbase) { SEQ_transform_translate_sequence(evil_scene, seq_child, delta); } /* Move meta start/end points. */