From e01525cf2cba9824be33b0f43a5c34582691c4b9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 9 Apr 2024 13:52:41 +1000 Subject: [PATCH] Cleanup: remove redundant variables & assignments Co-authored-by: Sean Kim --- intern/mantaflow/intern/manta_fluid_API.cpp | 1 - source/blender/blenkernel/intern/image_save.cc | 1 - source/blender/blenkernel/intern/node_tree_update.cc | 2 +- source/blender/blenlib/intern/convexhull_2d.cc | 2 -- source/blender/editors/uvedit/uvedit_islands.cc | 3 --- source/blender/python/mathutils/mathutils_geometry.cc | 1 - source/blender/windowmanager/intern/wm_keymap.cc | 1 - 7 files changed, 1 insertion(+), 10 deletions(-) diff --git a/intern/mantaflow/intern/manta_fluid_API.cpp b/intern/mantaflow/intern/manta_fluid_API.cpp index 3f9bd5bfa7e..2121c17d2a8 100644 --- a/intern/mantaflow/intern/manta_fluid_API.cpp +++ b/intern/mantaflow/intern/manta_fluid_API.cpp @@ -19,7 +19,6 @@ MANTA *manta_init(int *res, struct FluidModifierData *fmd) void manta_free(MANTA *fluid) { delete fluid; - fluid = nullptr; } bool manta_ensure_obstacle(MANTA *fluid, struct FluidModifierData *fmd) diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index 0cc7831136c..5a7bdb6150e 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -105,7 +105,6 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, &lock); if (ibuf) { - Scene *scene = opts->scene; bool is_depth_set = false; const char *ima_colorspace = ima->colorspace_settings.name; diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc index d5252925750..fdfa985e1be 100644 --- a/source/blender/blenkernel/intern/node_tree_update.cc +++ b/source/blender/blenkernel/intern/node_tree_update.cc @@ -621,7 +621,7 @@ class NodeTreeMainUpdater { BLI_STRUCT_EQUALITY_OPERATORS_3(InternalLink, from, to, multi_input_sort_id); }; - const bNodeLink *first_non_dangling_link(const bNodeTree &ntree, + const bNodeLink *first_non_dangling_link(const bNodeTree & /*ntree*/, const Span links) const { for (const bNodeLink *link : links) { diff --git a/source/blender/blenlib/intern/convexhull_2d.cc b/source/blender/blenlib/intern/convexhull_2d.cc index a3e921d4898..28edf594edf 100644 --- a/source/blender/blenlib/intern/convexhull_2d.cc +++ b/source/blender/blenlib/intern/convexhull_2d.cc @@ -481,7 +481,6 @@ static HullAngleIter convexhull_2d_angle_iter_init(const float (*points_hull)[2] * has a `sin` of 1.0 (which must always come first). */ for (int axis = 0; axis < 2; axis++) { for (int i = 0; i < 2; i++) { - int count = 0; const int i_orig = hiter.axis[axis][i].index; int i_curr = i_orig, i_prev; /* Prevent an eternal loop (incredibly unlikely). @@ -503,7 +502,6 @@ static HullAngleIter convexhull_2d_angle_iter_init(const float (*points_hull)[2] } i_curr = i_prev; hiter.axis[axis][i].index = i_curr; - count++; } } } diff --git a/source/blender/editors/uvedit/uvedit_islands.cc b/source/blender/editors/uvedit/uvedit_islands.cc index 562b593497f..5806d24f9e6 100644 --- a/source/blender/editors/uvedit/uvedit_islands.cc +++ b/source/blender/editors/uvedit/uvedit_islands.cc @@ -152,9 +152,6 @@ int bm_mesh_calc_uv_islands(const Scene *scene, const int faces_len = group_index[i][1]; BMFace **faces = static_cast(MEM_mallocN(sizeof(*faces) * faces_len, __func__)); - float bounds_min[2], bounds_max[2]; - INIT_MINMAX2(bounds_min, bounds_max); - for (int j = 0; j < faces_len; j++) { faces[j] = BM_face_at_index(bm, groups_array[faces_start + j]); } diff --git a/source/blender/python/mathutils/mathutils_geometry.cc b/source/blender/python/mathutils/mathutils_geometry.cc index a7de379bcda..1e5785a9617 100644 --- a/source/blender/python/mathutils/mathutils_geometry.cc +++ b/source/blender/python/mathutils/mathutils_geometry.cc @@ -1320,7 +1320,6 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject * /*self*/, PyObject *po if (len_polypoints > 0) { /* don't bother adding edges as polylines */ dl = static_cast(MEM_callocN(sizeof(DispList), "poly disp")); BLI_addtail(&dispbase, dl); - dl->type = DL_INDEX3; dl->nr = len_polypoints; dl->type = DL_POLY; dl->parts = 1; /* no faces, 1 edge loop */ diff --git a/source/blender/windowmanager/intern/wm_keymap.cc b/source/blender/windowmanager/intern/wm_keymap.cc index b4e1ec976ee..c126f04cdf2 100644 --- a/source/blender/windowmanager/intern/wm_keymap.cc +++ b/source/blender/windowmanager/intern/wm_keymap.cc @@ -1980,7 +1980,6 @@ void WM_keyconfig_update_ex(wmWindowManager *wm, bool keep_properties) * * In practice both cases are quite unlikely though. */ if (U.space_data.section_active == USER_SECTION_KEYMAP) { - wmWindowManager *wm = static_cast(G_MAIN->wm.first); LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { bScreen *screen = WM_window_get_active_screen(win); LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {