Cleanup: remove unnecessary checks & unused assignments

This commit is contained in:
Campbell Barton
2024-04-04 10:55:13 +11:00
parent 4d84a45e7e
commit fdaaebce54
6 changed files with 4 additions and 12 deletions

View File

@@ -338,7 +338,7 @@ static int position_tail_on_spline(bSplineIKConstraint *ik_data,
}
/* Calculate the intersection point using the secant root finding method */
float x0 = 0.0f, x1 = 1.0f, x2 = 0.5f;
float x0 = 0.0f, x1 = 1.0f;
float x0_point[3], x1_point[3], start_p[3];
float epsilon = max_fff(1.0f, len_v3(head_pos), len_v3(bp->vec)) * FLT_EPSILON;
@@ -364,7 +364,7 @@ static int position_tail_on_spline(bSplineIKConstraint *ik_data,
break;
}
x2 = x1 - f_x1 * (x1 - x0) / (f_x1 - f_x0);
const float x2 = x1 - f_x1 * (x1 - x0) / (f_x1 - f_x0);
x0 = x1;
x1 = x2;
}

View File

@@ -2674,7 +2674,7 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
/* clamp to [0, 1] */
CLAMP(t0, 0.0f, 1.0f);
CLAMP(t1, 0.0f, 1.0f);
// CLAMP(t1, 0.0f, 1.0f); /* UNUSED. */
/*---test inside of tri---*/
/* plane intersection point */

View File

@@ -2824,14 +2824,13 @@ static int smooth_exec(bContext *C, wmOperator *op)
ListBase *editnurb = object_editcurve_get(obedit);
int a, a_end;
bool changed = false;
LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->bezt) {
/* duplicate the curve to use in weight calculation */
const BezTriple *bezt_orig = static_cast<const BezTriple *>(MEM_dupallocN(nu->bezt));
BezTriple *bezt;
changed = false;
bool changed = false;
/* check whether its cyclic or not, and set initial & final conditions */
if (nu->flagu & CU_NURB_CYCLIC) {

View File

@@ -1834,10 +1834,6 @@ static bool ui_selectcontext_begin(bContext *C, uiBut *but, uiSelectContextStore
int i;
PointerRNA *link;
for (i = 0, link = lb.data(); i < selctx_data->elems_len; i++, link++) {
if (i >= selctx_data->elems_len) {
break;
}
if (!UI_context_copy_to_selected_check(&ptr,
link,
prop,

View File

@@ -455,7 +455,6 @@ static ImBuf *imb_load_jp2_stream(opj_stream_t *stream,
if (image->numcomps < 3) {
r = image->comps[0].data;
a = (use_alpha) ? image->comps[1].data : nullptr;
/* Gray-scale 12bits+ */
if (use_alpha) {
@@ -508,7 +507,6 @@ static ImBuf *imb_load_jp2_stream(opj_stream_t *stream,
if (image->numcomps < 3) {
r = image->comps[0].data;
a = (use_alpha) ? image->comps[1].data : nullptr;
/* Gray-scale. */
if (use_alpha) {

View File

@@ -1550,7 +1550,6 @@ static void rna_property_override_diff_propptr(Main *bmain,
true,
nullptr);
opop->tag &= ~LIBOVERRIDE_PROP_OP_TAG_UNUSED;
BLI_assert(opop != nullptr);
}
BLI_assert(propptr_a->data == propptr_a->owner_id);