From 88512646c0bafa1e31abe41025fc8d837ad77583 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 18 Nov 2020 13:30:30 +1100 Subject: Cleanup: clarify precedence of operations --- source/blender/blenkernel/intern/particle_system.c | 4 ++-- source/blender/editors/interface/interface_layout.c | 2 +- source/blender/editors/sculpt_paint/paint_mask.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 4117dfc0b23..35ff387c9a6 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1418,7 +1418,7 @@ static void integrate_particle( ParticleKey states[5]; float force[3], acceleration[3], impulse[3], dx[4][3] = ZERO_F43, dv[4][3] = ZERO_F43, oldpos[3]; - float pa_mass = (part->flag & PART_SIZEMASS ? part->mass * pa->size : part->mass); + float pa_mass = (part->flag & PART_SIZEMASS) ? (part->mass * pa->size) : part->mass; int i, steps = 1; int integrator = part->integrator; @@ -2201,7 +2201,7 @@ static void sph_integrate(ParticleSimulationData *sim, { ParticleSettings *part = sim->psys->part; // float timestep = psys_get_timestep(sim); // UNUSED - float pa_mass = part->mass * (part->flag & PART_SIZEMASS ? pa->size : 1.0f); + float pa_mass = part->mass * ((part->flag & PART_SIZEMASS) ? pa->size : 1.0f); float dtime = dfra * psys_get_timestep(sim); // int steps = 1; // UNUSED float effector_acceleration[3]; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index bd42e5db531..d61e80e6505 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -956,7 +956,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, #endif const bool is_keymapitem_ptr = RNA_struct_is_a(ptr->type, &RNA_KeyMapItem); - if ((flag & flag & UI_ITEM_R_FULL_EVENT) && !is_keymapitem_ptr) { + if ((flag & UI_ITEM_R_FULL_EVENT) && !is_keymapitem_ptr) { RNA_warning("Data is not a keymap item struct: %s. Ignoring 'full_event' option.", RNA_struct_identifier(ptr->type)); } diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 4dd7ecb09ca..11d897cf76f 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -531,7 +531,7 @@ static SculptGestureContext *sculpt_gesture_init_from_line(bContext *C, wmOperat sgcontext, line_points, plane_points, offset_plane_points); /* Calculate line plane and normal. */ - const bool flip = sgcontext->line.flip ^ !sgcontext->vc.rv3d->is_persp; + const bool flip = sgcontext->line.flip ^ (!sgcontext->vc.rv3d->is_persp); sculpt_gesture_line_plane_from_tri(sgcontext->line.true_plane, sgcontext, flip, -- cgit v1.2.3