diff --git a/source/blender/animrig/intern/action.cc b/source/blender/animrig/intern/action.cc index 36ca8151a5b..ed899b23d51 100644 --- a/source/blender/animrig/intern/action.cc +++ b/source/blender/animrig/intern/action.cc @@ -1032,7 +1032,7 @@ void Slot::set_expanded(const bool expanded) this->slot_flags |= uint8_t(Flags::Expanded); } else { - this->slot_flags &= ~(uint8_t(Flags::Expanded)); + this->slot_flags &= ~uint8_t(Flags::Expanded); } } @@ -1046,7 +1046,7 @@ void Slot::set_selected(const bool selected) this->slot_flags |= uint8_t(Flags::Selected); } else { - this->slot_flags &= ~(uint8_t(Flags::Selected)); + this->slot_flags &= ~uint8_t(Flags::Selected); } } @@ -1060,7 +1060,7 @@ void Slot::set_active(const bool active) this->slot_flags |= uint8_t(Flags::Active); } else { - this->slot_flags &= ~(uint8_t(Flags::Active)); + this->slot_flags &= ~uint8_t(Flags::Active); } } diff --git a/source/blender/blenkernel/intern/asset_edit.cc b/source/blender/blenkernel/intern/asset_edit.cc index 0f62ca9d840..2409a74dc10 100644 --- a/source/blender/blenkernel/intern/asset_edit.cc +++ b/source/blender/blenkernel/intern/asset_edit.cc @@ -135,7 +135,7 @@ static std::string asset_blendfile_path_for_save(const bUserAssetLibrary &user_l for (int i = 1;; i++) { const std::string filepath = root_path + SEP + base_name_filesafe + "_" + std::to_string(i++) + BLENDER_ASSET_FILE_SUFFIX; - if (!BLI_is_file((filepath.c_str()))) { + if (!BLI_is_file(filepath.c_str())) { return filepath; } } diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index f2e464985b5..2f9c2e74e8c 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -833,19 +833,19 @@ int *BKE_attributes_active_index_p(AttributeOwner &owner) { switch (owner.type()) { case AttributeOwnerType::PointCloud: { - return &(owner.get_pointcloud())->attributes_active_index; + return &owner.get_pointcloud()->attributes_active_index; } case AttributeOwnerType::Mesh: { - return &(owner.get_mesh())->attributes_active_index; + return &owner.get_mesh()->attributes_active_index; } case AttributeOwnerType::Curves: { return &owner.get_curves()->geometry.attributes_active_index; } case AttributeOwnerType::GreasePencil: { - return &(owner.get_grease_pencil())->attributes_active_index; + return &owner.get_grease_pencil()->attributes_active_index; } case AttributeOwnerType::GreasePencilDrawing: { - return &(owner.get_grease_pencil_drawing())->geometry.attributes_active_index; + return &owner.get_grease_pencil_drawing()->geometry.attributes_active_index; } } return nullptr; diff --git a/source/blender/blenkernel/intern/blendfile.cc b/source/blender/blenkernel/intern/blendfile.cc index 7f6c0ae6582..f377de4c39a 100644 --- a/source/blender/blenkernel/intern/blendfile.cc +++ b/source/blender/blenkernel/intern/blendfile.cc @@ -481,7 +481,7 @@ static void reuse_editable_asset_bmain_data_for_blendfile(ReuseOldBMainData *reu FOREACH_MAIN_LISTBASE_ID_BEGIN (old_lb, old_id_iter) { /* Keep any datablocks from libraries marked as LIBRARY_ASSET_EDITABLE. */ - if (!((ID_IS_LINKED(old_id_iter) && old_id_iter->lib->runtime.tag & LIBRARY_ASSET_EDITABLE))) { + if (!(ID_IS_LINKED(old_id_iter) && old_id_iter->lib->runtime.tag & LIBRARY_ASSET_EDITABLE)) { continue; } diff --git a/source/blender/blenkernel/intern/multires_unsubdivide.cc b/source/blender/blenkernel/intern/multires_unsubdivide.cc index 896ea34e9cd..ab5ffe3a435 100644 --- a/source/blender/blenkernel/intern/multires_unsubdivide.cc +++ b/source/blender/blenkernel/intern/multires_unsubdivide.cc @@ -67,7 +67,7 @@ static bool is_vertex_in_id(BMVert *v, const int *elem_id, int elem) static bool is_vertex_pole_three(BMVert *v) { - return !BM_vert_is_boundary(v) && (BM_vert_edge_count_is_equal(v, 3)); + return !BM_vert_is_boundary(v) && BM_vert_edge_count_is_equal(v, 3); } static bool is_vertex_pole(BMVert *v) diff --git a/source/blender/blenlib/intern/array_store.cc b/source/blender/blenlib/intern/array_store.cc index 9902072ef7a..da17f012d65 100644 --- a/source/blender/blenlib/intern/array_store.cc +++ b/source/blender/blenlib/intern/array_store.cc @@ -794,7 +794,7 @@ static void bchunk_list_fill_from_array(const BArrayInfo *info, BLI_INLINE hash_key hash_data_single(const uchar p) { - return ((HASH_INIT << 5) + HASH_INIT) + (hash_key)(*((signed char *)&p)); + return ((HASH_INIT << 5) + HASH_INIT) + (hash_key) * ((signed char *)&p); } /* Hash bytes, from #BLI_ghashutil_strhash_n. */ diff --git a/source/blender/compositor/operations/COM_RotateOperation.cc b/source/blender/compositor/operations/COM_RotateOperation.cc index fa78c09cdb0..23547c5a52c 100644 --- a/source/blender/compositor/operations/COM_RotateOperation.cc +++ b/source/blender/compositor/operations/COM_RotateOperation.cc @@ -22,8 +22,8 @@ RotateOperation::RotateOperation() void RotateOperation::get_rotation_center(const rcti &area, float &r_x, float &r_y) { - r_x = (BLI_rcti_size_x(&area)) / 2.0; - r_y = (BLI_rcti_size_y(&area)) / 2.0; + r_x = BLI_rcti_size_x(&area) / 2.0; + r_y = BLI_rcti_size_y(&area) / 2.0; } void RotateOperation::get_rotation_offset(const rcti &input_canvas, diff --git a/source/blender/draw/engines/eevee_next/eevee_sync.cc b/source/blender/draw/engines/eevee_next/eevee_sync.cc index 0968ac070c3..3ad4ef9beec 100644 --- a/source/blender/draw/engines/eevee_next/eevee_sync.cc +++ b/source/blender/draw/engines/eevee_next/eevee_sync.cc @@ -109,7 +109,7 @@ void SyncModule::sync_mesh(Object *ob, return; } - if ((ob->dt < OB_SOLID) && ((inst_.is_viewport() && inst_.v3d->shading.type != OB_RENDER))) { + if ((ob->dt < OB_SOLID) && (inst_.is_viewport() && inst_.v3d->shading.type != OB_RENDER)) { /** Do not render objects with display type lower than solid when in material preview mode. */ return; } diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc b/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc index 99b7a9aaecd..2abbc12cc3b 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc @@ -213,7 +213,7 @@ static float grease_pencil_layer_final_opacity_get(const GPENCIL_PrivateData *pd { const bool is_obact = ((pd->obact) && (pd->obact == ob)); const bool is_fade = (pd->fade_layer_opacity > -1.0f) && (is_obact) && - (!grease_pencil.is_layer_active(&layer)); + !grease_pencil.is_layer_active(&layer); /* Defines layer opacity. For active object depends of layer opacity factor, and * for no active object, depends if the fade grease pencil objects option is enabled. */ diff --git a/source/blender/draw/engines/overlay/overlay_next_shape.cc b/source/blender/draw/engines/overlay/overlay_next_shape.cc index a2227b6475a..017aae05fdc 100644 --- a/source/blender/draw/engines/overlay/overlay_next_shape.cc +++ b/source/blender/draw/engines/overlay/overlay_next_shape.cc @@ -272,7 +272,7 @@ static void append_line_loop( const int step = dashed ? 2 : 1; for (const int i : IndexRange(verts.size() / step)) { for (const int j : IndexRange(2)) { - const float2 &cv = verts[(i * step + j) % (verts.size())]; + const float2 &cv = verts[(i * step + j) % verts.size()]; dest.append({{cv[0], cv[1], z}, flag}); } } diff --git a/source/blender/editors/animation/anim_filter.cc b/source/blender/editors/animation/anim_filter.cc index b31241a00e6..403c406b9a9 100644 --- a/source/blender/editors/animation/anim_filter.cc +++ b/source/blender/editors/animation/anim_filter.cc @@ -3236,7 +3236,7 @@ static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, } /* grease pencil */ - if ((ELEM(ob->type, OB_GREASE_PENCIL, OB_GPENCIL_LEGACY)) && (ob->data) && + if (ELEM(ob->type, OB_GREASE_PENCIL, OB_GPENCIL_LEGACY) && (ob->data) && !(ads_filterflag & ADS_FILTER_NOGPENCIL)) { if (ob->type == OB_GREASE_PENCIL) { diff --git a/source/blender/editors/gpencil_legacy/gpencil_edit.cc b/source/blender/editors/gpencil_legacy/gpencil_edit.cc index 128f4f8fa51..87956909abe 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_edit.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_edit.cc @@ -339,7 +339,7 @@ static bool gpencil_paintmode_toggle_poll(bContext *C) { /* if using gpencil object, use this gpd */ Object *ob = CTX_data_active_object(C); - if ((ob) && (ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL))) { + if ((ob) && ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)) { return ob->data != nullptr; } return false; @@ -627,7 +627,7 @@ static bool gpencil_weightmode_toggle_poll(bContext *C) { /* if using gpencil object, use this gpd */ Object *ob = CTX_data_active_object(C); - if ((ob) && (ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL))) { + if ((ob) && ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)) { return ob->data != nullptr; } return false; diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc index 9d4f19ab537..4d9591a83a2 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc @@ -3838,7 +3838,7 @@ static void remap_vertex_groups(bke::greasepencil::Drawing &drawing, const Map &vertex_group_map) { LISTBASE_FOREACH (bDeformGroup *, dg, &drawing.strokes_for_write().vertex_group_names) { - BLI_strncpy(dg->name, vertex_group_map.lookup(dg->name).c_str(), sizeof(dg->name)); + STRNCPY(dg->name, vertex_group_map.lookup(dg->name).c_str()); } /* Indices in vertex weights remain valid, they are local to the drawing's vertex groups. diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc index dc3273e21b3..278522a99d3 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc @@ -581,7 +581,7 @@ static const EnumPropertyItem select_similar_mode_items[] = { {int(SelectSimilarMode::VERTEX_COLOR), "VERTEX_COLOR", 0, "Vertex Color", ""}, {int(SelectSimilarMode::RADIUS), "RADIUS", 0, "Radius", ""}, {int(SelectSimilarMode::OPACITY), "OPACITY", 0, "Opacity", ""}, - {0, NULL, 0, NULL, NULL}, + {0, nullptr, 0, nullptr, nullptr}, }; template diff --git a/source/blender/editors/screen/screen_ops.cc b/source/blender/editors/screen/screen_ops.cc index 8932fbe65f3..17a9ccb607e 100644 --- a/source/blender/editors/screen/screen_ops.cc +++ b/source/blender/editors/screen/screen_ops.cc @@ -3804,7 +3804,7 @@ void static area_docking_apply(bContext *C, wmOperator *op) bool same_area = (jd->sa1 == jd->sa2); if (!(jd->dock_target == AreaDockTarget::Center)) { - eScreenAxis dir = (ELEM(jd->dock_target, AreaDockTarget::Left, AreaDockTarget::Right)) ? + eScreenAxis dir = ELEM(jd->dock_target, AreaDockTarget::Left, AreaDockTarget::Right) ? SCREEN_AXIS_V : SCREEN_AXIS_H; @@ -3992,7 +3992,7 @@ static AreaDockTarget area_docking_target(sAreaJoinData *jd, const wmEvent *even if (fac_y > 0.4f && fac_y < 0.6f) { return AreaDockTarget::Center; } - if ((float(y) > float(jd->sa2->winy) / 2.0f)) { + if (float(y) > float(jd->sa2->winy) / 2.0f) { jd->factor = area_docking_snap(1.0f - float(y) / float(jd->sa2->winy), event); return AreaDockTarget::Top; } @@ -4005,7 +4005,7 @@ static AreaDockTarget area_docking_target(sAreaJoinData *jd, const wmEvent *even if (fac_x > 0.4f && fac_x < 0.6f) { return AreaDockTarget::Center; } - if ((float(x) > float(jd->sa2->winx) / 2.0f)) { + if (float(x) > float(jd->sa2->winx) / 2.0f) { jd->factor = area_docking_snap(1.0f - float(x) / float(jd->sa2->winx), event); return AreaDockTarget::Right; } @@ -4365,8 +4365,7 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent if (dir != SCREEN_DIR_NONE) { uiItemFullO(layout, "SCREEN_OT_area_join", - (ELEM(dir, SCREEN_DIR_N, SCREEN_DIR_S)) ? IFACE_("Join Up") : - IFACE_("Join Right"), + ELEM(dir, SCREEN_DIR_N, SCREEN_DIR_S) ? IFACE_("Join Up") : IFACE_("Join Right"), ELEM(dir, SCREEN_DIR_N, SCREEN_DIR_S) ? ICON_AREA_JOIN_UP : ICON_AREA_JOIN, nullptr, WM_OP_EXEC_DEFAULT, @@ -4378,7 +4377,7 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent uiItemFullO( layout, "SCREEN_OT_area_join", - (ELEM(dir, SCREEN_DIR_N, SCREEN_DIR_S)) ? IFACE_("Join Down") : IFACE_("Join Left"), + ELEM(dir, SCREEN_DIR_N, SCREEN_DIR_S) ? IFACE_("Join Down") : IFACE_("Join Left"), ELEM(dir, SCREEN_DIR_N, SCREEN_DIR_S) ? ICON_AREA_JOIN_DOWN : ICON_AREA_JOIN_LEFT, nullptr, WM_OP_EXEC_DEFAULT, diff --git a/source/blender/editors/space_nla/nla_edit.cc b/source/blender/editors/space_nla/nla_edit.cc index 87f388098e4..0ef0fd45b35 100644 --- a/source/blender/editors/space_nla/nla_edit.cc +++ b/source/blender/editors/space_nla/nla_edit.cc @@ -1611,7 +1611,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) NlaStrip *mstrip = static_cast(nlt->strips.first); if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && - (BLI_listbase_count_is_equal_to(&mstrip->strips, 2))) + BLI_listbase_count_is_equal_to(&mstrip->strips, 2)) { /* remove this temp meta, so that we can see the strips inside */ BKE_nlastrips_clear_metas(&nlt->strips, false, true); diff --git a/source/blender/editors/space_sequencer/sequencer_add.cc b/source/blender/editors/space_sequencer/sequencer_add.cc index 7440f345a40..6fc92920ccd 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.cc +++ b/source/blender/editors/space_sequencer/sequencer_add.cc @@ -901,7 +901,7 @@ static void sequencer_add_movie_multiple_strips(bContext *C, seq_load_apply_generic_options(C, op, seq_movie); } - if ((U.sequencer_editor_flag & USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT)) { + if (U.sequencer_editor_flag & USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT) { SEQ_connect(seq_movie, seq_sound); } @@ -972,7 +972,7 @@ static bool sequencer_add_movie_single_strip(bContext *C, seq_load_apply_generic_options(C, op, seq_movie); } - if ((U.sequencer_editor_flag & USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT)) { + if (U.sequencer_editor_flag & USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT) { SEQ_connect(seq_movie, seq_sound); } diff --git a/source/blender/editors/space_view3d/view3d_navigate.cc b/source/blender/editors/space_view3d/view3d_navigate.cc index 455ce329eb1..8eff8979197 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.cc +++ b/source/blender/editors/space_view3d/view3d_navigate.cc @@ -931,7 +931,7 @@ void axis_set_view(bContext *C, else if (rv3d->persp == RV3D_CAMOB) { rv3d->persp = perspo; } - if ((rv3d->persp != orig_persp)) { + if (rv3d->persp != orig_persp) { ED_region_tag_redraw(region); } diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc index 0d4f553134e..5a9276cd86e 100644 --- a/source/blender/geometry/intern/realize_instances.cc +++ b/source/blender/geometry/intern/realize_instances.cc @@ -2363,9 +2363,9 @@ bke::GeometrySet realize_instances(bke::GeometrySet geometry_set, if (not_to_realize_set.has_instances()) { gather_info.instances.instances_components_to_merge.append( - (not_to_realize_set.get_component_for_write()).copy()); + not_to_realize_set.get_component_for_write().copy()); gather_info.instances.instances_components_transforms.append(float4x4::identity()); - gather_info.instances.attribute_fallback.append((gather_info.instances_attriubutes.size())); + gather_info.instances.attribute_fallback.append(gather_info.instances_attriubutes.size()); } const float4x4 transform = float4x4::identity(); diff --git a/source/blender/io/grease_pencil/intern/grease_pencil_io_export_pdf.cc b/source/blender/io/grease_pencil/intern/grease_pencil_io_export_pdf.cc index 4f311d6a268..eee0588f6eb 100644 --- a/source/blender/io/grease_pencil/intern/grease_pencil_io_export_pdf.cc +++ b/source/blender/io/grease_pencil/intern/grease_pencil_io_export_pdf.cc @@ -59,7 +59,7 @@ static bool is_selected_frame(const GreasePencil &grease_pencil, const int frame for (const bke::greasepencil::Layer *layer : grease_pencil.layers()) { if (layer->is_visible()) { const GreasePencilFrame *frame = layer->frames().lookup_ptr(frame_number); - if ((frame != nullptr) && (frame->is_selected())) { + if ((frame != nullptr) && frame->is_selected()) { return true; } } diff --git a/source/blender/modifiers/intern/MOD_grease_pencil_length.cc b/source/blender/modifiers/intern/MOD_grease_pencil_length.cc index 99f371a7d1a..090ab155353 100644 --- a/source/blender/modifiers/intern/MOD_grease_pencil_length.cc +++ b/source/blender/modifiers/intern/MOD_grease_pencil_length.cc @@ -215,7 +215,7 @@ static void deform_drawing(const ModifierData &md, float length = curves.evaluated_length_total_for_curve(curve, false); if (mmd.mode & GP_LENGTH_ABSOLUTE) { starts[curve] = -math::min(use_starts[curve], 0.0f); - ends[curve] = length - (-math::min(use_ends[curve], 0.0f)); + ends[curve] = length - -math::min(use_ends[curve], 0.0f); } else { starts[curve] = -math::min(use_starts[curve], 0.0f) * length; diff --git a/source/blender/modifiers/intern/MOD_lineart.cc b/source/blender/modifiers/intern/MOD_lineart.cc index 4e65c81475b..bd32e87619e 100644 --- a/source/blender/modifiers/intern/MOD_lineart.cc +++ b/source/blender/modifiers/intern/MOD_lineart.cc @@ -780,7 +780,7 @@ static void generate_strokes(ModifierData &md, lmd.flags, lmd.calculation_flags); - if ((!(lmd.flags & MOD_LINEART_USE_CACHE)) && (&first_lineart != &lmd)) { + if (!(lmd.flags & MOD_LINEART_USE_CACHE) && (&first_lineart != &lmd)) { /* Clear local cache. */ if (local_lc != first_lineart.shared_cache) { MOD_lineart_clear_cache(&local_lc); diff --git a/source/blender/shader_fx/intern/FX_ui_common.cc b/source/blender/shader_fx/intern/FX_ui_common.cc index 29f108da38b..856c4ef17e0 100644 --- a/source/blender/shader_fx/intern/FX_ui_common.cc +++ b/source/blender/shader_fx/intern/FX_ui_common.cc @@ -216,7 +216,7 @@ static bool shaderfx_ui_poll(const bContext *C, PanelType * /*pt*/) { Object *ob = blender::ed::object::context_active_object(C); - return (ob != nullptr) && (ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)); + return (ob != nullptr) && ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL); } PanelType *shaderfx_panel_register(ARegionType *region_type, ShaderFxType type, PanelDrawFn draw) diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc index f73733ef5b7..095a3f25ad9 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc @@ -194,7 +194,7 @@ void WM_gizmo_unlink(ListBase *gizmolist, wmGizmoMap *gzmap, wmGizmo *gz, bConte wmGizmoOpElem *WM_gizmo_operator_get(wmGizmo *gz, int part_index) { - if (((part_index >= 0) && (part_index < gz->op_data.size()))) { + if ((part_index >= 0) && (part_index < gz->op_data.size())) { return &gz->op_data[part_index]; } return nullptr;