Cleanup: remove redundant parenthesis
This commit is contained in:
parent
2609ca2b8e
commit
f086cf3cea
|
@ -2245,13 +2245,13 @@ static void dynamic_paint_create_uv_surface_direct_cb(void *__restrict userdata,
|
|||
* A pixel middle sample isn't enough to find very narrow polygons
|
||||
* So using 4 samples of each corner too
|
||||
*/
|
||||
point[1][0] = (float(tx)) / w;
|
||||
point[1][1] = (float(ty)) / h;
|
||||
point[1][0] = float(tx) / w;
|
||||
point[1][1] = float(ty) / h;
|
||||
|
||||
point[2][0] = (float(tx) + 1) / w;
|
||||
point[2][1] = (float(ty)) / h;
|
||||
point[2][1] = float(ty) / h;
|
||||
|
||||
point[3][0] = (float(tx)) / w;
|
||||
point[3][0] = float(tx) / w;
|
||||
point[3][1] = (float(ty) + 1) / h;
|
||||
|
||||
point[4][0] = (float(tx) + 1) / w;
|
||||
|
@ -6386,7 +6386,7 @@ int dynamicPaint_calculateFrame(
|
|||
timescale = 1.0f / (surface->substeps + 1);
|
||||
|
||||
for (st = 1; st <= surface->substeps; st++) {
|
||||
float subframe = (float(st)) / (surface->substeps + 1);
|
||||
float subframe = float(st) / (surface->substeps + 1);
|
||||
if (!dynamicPaint_doStep(depsgraph, scene, cObject, surface, timescale, subframe)) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -93,8 +93,8 @@ static CLG_LogRef LOG = {"bke.fluid"};
|
|||
|
||||
static ThreadMutex object_update_lock = BLI_MUTEX_INITIALIZER;
|
||||
|
||||
# define ADD_IF_LOWER_POS(a, b) (min_ff((a) + (b), max_ff((a), (b))))
|
||||
# define ADD_IF_LOWER_NEG(a, b) (max_ff((a) + (b), min_ff((a), (b))))
|
||||
# define ADD_IF_LOWER_POS(a, b) min_ff((a) + (b), max_ff((a), (b)))
|
||||
# define ADD_IF_LOWER_NEG(a, b) max_ff((a) + (b), min_ff((a), (b)))
|
||||
# define ADD_IF_LOWER(a, b) (((b) > 0) ? ADD_IF_LOWER_POS((a), (b)) : ADD_IF_LOWER_NEG((a), (b)))
|
||||
|
||||
bool BKE_fluid_reallocate_fluid(FluidDomainSettings *fds, int res[3], int free_old)
|
||||
|
@ -1484,7 +1484,7 @@ static void emit_from_particles_task_cb(void *__restrict userdata,
|
|||
for (int y = data->min[1]; y < data->max[1]; y++) {
|
||||
const int index = manta_get_index(
|
||||
x - bb->min[0], bb->res[0], y - bb->min[1], bb->res[1], z - bb->min[2]);
|
||||
const float ray_start[3] = {(float(x)) + 0.5f, (float(y)) + 0.5f, (float(z)) + 0.5f};
|
||||
const float ray_start[3] = {float(x) + 0.5f, float(y) + 0.5f, float(z) + 0.5f};
|
||||
|
||||
/* Find particle distance from the kdtree. */
|
||||
KDTreeNearest_3d nearest;
|
||||
|
@ -2008,7 +2008,7 @@ static void emit_from_mesh_task_cb(void *__restrict userdata,
|
|||
for (int y = data->min[1]; y < data->max[1]; y++) {
|
||||
const int index = manta_get_index(
|
||||
x - bb->min[0], bb->res[0], y - bb->min[1], bb->res[1], z - bb->min[2]);
|
||||
const float ray_start[3] = {(float(x)) + 0.5f, (float(y)) + 0.5f, (float(z)) + 0.5f};
|
||||
const float ray_start[3] = {float(x) + 0.5f, float(y) + 0.5f, float(z) + 0.5f};
|
||||
|
||||
/* Compute emission only for flow objects that produce fluid (i.e. skip outflow objects).
|
||||
* Result in bb->influence. Also computes initial velocities. Result in bb->velocity. */
|
||||
|
@ -4394,9 +4394,9 @@ float BKE_fluid_get_velocity_at(Object *ob, float position[3], float velocity[3]
|
|||
}
|
||||
|
||||
/* map pos between 0.0 - 1.0 */
|
||||
pos[0] = (pos[0] - fds->res_min[0]) / (float(fds->res[0]));
|
||||
pos[1] = (pos[1] - fds->res_min[1]) / (float(fds->res[1]));
|
||||
pos[2] = (pos[2] - fds->res_min[2]) / (float(fds->res[2]));
|
||||
pos[0] = (pos[0] - fds->res_min[0]) / float(fds->res[0]);
|
||||
pos[1] = (pos[1] - fds->res_min[1]) / float(fds->res[1]);
|
||||
pos[2] = (pos[2] - fds->res_min[2]) / float(fds->res[2]);
|
||||
|
||||
/* Check if position is outside active area. */
|
||||
if (fds->type == FLUID_DOMAIN_TYPE_GAS && fds->flags & FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN) {
|
||||
|
|
|
@ -359,10 +359,10 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba
|
|||
(*mloopuv)[1] = (v % dl->nr) / float(orco_sizeu);
|
||||
|
||||
/* cyclic correction */
|
||||
if ((ELEM(i, 1, 2)) && (*mloopuv)[0] == 0.0f) {
|
||||
if (ELEM(i, 1, 2) && (*mloopuv)[0] == 0.0f) {
|
||||
(*mloopuv)[0] = 1.0f;
|
||||
}
|
||||
if ((ELEM(i, 0, 1)) && (*mloopuv)[1] == 0.0f) {
|
||||
if (ELEM(i, 0, 1) && (*mloopuv)[1] == 0.0f) {
|
||||
(*mloopuv)[1] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -919,7 +919,7 @@ static void loop_manifold_fan_around_vert_next(const Span<MLoop> loops,
|
|||
const uint vert_fan_next = loops[*r_mlfan_curr_index].v;
|
||||
const MPoly &mpfan_next = polys[*r_mpfan_curr_index];
|
||||
if ((vert_fan_orig == vert_fan_next && vert_fan_orig == mv_pivot_index) ||
|
||||
(!ELEM(vert_fan_orig, vert_fan_next, mv_pivot_index))) {
|
||||
!ELEM(vert_fan_orig, vert_fan_next, mv_pivot_index)) {
|
||||
/* We need the previous loop, but current one is our vertex's loop. */
|
||||
*r_mlfan_vert_index = *r_mlfan_curr_index;
|
||||
if (--(*r_mlfan_curr_index) < mpfan_next.loopstart) {
|
||||
|
|
|
@ -21,7 +21,7 @@ bool multires_reshape_assign_final_coords_from_ccg(const MultiresReshapeContext
|
|||
BKE_subdiv_ccg_key(&reshape_level_key, subdiv_ccg, reshape_context->reshape.level);
|
||||
|
||||
const int reshape_grid_size = reshape_context->reshape.grid_size;
|
||||
const float reshape_grid_size_1_inv = 1.0f / ((float(reshape_grid_size)) - 1.0f);
|
||||
const float reshape_grid_size_1_inv = 1.0f / (float(reshape_grid_size) - 1.0f);
|
||||
|
||||
int num_grids = subdiv_ccg->num_grids;
|
||||
for (int grid_index = 0; grid_index < num_grids; ++grid_index) {
|
||||
|
|
|
@ -667,7 +667,7 @@ static void foreach_grid_face_coordinate_task(void *__restrict userdata_v,
|
|||
|
||||
const MPoly *mpoly = reshape_context->base_polys;
|
||||
const int grid_size = data->grid_size;
|
||||
const float grid_size_1_inv = 1.0f / ((float(grid_size)) - 1.0f);
|
||||
const float grid_size_1_inv = 1.0f / (float(grid_size) - 1.0f);
|
||||
|
||||
const int num_corners = mpoly[face_index].totloop;
|
||||
int grid_index = reshape_context->face_start_grid_index[face_index];
|
||||
|
@ -697,7 +697,7 @@ static void foreach_grid_coordinate(const MultiresReshapeContext *reshape_contex
|
|||
ForeachGridCoordinateTaskData data;
|
||||
data.reshape_context = reshape_context;
|
||||
data.grid_size = BKE_subdiv_grid_size_from_level(level);
|
||||
data.grid_size_1_inv = 1.0f / ((float(data.grid_size)) - 1.0f);
|
||||
data.grid_size_1_inv = 1.0f / (float(data.grid_size) - 1.0f);
|
||||
data.callback = callback;
|
||||
data.callback_userdata_v = userdata_v;
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2)
|
|||
*p = (void *)(intptr_t(*p) + intptr_t(1));
|
||||
}
|
||||
else {
|
||||
*p = (void *)(intptr_t(1));
|
||||
*p = (void *)intptr_t(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ static void ed_undo_step_post(bContext *C,
|
|||
Object *obact = CTX_data_active_object(C);
|
||||
if (obact && (obact->type == OB_GPENCIL)) {
|
||||
/* set cursor */
|
||||
if ((obact->mode & OB_MODE_ALL_PAINT_GPENCIL)) {
|
||||
if (obact->mode & OB_MODE_ALL_PAINT_GPENCIL) {
|
||||
ED_gpencil_toggle_brush_cursor(C, true, nullptr);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -460,7 +460,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md,
|
|||
if (!face_singularity[face]) {
|
||||
bool is_singularity = true;
|
||||
for (uint k = 0; k < orig_mpoly[face].totloop; k++) {
|
||||
if (vm[orig_mloop[(uint(orig_mpoly[face].loopstart)) + k].v] != v1) {
|
||||
if (vm[orig_mloop[uint(orig_mpoly[face].loopstart) + k].v] != v1) {
|
||||
is_singularity = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -482,7 +482,7 @@ static void wm_init_userdef(Main *bmain)
|
|||
SET_FLAG_FROM_TEST(G.f, (U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0, G_FLAG_SCRIPT_AUTOEXEC);
|
||||
}
|
||||
|
||||
MEM_CacheLimiter_set_maximum((size_t(U.memcachelimit)) * 1024 * 1024);
|
||||
MEM_CacheLimiter_set_maximum(size_t(U.memcachelimit) * 1024 * 1024);
|
||||
BKE_sound_init(bmain);
|
||||
|
||||
/* Update the temporary directory from the preferences or fallback to the system default. */
|
||||
|
|
Loading…
Reference in New Issue