Cleanup: redundant parenthesis

This commit is contained in:
Campbell Barton 2022-10-07 22:52:53 +11:00
parent 11abeae99f
commit 331f850056
253 changed files with 597 additions and 614 deletions

View File

@ -98,7 +98,7 @@ static int blf_search(const char *name)
{
for (int i = 0; i < BLF_MAX_FONT; i++) {
const FontBLF *font = global_font[i];
if (font && (STREQ(font->name, name))) {
if (font && STREQ(font->name, name)) {
return i;
}
}
@ -226,7 +226,7 @@ void BLF_unload(const char *name)
for (int i = 0; i < BLF_MAX_FONT; i++) {
FontBLF *font = global_font[i];
if (font && (STREQ(font->name, name))) {
if (font && STREQ(font->name, name)) {
BLI_assert(font->reference_count > 0);
font->reference_count--;

View File

@ -54,7 +54,7 @@
*/
static FT_Fixed to_16dot16(double val)
{
return (FT_Fixed)(lround(val * 65536.0));
return (FT_Fixed)lround(val * 65536.0);
}
/** \} */

View File

@ -3198,7 +3198,7 @@ static void animsys_create_action_track_strip(const AnimData *adt,
* (which making new strips doesn't do due to the troublesome nature of that). */
calc_action_range(r_action_strip->act, &r_action_strip->actstart, &r_action_strip->actend, 1);
r_action_strip->start = r_action_strip->actstart;
r_action_strip->end = (IS_EQF(r_action_strip->actstart, r_action_strip->actend)) ?
r_action_strip->end = IS_EQF(r_action_strip->actstart, r_action_strip->actend) ?
(r_action_strip->actstart + 1.0f) :
(r_action_strip->actend);

View File

@ -25,7 +25,7 @@
bUserMenu *BKE_blender_user_menu_find(ListBase *lb, char space_type, const char *context)
{
LISTBASE_FOREACH (bUserMenu *, um, lb) {
if ((space_type == um->space_type) && (STREQ(context, um->context))) {
if ((space_type == um->space_type) && STREQ(context, um->context)) {
return um;
}
}

View File

@ -713,10 +713,8 @@ static bool camera_frame_fit_calc_from_data(CameraParams *params,
plane_from_point_normal_v3(plane_tx[i], co, data->plane_tx[i]);
}
if ((!isect_plane_plane_v3(
plane_tx[Y_MIN], plane_tx[Y_MAX], plane_isect_1, plane_isect_1_no)) ||
(!isect_plane_plane_v3(
plane_tx[Z_MIN], plane_tx[Z_MAX], plane_isect_2, plane_isect_2_no))) {
if (!isect_plane_plane_v3(plane_tx[Y_MIN], plane_tx[Y_MAX], plane_isect_1, plane_isect_1_no) ||
!isect_plane_plane_v3(plane_tx[Z_MIN], plane_tx[Z_MAX], plane_isect_2, plane_isect_2_no)) {
return false;
}

View File

@ -1130,7 +1130,7 @@ static void cloth_update_springs(ClothModifierData *clmd)
* because implicit solver would need reset! */
/* Activate / Deactivate existing springs */
if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) &&
if (!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED) &&
(cloth->verts[spring->ij].goal > ALMOST_ZERO)) {
spring->flags &= ~CLOTH_SPRING_FLAG_DEACTIVATE;
}

View File

@ -946,7 +946,7 @@ bool BKE_collection_has_object(Collection *collection, const Object *ob)
return false;
}
return (BLI_findptr(&collection->gobject, ob, offsetof(CollectionObject, ob)));
return BLI_findptr(&collection->gobject, ob, offsetof(CollectionObject, ob));
}
bool BKE_collection_has_object_recursive(Collection *collection, Object *ob)
@ -956,7 +956,7 @@ bool BKE_collection_has_object_recursive(Collection *collection, Object *ob)
}
const ListBase objects = BKE_collection_object_cache_get(collection);
return (BLI_findptr(&objects, ob, offsetof(Base, object)));
return BLI_findptr(&objects, ob, offsetof(Base, object));
}
bool BKE_collection_has_object_recursive_instanced(Collection *collection, Object *ob)
@ -966,7 +966,7 @@ bool BKE_collection_has_object_recursive_instanced(Collection *collection, Objec
}
const ListBase objects = BKE_collection_object_cache_instanced_get(collection);
return (BLI_findptr(&objects, ob, offsetof(Base, object)));
return BLI_findptr(&objects, ob, offsetof(Base, object));
}
static Collection *collection_next_find(Main *bmain, Scene *scene, Collection *collection)

View File

@ -1629,7 +1629,7 @@ void BKE_scopes_update(Scopes *scopes,
}
/* hmmmm */
if (!(ELEM(ibuf->channels, 3, 4))) {
if (!ELEM(ibuf->channels, 3, 4)) {
return;
}

View File

@ -634,7 +634,7 @@ ListBase CTX_data_dir_get(const bContext *C)
bool CTX_data_equals(const char *member, const char *str)
{
return (STREQ(member, str));
return STREQ(member, str);
}
bool CTX_data_dir(const char *member)

View File

@ -464,7 +464,7 @@ static std::string to_manifest(const CryptomatteLayer *layer)
else {
manifest << ",";
}
manifest << quoted(item.key) << ":\"" << (item.value.hex_encoded()) << "\"";
manifest << quoted(item.key) << ":\"" << item.value.hex_encoded() << "\"";
}
manifest << "}";
return manifest.str();

View File

@ -1935,7 +1935,7 @@ static void calc_bevel_sin_cos(
t02 = M_PI_2;
}
else {
t02 = (saacos(t02)) / 2.0f;
t02 = saacos(t02) / 2.0f;
}
t02 = sinf(t02);
@ -4085,12 +4085,12 @@ void BKE_nurb_bezt_handle_test(BezTriple *bezt,
}
if (bezt->h1 == HD_VECT) {
if ((!(flag & SEL_F1)) != (!(flag & SEL_F2))) {
if (!(flag & SEL_F1) != !(flag & SEL_F2)) {
bezt->h1 = HD_FREE;
}
}
if (bezt->h2 == HD_VECT) {
if ((!(flag & SEL_F3)) != (!(flag & SEL_F2))) {
if (!(flag & SEL_F3) != !(flag & SEL_F2)) {
bezt->h2 = HD_FREE;
}
}
@ -5101,7 +5101,7 @@ bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3])
{
ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
ListBase temp_nurb_lb = {nullptr, nullptr};
const bool is_font = (BLI_listbase_is_empty(nurb_lb)) && (cu->len != 0);
const bool is_font = BLI_listbase_is_empty(nurb_lb) && (cu->len != 0);
/* For font curves we generate temp list of splines.
*
* This is likely to be fine, this function is not supposed to be called

View File

@ -160,7 +160,7 @@ static bool calc_curve_deform(
/* Zero the axis which is not used,
* the big block of text above now applies to these 3 lines.
* The `upflag` argument may be a dummy, set so no rotation is done. */
quat_apply_track(quat, axis, (ELEM(axis, 0, 2)) ? 1 : 0);
quat_apply_track(quat, axis, ELEM(axis, 0, 2) ? 1 : 0);
vec_apply_track(cent, axis);
cent[index] = 0.0f;

View File

@ -121,7 +121,7 @@ BLI_INLINE void value_dissolve(float *r_value,
const float scale,
const bool is_log)
{
*r_value = (is_log) ? (*r_value) * (powf(MIN_WETNESS, 1.0f / (1.2f * time / scale))) :
*r_value = (is_log) ? (*r_value) * powf(MIN_WETNESS, 1.0f / (1.2f * time / scale)) :
(*r_value) - 1.0f / time * scale;
}

View File

@ -193,7 +193,7 @@ static void cage_mapped_verts_callback(void *userData,
{
CageUserData *data = static_cast<CageUserData *>(userData);
if ((index >= 0 && index < data->totvert) && (!BLI_BITMAP_TEST(data->visit_bitmap, index))) {
if ((index >= 0 && index < data->totvert) && !BLI_BITMAP_TEST(data->visit_bitmap, index)) {
BLI_BITMAP_ENABLE(data->visit_bitmap, index);
copy_v3_v3(data->cos_cage[index], co);
}

View File

@ -79,7 +79,7 @@ PartDeflect *BKE_partdeflect_new(int type)
pd->pdef_sbift = 0.2f;
pd->pdef_sboft = 0.02f;
pd->pdef_cfrict = 5.0f;
pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128;
pd->seed = ((uint)ceil(PIL_check_seconds_timer()) + 1) % 128;
pd->f_strength = 1.0f;
pd->f_damp = 1.0f;

View File

@ -333,7 +333,7 @@ static float dvar_eval_rotDiff(ChannelDriver *driver, DriverVar *dvar)
invert_qt_normalized(q1);
mul_qt_qtqt(quat, q1, q2);
angle = 2.0f * (saacos(quat[0]));
angle = 2.0f * saacos(quat[0]);
angle = fabsf(angle);
return (angle > (float)M_PI) ? (float)((2.0f * (float)M_PI) - angle) : (float)(angle);

View File

@ -2204,9 +2204,9 @@ static void adaptive_domain_adjust(
/* add to total shift */
add_v3_v3(fds->shift_f, frame_shift_f);
/* convert to integer */
total_shift[0] = (int)(floorf(fds->shift_f[0]));
total_shift[1] = (int)(floorf(fds->shift_f[1]));
total_shift[2] = (int)(floorf(fds->shift_f[2]));
total_shift[0] = (int)floorf(fds->shift_f[0]);
total_shift[1] = (int)floorf(fds->shift_f[1]);
total_shift[2] = (int)floorf(fds->shift_f[2]);
int temp_shift[3];
copy_v3_v3_int(temp_shift, fds->shift);
sub_v3_v3v3_int(new_shift, total_shift, fds->shift);

View File

@ -83,8 +83,8 @@ static void greasepencil_copy_data(Main *UNUSED(bmain),
/* Apply local layer transform to all frames. Calc the active frame is not enough
* because onion skin can use more frames. This is more slow but required here. */
if (gpl_dst->actframe != NULL) {
bool transformed = ((!is_zero_v3(gpl_dst->location)) || (!is_zero_v3(gpl_dst->rotation)) ||
(!is_one_v3(gpl_dst->scale)));
bool transformed = (!is_zero_v3(gpl_dst->location) || !is_zero_v3(gpl_dst->rotation) ||
!is_one_v3(gpl_dst->scale));
if (transformed) {
loc_eul_size_to_mat4(
gpl_dst->layer_mat, gpl_dst->location, gpl_dst->rotation, gpl_dst->scale);
@ -2013,7 +2013,7 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob,
/* Read secondary material to compare with primary material. */
ma_secondary = BKE_gpencil_material(ob, idx_secondary + 1);
if ((ma_secondary == NULL) ||
(BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary)))) {
BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary))) {
continue;
}
gp_style_primary = ma_primary->gp_style;
@ -2063,17 +2063,17 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob,
rgb_to_hsv_compat_v(col, f_hsv_b);
/* Check stroke and fill color. */
if ((!compare_ff(s_hsv_a[0], s_hsv_b[0], hue_threshold)) ||
(!compare_ff(s_hsv_a[1], s_hsv_b[1], sat_threshold)) ||
(!compare_ff(s_hsv_a[2], s_hsv_b[2], val_threshold)) ||
(!compare_ff(f_hsv_a[0], f_hsv_b[0], hue_threshold)) ||
(!compare_ff(f_hsv_a[1], f_hsv_b[1], sat_threshold)) ||
(!compare_ff(f_hsv_a[2], f_hsv_b[2], val_threshold)) ||
(!compare_ff(gp_style_primary->stroke_rgba[3],
gp_style_secondary->stroke_rgba[3],
val_threshold)) ||
(!compare_ff(
gp_style_primary->fill_rgba[3], gp_style_secondary->fill_rgba[3], val_threshold))) {
if (!compare_ff(s_hsv_a[0], s_hsv_b[0], hue_threshold) ||
!compare_ff(s_hsv_a[1], s_hsv_b[1], sat_threshold) ||
!compare_ff(s_hsv_a[2], s_hsv_b[2], val_threshold) ||
!compare_ff(f_hsv_a[0], f_hsv_b[0], hue_threshold) ||
!compare_ff(f_hsv_a[1], f_hsv_b[1], sat_threshold) ||
!compare_ff(f_hsv_a[2], f_hsv_b[2], val_threshold) ||
!compare_ff(gp_style_primary->stroke_rgba[3],
gp_style_secondary->stroke_rgba[3],
val_threshold) ||
!compare_ff(
gp_style_primary->fill_rgba[3], gp_style_secondary->fill_rgba[3], val_threshold)) {
continue;
}
@ -2337,7 +2337,7 @@ bool BKE_gpencil_from_image(
static bool gpencil_is_layer_mask(ViewLayer *view_layer, bGPdata *gpd, bGPDlayer *gpl_mask)
{
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
if ((gpl->viewlayername[0] != '\0') && (!STREQ(view_layer->name, gpl->viewlayername))) {
if ((gpl->viewlayername[0] != '\0') && !STREQ(view_layer->name, gpl->viewlayername)) {
continue;
}
@ -2412,7 +2412,7 @@ void BKE_gpencil_visible_stroke_advanced_iter(ViewLayer *view_layer,
int cfra)
{
bGPdata *gpd = (bGPdata *)ob->data;
const bool is_multiedit = (GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) && (!GPENCIL_PLAY_ON(gpd)));
const bool is_multiedit = (GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) && !GPENCIL_PLAY_ON(gpd));
const bool is_onion = do_onion && ((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0);
const bool is_drawing = (gpd->runtime.sbuffer_used > 0);
@ -2444,7 +2444,7 @@ void BKE_gpencil_visible_stroke_advanced_iter(ViewLayer *view_layer,
* generate renders, putting only selected GP layers for each View Layer.
* This is used only in final render and never in Viewport. */
if ((view_layer != NULL) && (gpl->viewlayername[0] != '\0') &&
(!STREQ(view_layer->name, gpl->viewlayername))) {
!STREQ(view_layer->name, gpl->viewlayername)) {
/* Do not skip masks when rendering the view-layer so that it can still be used to clip
* other layers. Instead set their opacity to zero. */
if (gpencil_is_layer_mask(view_layer, gpd, gpl)) {
@ -2786,8 +2786,8 @@ void BKE_gpencil_update_layer_transforms(const Depsgraph *depsgraph, Object *ob)
}
/* Calc local layer transform. Early out if we have non-animated zero transforms. */
bool transformed = ((!is_zero_v3(gpl->location)) || (!is_zero_v3(gpl->rotation)) ||
(!is_one_v3(gpl->scale)));
bool transformed = (!is_zero_v3(gpl->location) || !is_zero_v3(gpl->rotation) ||
!is_one_v3(gpl->scale));
float tmp_mat[4][4];
loc_eul_size_to_mat4(tmp_mat, gpl->location, gpl->rotation, gpl->scale);
transformed |= !equals_m4m4(gpl->layer_mat, tmp_mat);
@ -2834,7 +2834,7 @@ int BKE_gpencil_material_find_index_by_name_prefix(Object *ob, const char *name_
for (int i = 0; i < ob->totcol; i++) {
Material *ma = BKE_object_material_get(ob, i + 1);
if ((ma != NULL) && (ma->gp_style != NULL) &&
(STREQLEN(ma->id.name + 2, name_prefix, name_prefix_len))) {
STREQLEN(ma->id.name + 2, name_prefix, name_prefix_len)) {
return i;
}
}

View File

@ -722,8 +722,8 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, Scene *scene, Object *o
}
/* Only do layer transformations for non-zero or animated transforms. */
bool transformed = ((!is_zero_v3(gpl->location)) || (!is_zero_v3(gpl->rotation)) ||
(!is_one_v3(gpl->scale)));
bool transformed = (!is_zero_v3(gpl->location) || !is_zero_v3(gpl->rotation) ||
!is_one_v3(gpl->scale));
float tmp_mat[4][4];
loc_eul_size_to_mat4(tmp_mat, gpl->location, gpl->rotation, gpl->scale);
transformed |= !equals_m4m4(gpl->layer_mat, tmp_mat);
@ -752,7 +752,7 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, Scene *scene, Object *o
const bool is_curve_edit = (bool)GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd_orig);
const bool do_modifiers = (bool)((!is_multiedit) && (!is_curve_edit) &&
(ob_orig->greasepencil_modifiers.first != NULL) &&
(!GPENCIL_SIMPLIFY_MODIF(scene)));
!GPENCIL_SIMPLIFY_MODIF(scene));
if ((!do_modifiers) && (!do_parent) && (!do_transform)) {
BLI_assert(ob->data != NULL);
return;
@ -782,7 +782,7 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
const bool is_multiedit = (bool)(GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) && !is_render);
const bool do_modifiers = (bool)((!is_multiedit) && (!is_curve_edit) &&
(ob->greasepencil_modifiers.first != NULL) &&
(!GPENCIL_SIMPLIFY_MODIF(scene)));
!GPENCIL_SIMPLIFY_MODIF(scene));
if (!do_modifiers) {
return;
}

View File

@ -520,7 +520,7 @@ static bool do_add_image_extension(char *string,
}
#endif
else { // R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90 etc
if (!(BLI_path_extension_check_n(string, extension_test = ".jpg", ".jpeg", nullptr))) {
if (!BLI_path_extension_check_n(string, extension_test = ".jpg", ".jpeg", nullptr)) {
extension = extension_test;
}
}

View File

@ -824,7 +824,7 @@ bool BKE_image_render_write_exr(ReportList *reports,
/* We only store RGBA passes as half float, for
* others precision loss can be problematic. */
const bool pass_RGBA = (STR_ELEM(rp->chan_id, "RGB", "RGBA", "R", "G", "B", "A"));
const bool pass_RGBA = STR_ELEM(rp->chan_id, "RGB", "RGBA", "R", "G", "B", "A");
const bool pass_half_float = half_float && pass_RGBA;
/* Color-space conversion only happens on RGBA passes. */

View File

@ -1542,7 +1542,7 @@ static void icu_to_fcurves(ID *id,
}
/* correct values, by checking if the flag of interest is set */
if (((int)(dst->vec[1][1])) & (abp->bit)) {
if ((int)(dst->vec[1][1]) & (abp->bit)) {
dst->vec[0][1] = dst->vec[1][1] = dst->vec[2][1] = 1.0f;
}
else {

View File

@ -1282,8 +1282,8 @@ BLI_INLINE uint layer_bucket_index_from_xy(MaskRasterLayer *layer, const float x
{
BLI_assert(BLI_rctf_isect_pt_v(&layer->bounds, xy));
return ((uint)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0])) +
(((uint)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1])) * layer->buckets_x);
return (uint)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0]) +
((uint)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1]) * layer->buckets_x);
}
static float layer_bucket_depth_from_xy(MaskRasterLayer *layer, const float xy[2])

View File

@ -297,7 +297,7 @@ bool BKE_mball_is_basis(const Object *ob)
/* Just a quick test. */
const int len = strlen(ob->id.name);
return (!isdigit(ob->id.name[len - 1]));
return !isdigit(ob->id.name[len - 1]);
}
bool BKE_mball_is_same_group(const Object *ob1, const Object *ob2)

View File

@ -431,8 +431,7 @@ NlaStrip *BKE_nlastrip_new(bAction *act)
BKE_action_get_frame_range(strip->act, &strip->actstart, &strip->actend);
strip->start = strip->actstart;
strip->end = (IS_EQF(strip->actstart, strip->actend)) ? (strip->actstart + 1.0f) :
(strip->actend);
strip->end = IS_EQF(strip->actstart, strip->actend) ? (strip->actstart + 1.0f) : strip->actend;
/* strip should be referenced as-is */
strip->scale = 1.0f;

View File

@ -3352,7 +3352,7 @@ void BKE_object_get_parent_matrix(Object *ob, Object *par, float r_parentmat[4][
case PAROBJECT: {
bool ok = false;
if (par->type == OB_CURVES_LEGACY) {
if ((((Curve *)par->data)->flag & CU_PATH) && (ob_parcurve(ob, par, tmat))) {
if ((((Curve *)par->data)->flag & CU_PATH) && ob_parcurve(ob, par, tmat)) {
ok = true;
}
}

View File

@ -55,8 +55,8 @@ static float gaussRand(RNG *rng)
float length2;
do {
x = (float)(nextfr(rng, -1, 1));
y = (float)(nextfr(rng, -1, 1));
x = (float)nextfr(rng, -1, 1);
y = (float)nextfr(rng, -1, 1);
length2 = x * x + y * y;
} while (length2 >= 1 || length2 == 0);
@ -930,40 +930,37 @@ bool BKE_ocean_init(struct Ocean *o,
case MOD_OCEAN_SPECTRUM_JONSWAP:
mul_complex_f(o->_h0[i * o->_N + j],
r1r2,
(float)(sqrt(BLI_ocean_spectrum_jonswap(o, o->_kx[i], o->_kz[j]) / 2.0f)));
mul_complex_f(
o->_h0_minus[i * o->_N + j],
r1r2,
(float)(sqrt(BLI_ocean_spectrum_jonswap(o, -o->_kx[i], -o->_kz[j]) / 2.0f)));
(float)sqrt(BLI_ocean_spectrum_jonswap(o, o->_kx[i], o->_kz[j]) / 2.0f));
mul_complex_f(o->_h0_minus[i * o->_N + j],
r1r2,
(float)sqrt(BLI_ocean_spectrum_jonswap(o, -o->_kx[i], -o->_kz[j]) / 2.0f));
break;
case MOD_OCEAN_SPECTRUM_TEXEL_MARSEN_ARSLOE:
mul_complex_f(
o->_h0[i * o->_N + j],
r1r2,
(float)(sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, o->_kx[i], o->_kz[j]) / 2.0f)));
(float)sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, o->_kx[i], o->_kz[j]) / 2.0f));
mul_complex_f(
o->_h0_minus[i * o->_N + j],
r1r2,
(float)(sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, -o->_kx[i], -o->_kz[j]) /
2.0f)));
(float)sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, -o->_kx[i], -o->_kz[j]) / 2.0f));
break;
case MOD_OCEAN_SPECTRUM_PIERSON_MOSKOWITZ:
mul_complex_f(
o->_h0[i * o->_N + j],
r1r2,
(float)(sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, o->_kx[i], o->_kz[j]) / 2.0f)));
(float)sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, o->_kx[i], o->_kz[j]) / 2.0f));
mul_complex_f(
o->_h0_minus[i * o->_N + j],
r1r2,
(float)(sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, -o->_kx[i], -o->_kz[j]) /
2.0f)));
(float)sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, -o->_kx[i], -o->_kz[j]) / 2.0f));
break;
default:
mul_complex_f(
o->_h0[i * o->_N + j], r1r2, (float)(sqrt(Ph(o, o->_kx[i], o->_kz[j]) / 2.0f)));
o->_h0[i * o->_N + j], r1r2, (float)sqrt(Ph(o, o->_kx[i], o->_kz[j]) / 2.0f));
mul_complex_f(o->_h0_minus[i * o->_N + j],
r1r2,
(float)(sqrt(Ph(o, -o->_kx[i], -o->_kz[j]) / 2.0f)));
(float)sqrt(Ph(o, -o->_kx[i], -o->_kz[j]) / 2.0f));
break;
}
}

View File

@ -2463,7 +2463,7 @@ bool do_guides(Depsgraph *depsgraph,
if (guidetime != 0.0f) {
/* curve direction */
cross_v3_v3v3(temp, eff->guide_dir, guidedir);
angle = dot_v3v3(eff->guide_dir, guidedir) / (len_v3(eff->guide_dir));
angle = dot_v3v3(eff->guide_dir, guidedir) / len_v3(eff->guide_dir);
angle = saacos(angle);
axis_angle_to_quat(rot2, temp, angle);
mul_qt_v3(rot2, vec_to_point);
@ -2988,8 +2988,7 @@ static void psys_thread_create_path(ParticleTask *task,
* pa->num, pa->fuv,
* NULL);
*/
cpa_num = (ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND)) ? pa->num :
pa->num_dmcache;
cpa_num = ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND) ? pa->num : pa->num_dmcache;
/* XXX hack to avoid messed up particle num and subsequent crash (T40733) */
if (cpa_num > ctx->sim.psmd->mesh_final->totface) {
@ -3850,7 +3849,7 @@ static void psys_face_mat(Object *ob, Mesh *mesh, ParticleData *pa, float mat[4]
MFace *mface;
const float(*orcodata)[3];
int i = (ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND)) ? pa->num : pa->num_dmcache;
int i = ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND) ? pa->num : pa->num_dmcache;
if (i == -1 || i >= mesh->totface) {
unit_m4(mat);
return;

View File

@ -1093,7 +1093,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx,
maxweight /= totarea;
}
else {
float min = 1.0f / (float)(MIN2(totelem, totpart));
float min = 1.0f / (float)MIN2(totelem, totpart);
for (i = 0; i < totelem; i++) {
element_weight[i] = min;
}

View File

@ -603,7 +603,7 @@ static void initialize_all_particles(ParticleSimulationData *sim)
* UNEXIST flag.
*/
const bool emit_from_volume_grid = (part->distr == PART_DISTR_GRID) &&
(!ELEM(part->from, PART_FROM_VERT, PART_FROM_CHILD));
!ELEM(part->from, PART_FROM_VERT, PART_FROM_CHILD);
PARTICLE_P;
LOOP_PARTICLES
{
@ -4150,17 +4150,17 @@ static bool particles_has_tracer(short parttype)
static bool particles_has_spray(short parttype)
{
return (ELEM(parttype, PART_FLUID_SPRAY, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYFOAMBUBBLE));
return ELEM(parttype, PART_FLUID_SPRAY, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYFOAMBUBBLE);
}
static bool particles_has_bubble(short parttype)
{
return (ELEM(parttype, PART_FLUID_BUBBLE, PART_FLUID_FOAMBUBBLE, PART_FLUID_SPRAYFOAMBUBBLE));
return ELEM(parttype, PART_FLUID_BUBBLE, PART_FLUID_FOAMBUBBLE, PART_FLUID_SPRAYFOAMBUBBLE);
}
static bool particles_has_foam(short parttype)
{
return (ELEM(parttype, PART_FLUID_FOAM, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYFOAMBUBBLE));
return ELEM(parttype, PART_FLUID_FOAM, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYFOAMBUBBLE);
}
static void particles_fluid_step(ParticleSimulationData *sim,

View File

@ -217,8 +217,8 @@ static void studiolight_load_solid_light(StudioLight *sl)
#undef READ_IVAL
#undef READ_FVAL
#define WRITE_FVAL(str, id, val) (BLI_dynstr_appendf(str, id " %f\n", val))
#define WRITE_IVAL(str, id, val) (BLI_dynstr_appendf(str, id " %d\n", val))
#define WRITE_FVAL(str, id, val) BLI_dynstr_appendf(str, id " %f\n", val)
#define WRITE_IVAL(str, id, val) BLI_dynstr_appendf(str, id " %d\n", val)
#define WRITE_VEC3(str, id, val) \
do { \
@ -273,7 +273,7 @@ static void direction_to_equirect(float r[2], const float dir[3])
static void equirect_to_direction(float r[3], float u, float v)
{
float phi = (-(M_PI * 2)) * u + M_PI;
float phi = -(M_PI * 2) * u + M_PI;
float theta = -M_PI * v + M_PI;
float sin_theta = sinf(theta);
r[0] = sin_theta * cosf(phi);

View File

@ -128,8 +128,8 @@ static void subdiv_ccg_alloc_elements(SubdivCCG *subdiv_ccg, Subdiv *subdiv)
subdiv_ccg->num_grids = num_grids;
subdiv_ccg->grids = static_cast<CCGElem **>(
MEM_calloc_arrayN(num_grids, sizeof(CCGElem *), "subdiv ccg grids"));
subdiv_ccg->grids_storage = static_cast<unsigned char *>(MEM_calloc_arrayN(
num_grids, (size_t(grid_area)) * element_size, "subdiv ccg grids storage"));
subdiv_ccg->grids_storage = static_cast<unsigned char *>(
MEM_calloc_arrayN(num_grids, size_t(grid_area) * element_size, "subdiv ccg grids storage"));
const size_t grid_size_in_bytes = size_t(grid_area) * element_size;
for (int grid_index = 0; grid_index < num_grids; grid_index++) {
const size_t grid_offset = grid_size_in_bytes * grid_index;

View File

@ -2660,9 +2660,9 @@ ImBuf *BKE_tracking_sample_pattern(int frame_width,
if (from_anchor) {
for (int a = 0; a < 5; a++) {
src_pixel_x[a] += (double)((track->offset[0] * frame_width) -
((int)(track->offset[0] * frame_width)));
(int)(track->offset[0] * frame_width));
src_pixel_y[a] += (double)((track->offset[1] * frame_height) -
((int)(track->offset[1] * frame_height)));
(int)(track->offset[1] * frame_height));
/* when offset is negative, rounding happens in opposite direction */
if (track->offset[0] < 0.0f) {

View File

@ -1044,7 +1044,7 @@ static bool vfont_to_curve(Object *ob,
CLAMP_MIN(maxlen, lineinfo[lnr].x_min);
if ((tb_scale.h != 0.0f) && ((-(yof - tb_scale.y)) > (tb_scale.h - linedist) - yof_scale)) {
if ((tb_scale.h != 0.0f) && (-(yof - tb_scale.y) > (tb_scale.h - linedist) - yof_scale)) {
if (cu->totbox > (curbox + 1)) {
maxlen = 0;
curbox++;
@ -1175,7 +1175,7 @@ static bool vfont_to_curve(Object *ob,
}
}
for (i = 0; i <= slen; i++) {
for (j = i; (!ELEM(mem[j], '\0', '\n')) && (chartransdata[j].dobreak == 0) && (j < slen);
for (j = i; !ELEM(mem[j], '\0', '\n') && (chartransdata[j].dobreak == 0) && (j < slen);
j++) {
/* do nothing */
}

View File

@ -80,7 +80,7 @@ static bool keycmp(const void *a, const void *b)
if (ka->case_str == 1 || kb->case_str == 1) {
return (BLI_strcasecmp(ka->arg, kb->arg) != 0);
}
return (!STREQ(ka->arg, kb->arg));
return !STREQ(ka->arg, kb->arg);
}
return BLI_ghashutil_intcmp((const void *)ka->pass, (const void *)kb->pass);
}

View File

@ -93,7 +93,7 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2)
return 1;
}
return (BLI_strcasecmp_natural(entry1->relname, entry2->relname));
return BLI_strcasecmp_natural(entry1->relname, entry2->relname);
}
struct BuildDirCtx {

View File

@ -491,7 +491,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r
* flag verts on one or both of the boxes
* as being used by checking the width or
* height of both boxes */
if (vert->tlb && vert->trb && (ELEM(box, vert->tlb, vert->trb))) {
if (vert->tlb && vert->trb && ELEM(box, vert->tlb, vert->trb)) {
if (UNLIKELY(fabsf(vert->tlb->h - vert->trb->h) < EPSILON_MERGE)) {
#ifdef USE_MERGE
# define A (vert->trb->v[TL])
@ -522,7 +522,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r
vert->tlb->v[TR]->free &= ~(TRF | BRF);
}
}
else if (vert->blb && vert->brb && (ELEM(box, vert->blb, vert->brb))) {
else if (vert->blb && vert->brb && ELEM(box, vert->blb, vert->brb)) {
if (UNLIKELY(fabsf(vert->blb->h - vert->brb->h) < EPSILON_MERGE)) {
#ifdef USE_MERGE
# define A (vert->blb->v[BR])
@ -554,7 +554,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r
}
}
/* Horizontal */
if (vert->tlb && vert->blb && (ELEM(box, vert->tlb, vert->blb))) {
if (vert->tlb && vert->blb && ELEM(box, vert->tlb, vert->blb)) {
if (UNLIKELY(fabsf(vert->tlb->w - vert->blb->w) < EPSILON_MERGE)) {
#ifdef USE_MERGE
# define A (vert->blb->v[TL])
@ -585,7 +585,7 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r
vert->tlb->v[BL]->free &= ~(BLF | BRF);
}
}
else if (vert->trb && vert->brb && (ELEM(box, vert->trb, vert->brb))) {
else if (vert->trb && vert->brb && ELEM(box, vert->trb, vert->brb)) {
if (UNLIKELY(fabsf(vert->trb->w - vert->brb->w) < EPSILON_MERGE)) {
#ifdef USE_MERGE

View File

@ -65,7 +65,7 @@ float floor_power_of_10(float f)
{
BLI_assert(!(f < 0.0f));
if (f != 0.0f) {
return 1.0f / (powf(10.0f, ceilf(log10f(1.0f / f))));
return 1.0f / powf(10.0f, ceilf(log10f(1.0f / f)));
}
return 0.0f;
}
@ -74,7 +74,7 @@ float ceil_power_of_10(float f)
{
BLI_assert(!(f < 0.0f));
if (f != 0.0f) {
return 1.0f / (powf(10.0f, floorf(log10f(1.0f / f))));
return 1.0f / powf(10.0f, floorf(log10f(1.0f / f)));
}
return 0.0f;
}

View File

@ -368,9 +368,9 @@ uint rgb_to_cpack(float r, float g, float b)
void cpack_to_rgb(uint col, float *r_r, float *r_g, float *r_b)
{
*r_r = ((float)(col & 0xFF)) * (1.0f / 255.0f);
*r_g = ((float)((col >> 8) & 0xFF)) * (1.0f / 255.0f);
*r_b = ((float)((col >> 16) & 0xFF)) * (1.0f / 255.0f);
*r_r = (float)(col & 0xFF) * (1.0f / 255.0f);
*r_g = (float)((col >> 8) & 0xFF) * (1.0f / 255.0f);
*r_b = (float)((col >> 16) & 0xFF) * (1.0f / 255.0f);
}
void rgb_uchar_to_float(float r_col[3], const uchar col_ub[3])

View File

@ -2748,7 +2748,7 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
edotv = dot_v3v3(e1, vel);
edotbv = dot_v3v3(e1, bv);
a = elen2 * (-dot_v3v3(vel, vel)) + edotv * edotv;
a = elen2 * -dot_v3v3(vel, vel) + edotv * edotv;
b = 2.0f * (elen2 * dot_v3v3(vel, bv) - edotv * edotbv);
c = elen2 * (radius2 - dot_v3v3(bv, bv)) + edotbv * edotbv;
@ -2770,7 +2770,7 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
edotv = dot_v3v3(e2, vel);
edotbv = dot_v3v3(e2, bv);
a = elen2 * (-dot_v3v3(vel, vel)) + edotv * edotv;
a = elen2 * -dot_v3v3(vel, vel) + edotv * edotv;
b = 2.0f * (elen2 * dot_v3v3(vel, bv) - edotv * edotbv);
c = elen2 * (radius2 - dot_v3v3(bv, bv)) + edotbv * edotbv;
@ -2797,7 +2797,7 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
edotv = dot_v3v3(e3, vel);
edotbv = dot_v3v3(e3, bv);
a = elen2 * (-dot_v3v3(vel, vel)) + edotv * edotv;
a = elen2 * -dot_v3v3(vel, vel) + edotv * edotv;
b = 2.0f * (elen2 * dot_v3v3(vel, bv) - edotv * edotbv);
c = elen2 * (radius2 - dot_v3v3(bv, bv)) + edotbv * edotbv;

View File

@ -624,10 +624,10 @@ void BLI_ewa_filter(const int width,
U0 = uv[0] * (float)width;
V0 = uv[1] * (float)height;
u1 = (int)(floorf(U0 - ue));
u2 = (int)(ceilf(U0 + ue));
v1 = (int)(floorf(V0 - ve));
v2 = (int)(ceilf(V0 + ve));
u1 = (int)floorf(U0 - ue);
u2 = (int)ceilf(U0 + ue);
v1 = (int)floorf(V0 - ve);
v2 = (int)ceilf(V0 + ve);
/* sane clamping to avoid unnecessarily huge loops */
/* NOTE: if eccentricity gets clamped (see above),

View File

@ -2360,8 +2360,8 @@ bool mat3_from_axis_conversion(
value = ((src_forward << (0 * 3)) | (src_up << (1 * 3)) | (dst_forward << (2 * 3)) |
(dst_up << (3 * 3)));
for (uint i = 0; i < (ARRAY_SIZE(_axis_convert_matrix)); i++) {
for (uint j = 0; j < (ARRAY_SIZE(*_axis_convert_lut)); j++) {
for (uint i = 0; i < ARRAY_SIZE(_axis_convert_matrix); i++) {
for (uint j = 0; j < ARRAY_SIZE(*_axis_convert_lut); j++) {
if (_axis_convert_lut[i][j] == value) {
copy_m3_m3(r_mat, _axis_convert_matrix[i]);
return true;

View File

@ -499,7 +499,7 @@ float angle_signed_on_axis_v3v3_v3(const float v1[3], const float v2[3], const f
/* calculate the sign (reuse 'tproj') */
cross_v3_v3v3(tproj, v2_proj, v1_proj);
if (dot_v3v3(tproj, axis) < 0.0f) {
angle = ((float)(M_PI * 2.0)) - angle;
angle = (float)(M_PI * 2.0) - angle;
}
return angle;

View File

@ -939,9 +939,9 @@ void BLI_noise_voronoi(float x, float y, float z, float *da, float *pa, float me
break;
}
int xi = (int)(floor(x));
int yi = (int)(floor(y));
int zi = (int)(floor(z));
int xi = (int)floor(x);
int yi = (int)floor(y);
int zi = (int)floor(z);
da[0] = da[1] = da[2] = da[3] = 1e10f;
for (int xx = xi - 1; xx <= xi + 1; xx++) {
for (int yy = yi - 1; yy <= yi + 1; yy++) {
@ -1112,9 +1112,9 @@ static float BLI_cellNoiseU(float x, float y, float z)
y = (y + 0.000001f) * 1.00001f;
z = (z + 0.000001f) * 1.00001f;
int xi = (int)(floor(x));
int yi = (int)(floor(y));
int zi = (int)(floor(z));
int xi = (int)floor(x);
int yi = (int)floor(y);
int zi = (int)floor(z);
uint n = xi + yi * 1301 + zi * 314159;
n ^= (n << 13);
return ((float)(n * (n * n * 15731 + 789221) + 1376312589) / 4294967296.0f);
@ -1132,9 +1132,9 @@ void BLI_noise_cell_v3(float x, float y, float z, float r_ca[3])
y = (y + 0.000001f) * 1.00001f;
z = (z + 0.000001f) * 1.00001f;
int xi = (int)(floor(x));
int yi = (int)(floor(y));
int zi = (int)(floor(z));
int xi = (int)floor(x);
int yi = (int)floor(y);
int zi = (int)floor(z);
const float *p = HASHPNT(xi, yi, zi);
r_ca[0] = p[0];
r_ca[1] = p[1];

View File

@ -1347,7 +1347,7 @@ bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext)
ssize_t a;
/* first check the extension is already there */
if ((ext_len <= path_len) && (STREQ(path + (path_len - ext_len), ext))) {
if ((ext_len <= path_len) && STREQ(path + (path_len - ext_len), ext)) {
return true;
}

View File

@ -373,12 +373,12 @@ static bool kdtree2d_isect_tri_recursive(const struct KDTree2D *tree,
# define KDTREE2D_ISECT_TRI_RECURSE_NEG \
(((node->neg != KDNODE_UNSET) && (co[node->axis] >= bounds[node->axis].min)) && \
(kdtree2d_isect_tri_recursive( \
tree, tri_index, tri_coords, tri_center, bounds, &tree->nodes[node->neg])))
kdtree2d_isect_tri_recursive( \
tree, tri_index, tri_coords, tri_center, bounds, &tree->nodes[node->neg]))
# define KDTREE2D_ISECT_TRI_RECURSE_POS \
(((node->pos != KDNODE_UNSET) && (co[node->axis] <= bounds[node->axis].max)) && \
(kdtree2d_isect_tri_recursive( \
tree, tri_index, tri_coords, tri_center, bounds, &tree->nodes[node->pos])))
kdtree2d_isect_tri_recursive( \
tree, tri_index, tri_coords, tri_center, bounds, &tree->nodes[node->pos]))
if (tri_center[node->axis] > co[node->axis]) {
if (KDTREE2D_ISECT_TRI_RECURSE_POS) {

View File

@ -314,7 +314,7 @@ size_t BLI_str_unescape_ex(char *__restrict dst,
break;
}
char c = *src;
if (UNLIKELY(c == '\\') && (str_unescape_pair(*(src + 1), &c))) {
if (UNLIKELY(c == '\\') && str_unescape_pair(*(src + 1), &c)) {
src++;
}
dst[len++] = c;
@ -329,7 +329,7 @@ size_t BLI_str_unescape(char *__restrict dst, const char *__restrict src, const
size_t len = 0;
for (const char *src_end = src + src_maxncpy; (src < src_end) && *src; src++) {
char c = *src;
if (UNLIKELY(c == '\\') && (str_unescape_pair(*(src + 1), &c))) {
if (UNLIKELY(c == '\\') && str_unescape_pair(*(src + 1), &c)) {
src++;
}
dst[len++] = c;

View File

@ -176,7 +176,7 @@ size_t BLI_timecode_string_from_time_simple(char *str,
const int hr = ((int)time_seconds) / (60 * 60);
const int min = (((int)time_seconds) / 60) % 60;
const int sec = ((int)time_seconds) % 60;
const int hun = ((int)(fmod(time_seconds, 1.0) * 100));
const int hun = (int)(fmod(time_seconds, 1.0) * 100);
if (hr) {
rlen = BLI_snprintf_rlen(str, maxncpy, "%.2d:%.2d:%.2d.%.2d", hr, min, sec, hun);

View File

@ -130,7 +130,7 @@ TEST(linear_allocator, ManyAllocations)
RandomNumberGenerator rng;
for (int i = 0; i < 1000; i++) {
int size = rng.get_int32(10000);
int alignment = 1 << (rng.get_int32(7));
int alignment = 1 << rng.get_int32(7);
void *buffer = allocator.allocate(size, alignment);
EXPECT_NE(buffer, nullptr);
}

View File

@ -1112,7 +1112,7 @@ static int *read_file_thumbnail(FileData *fd)
const bool do_endian_swap = (fd->flags & FD_FLAGS_SWITCH_ENDIAN) != 0;
int *data = (int *)(bhead + 1);
if (bhead->len < (sizeof(int[2]))) {
if (bhead->len < sizeof(int[2])) {
break;
}

View File

@ -595,7 +595,7 @@ static void do_versions_fix_annotations(bGPdata *gpd)
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
if ((gps->colorname[0] != '\0') && (STREQ(gps->colorname, palcolor->info))) {
if ((gps->colorname[0] != '\0') && STREQ(gps->colorname, palcolor->info)) {
/* copy color settings */
copy_v4_v4(gpl->color, palcolor->color);
}

View File

@ -1611,8 +1611,8 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
if ((!MAIN_VERSION_ATLEAST(bmain, 292, 14)) ||
((bmain->versionfile == 293) && (!MAIN_VERSION_ATLEAST(bmain, 293, 1)))) {
if (!MAIN_VERSION_ATLEAST(bmain, 292, 14) ||
((bmain->versionfile == 293) && !MAIN_VERSION_ATLEAST(bmain, 293, 1))) {
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type != NTREE_GEOMETRY) {
continue;

View File

@ -1194,7 +1194,7 @@ static void update_voronoi_node_square_distance(bNodeTree *ntree)
NodeTexVoronoi *tex = (NodeTexVoronoi *)node->storage;
bNodeSocket *sockDistance = nodeFindSocket(node, SOCK_OUT, "Distance");
if (tex->distance == SHD_VORONOI_EUCLIDEAN &&
(ELEM(tex->feature, SHD_VORONOI_F1, SHD_VORONOI_F2)) && socket_is_used(sockDistance)) {
ELEM(tex->feature, SHD_VORONOI_F1, SHD_VORONOI_F2) && socket_is_used(sockDistance)) {
bNode *multiplyNode = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH);
multiplyNode->custom1 = NODE_MATH_MULTIPLY;
multiplyNode->locx = node->locx + node->width + 20.0f;

View File

@ -2531,7 +2531,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Object *ob;
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
if (ob->pd) {
ob->pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128;
ob->pd->seed = ((uint)ceil(PIL_check_seconds_timer()) + 1) % 128;
}
}
}

View File

@ -1780,7 +1780,7 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
/* Note that we only handle unselected neighbor vertices here, main loop will take care of
* selected ones. */
if ((!BM_elem_flag_test(l->prev->v, BM_ELEM_SELECT)) &&
if (!BM_elem_flag_test(l->prev->v, BM_ELEM_SELECT) &&
!BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v))) {
BMLoop *l_prev;
@ -1791,7 +1791,7 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
BLI_BITMAP_ENABLE(done_verts, BM_elem_index_get(l_prev->v));
}
if ((!BM_elem_flag_test(l->next->v, BM_ELEM_SELECT)) &&
if (!BM_elem_flag_test(l->next->v, BM_ELEM_SELECT) &&
!BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v))) {
BMLoop *l_next;

View File

@ -52,7 +52,7 @@
#define GROW(len_alloc) ((len_alloc) + ((len_alloc) - ((len_alloc) / 2)))
#define GROW_ARRAY(mem, len_alloc) \
{ \
mem = MEM_reallocN(mem, (sizeof(*mem)) * ((len_alloc) = GROW(len_alloc))); \
mem = MEM_reallocN(mem, sizeof(*mem) * ((len_alloc) = GROW(len_alloc))); \
} \
((void)0)

View File

@ -62,7 +62,7 @@ bool BM_disk_dissolve(BMesh *bm, BMVert *v)
e = v->e;
do {
e = bmesh_disk_edge_next(e, v);
if (!(BM_edge_share_face_check(e, v->e))) {
if (!BM_edge_share_face_check(e, v->e)) {
keepedge = e;
baseedge = v->e;
break;

View File

@ -721,7 +721,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
(use_boundary && BM_edge_is_boundary(e) && BM_elem_flag_test(e->l->f, BM_ELEM_TAG)) ||
/* tag if edge is an interior edge in between a tagged and untagged face */
(bm_edge_is_mixed_face_tag(e->l))) {
bm_edge_is_mixed_face_tag(e->l)) {
/* tag */
BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
BM_elem_flag_enable(e->v2, BM_ELEM_TAG);

View File

@ -43,11 +43,11 @@ static float quad_calc_error(const float v1[3],
normal_tri_v3(n1, v1, v2, v3);
normal_tri_v3(n2, v1, v3, v4);
angle_a = (compare_v3v3(n1, n2, FLT_EPSILON)) ? 0.0f : angle_normalized_v3v3(n1, n2);
angle_a = compare_v3v3(n1, n2, FLT_EPSILON) ? 0.0f : angle_normalized_v3v3(n1, n2);
normal_tri_v3(n1, v2, v3, v4);
normal_tri_v3(n2, v4, v1, v2);
angle_b = (compare_v3v3(n1, n2, FLT_EPSILON)) ? 0.0f : angle_normalized_v3v3(n1, n2);
angle_b = compare_v3v3(n1, n2, FLT_EPSILON) ? 0.0f : angle_normalized_v3v3(n1, n2);
diff = (angle_a + angle_b) / (float)(M_PI * 2);
@ -166,15 +166,15 @@ static float bm_edge_is_delimit(const BMEdge *e, const struct DelimitData *delim
float angle;
#endif
if ((delimit_data->do_seam) && (BM_elem_flag_test(e, BM_ELEM_SEAM))) {
if (delimit_data->do_seam && BM_elem_flag_test(e, BM_ELEM_SEAM)) {
goto fail;
}
if ((delimit_data->do_sharp) && (BM_elem_flag_test(e, BM_ELEM_SMOOTH) == 0)) {
if (delimit_data->do_sharp && (BM_elem_flag_test(e, BM_ELEM_SMOOTH) == 0)) {
goto fail;
}
if ((delimit_data->do_mat) && (f_a->mat_nr != f_b->mat_nr)) {
if (delimit_data->do_mat && (f_a->mat_nr != f_b->mat_nr)) {
goto fail;
}

View File

@ -4697,7 +4697,7 @@ static VMesh *pipe_adj_vmesh(BevelParams *bp, BevVert *bv, BoundVert *vpipe)
* vertices to snap to the midline on the pipe, not just to one plane or the other. */
bool even = (ns % 2) == 0;
bool midline = even && k == half_ns &&
((i == 0 && j == half_ns) || (ELEM(i, ipipe1, ipipe2)));
((i == 0 && j == half_ns) || ELEM(i, ipipe1, ipipe2));
snap_to_pipe_profile(vpipe, midline, mesh_vert(vm, i, j, k)->co);
}
}
@ -5376,7 +5376,7 @@ static void bevel_build_rings(BevelParams *bp, BMesh *bm, BevVert *bv, BoundVert
for (int i = 0; i < n_bndv; i++) {
for (int j = 0; j <= ns2; j++) {
for (int k = 0; k <= ns; k++) {
if (j == 0 && (ELEM(k, 0, ns))) {
if (j == 0 && ELEM(k, 0, ns)) {
continue; /* Boundary corners already made. */
}
if (!is_canon(vm, i, j, k)) {

View File

@ -463,7 +463,7 @@ void BM_mesh_bisect_plane(BMesh *bm,
}
vert_is_center_disable(v);
BM_VERT_DIR(v) = plane_point_test_v3(plane, v->co, eps, &(BM_VERT_DIST(v)));
BM_VERT_DIR(v) = plane_point_test_v3(plane, v->co, eps, &BM_VERT_DIST(v));
if (BM_VERT_DIR(v) == 0) {
if (oflag_center) {

View File

@ -618,9 +618,9 @@ static void bm_decim_triangulate_end(BMesh *bm, const int edges_tri_tot)
(BM_loop_is_manifold(l) && ((l)->v != (l)->radial_next->v) && \
(l_a_index == BM_elem_index_get(l)) && (l_a_index == BM_elem_index_get((l)->radial_next)))
if ((l_a->f->len == 3 && l_b->f->len == 3) && (!CAN_LOOP_MERGE(l_a->next)) &&
(!CAN_LOOP_MERGE(l_a->prev)) && (!CAN_LOOP_MERGE(l_b->next)) &&
(!CAN_LOOP_MERGE(l_b->prev))) {
if ((l_a->f->len == 3 && l_b->f->len == 3) && !CAN_LOOP_MERGE(l_a->next) &&
!CAN_LOOP_MERGE(l_a->prev) && !CAN_LOOP_MERGE(l_b->next) &&
!CAN_LOOP_MERGE(l_b->prev)) {
BMVert *vquad[4] = {
e->v1,
BM_vert_in_edge(e, l_a->next->v) ? l_a->prev->v : l_a->next->v,

View File

@ -37,7 +37,7 @@ enum {
*/
static bool bm_edge_step_ok(BMEdge *e)
{
return BM_elem_flag_test(e, BM_ELEM_TAG) && (ELEM(e->l, NULL, e->l->radial_next));
return BM_elem_flag_test(e, BM_ELEM_TAG) && ELEM(e->l, NULL, e->l->radial_next);
}
static int bm_edge_face(BMEdge *e)

View File

@ -1263,7 +1263,7 @@ bool BM_mesh_intersect(BMesh *bm,
/* only start on an edge-case */
/* pass */
}
else if ((!BM_elem_flag_test(v_a, BM_ELEM_TAG)) && (!BM_elem_flag_test(v_b, BM_ELEM_TAG))) {
else if (!BM_elem_flag_test(v_a, BM_ELEM_TAG) && !BM_elem_flag_test(v_b, BM_ELEM_TAG)) {
/* simple case, single edge spans face */
BMVert **splice_pair;
BM_elem_flag_enable(e_pair[1], BM_ELEM_TAG);

View File

@ -231,7 +231,7 @@ static void edgetag_add_adjacent(HeapSimple *heap,
BM_ITER_ELEM (v, &viter, e_a, BM_VERTS_OF_EDGE) {
/* Don't walk over previous vertex. */
if ((edges_prev[e_a_index]) && (BM_vert_in_edge(edges_prev[e_a_index], v))) {
if ((edges_prev[e_a_index]) && BM_vert_in_edge(edges_prev[e_a_index], v)) {
continue;
}

View File

@ -354,7 +354,7 @@ struct LinkNode *BM_mesh_calc_path_uv_edge(BMesh *bm,
while (!BLI_heapsimple_is_empty(heap)) {
l = BLI_heapsimple_pop_min(heap);
if ((l->e == l_dst->e) && (BM_loop_uv_share_edge_check(l, l_dst, params->cd_loop_uv_offset))) {
if ((l->e == l_dst->e) && BM_loop_uv_share_edge_check(l, l_dst, params->cd_loop_uv_offset)) {
break;
}
@ -364,7 +364,7 @@ struct LinkNode *BM_mesh_calc_path_uv_edge(BMesh *bm,
}
}
if ((l->e == l_dst->e) && (BM_loop_uv_share_edge_check(l, l_dst, params->cd_loop_uv_offset))) {
if ((l->e == l_dst->e) && BM_loop_uv_share_edge_check(l, l_dst, params->cd_loop_uv_offset)) {
do {
BLI_linklist_prepend(&path, l);
} while ((l = loops_prev[BM_elem_index_get(l)]));

View File

@ -510,7 +510,7 @@ static void bm_uuidwalk_pass_add(UUIDWalk *uuidwalk,
do {
if (!BLI_ghash_haskey(uuidwalk->faces_uuid, l_iter_radial->f) &&
!BLI_gset_haskey(faces_step_next, l_iter_radial->f) &&
(bm_uuidwalk_face_test(uuidwalk, l_iter_radial->f))) {
bm_uuidwalk_face_test(uuidwalk, l_iter_radial->f)) {
BLI_gset_insert(faces_step_next, l_iter_radial->f);
/* add to fstep */

View File

@ -53,10 +53,10 @@ Node::Node(bNode *editor_node, bool create_sockets)
Node::~Node()
{
while (!outputs_.is_empty()) {
delete (outputs_.pop_last());
delete outputs_.pop_last();
}
while (!inputs_.is_empty()) {
delete (inputs_.pop_last());
delete inputs_.pop_last();
}
}

View File

@ -576,7 +576,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
/* try to find existing write buffer operation */
if (target->get_operation().get_flags().is_write_buffer_operation) {
BLI_assert(write_operation == nullptr); /* there should only be one write op connected */
write_operation = (WriteBufferOperation *)(&target->get_operation());
write_operation = (WriteBufferOperation *)&target->get_operation();
}
else {
/* remove all links to other nodes */

View File

@ -191,7 +191,7 @@ bool check_id_has_anim_component(ID *id)
if (adt == nullptr) {
return false;
}
return (adt->action != nullptr) || (!BLI_listbase_is_empty(&adt->nla_tracks));
return (adt->action != nullptr) || !BLI_listbase_is_empty(&adt->nla_tracks);
}
bool check_id_has_driver_component(ID *id)

View File

@ -29,7 +29,7 @@ static struct {
#define SETUP_BUFFER(tex, fb, fb_color) \
{ \
eGPUTextureFormat format = (DRW_state_is_scene_render()) ? GPU_RGBA32F : GPU_RGBA16F; \
eGPUTextureFormat format = DRW_state_is_scene_render() ? GPU_RGBA32F : GPU_RGBA16F; \
DRW_texture_ensure_fullscreen_2d(&tex, format, DRW_TEX_FILTER); \
GPU_framebuffer_ensure_config(&fb, \
{ \

View File

@ -158,7 +158,7 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
if (DRW_view_is_persp_get(NULL)) {
float sample_distribution = scene_eval->eevee.volumetric_sample_distribution;
sample_distribution = 4.0f * (max_ff(1.0f - sample_distribution, 1e-2f));
sample_distribution = 4.0f * max_ff(1.0f - sample_distribution, 1e-2f);
const float clip_start = DRW_view_near_distance_get(NULL);
/* Negate */

View File

@ -141,8 +141,8 @@ void MotionBlurModule::sync()
{
/* Create max velocity tiles. */
PassSimple::Sub &sub = motion_blur_ps_.sub("TilesFlatten");
eShaderType shader = (inst_.is_viewport()) ? MOTION_BLUR_TILE_FLATTEN_VIEWPORT :
MOTION_BLUR_TILE_FLATTEN_RENDER;
eShaderType shader = inst_.is_viewport() ? MOTION_BLUR_TILE_FLATTEN_VIEWPORT :
MOTION_BLUR_TILE_FLATTEN_RENDER;
sub.shader_set(inst_.shaders.static_shader_get(shader));
sub.bind_ubo("motion_blur_buf", data_);
sub.bind_texture("depth_tx", &render_buffers.depth_tx);

View File

@ -1552,7 +1552,7 @@ void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob)
/* Don't show fluid domain overlay extras outside of cache range. */
const bool draw_volume = !from_dupli &&
(md = BKE_modifiers_findby_type(ob, eModifierType_Fluid)) &&
(BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime)) &&
BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime) &&
(((FluidModifierData *)md)->domain != nullptr) &&
(scene->r.cfra >=
(((FluidModifierData *)md)->domain->cache_frame_start)) &&

View File

@ -2423,7 +2423,7 @@ static float x_axis_name[4][2] = {
{-0.9f * S_X, 1.0f * S_Y},
{1.0f * S_X, -1.0f * S_Y},
};
#define X_LEN (sizeof(x_axis_name) / (sizeof(float[2])))
#define X_LEN (sizeof(x_axis_name) / sizeof(float[2]))
#undef S_X
#undef S_Y
@ -2437,7 +2437,7 @@ static float y_axis_name[6][2] = {
{0.0f * S_X, -0.1f * S_Y},
{0.0f * S_X, -1.0f * S_Y},
};
#define Y_LEN (sizeof(y_axis_name) / (sizeof(float[2])))
#define Y_LEN (sizeof(y_axis_name) / sizeof(float[2]))
#undef S_X
#undef S_Y
@ -2455,7 +2455,7 @@ static float z_axis_name[10][2] = {
{-1.00f * S_X, -1.00f * S_Y},
{1.00f * S_X, -1.00f * S_Y},
};
#define Z_LEN (sizeof(z_axis_name) / (sizeof(float[2])))
#define Z_LEN (sizeof(z_axis_name) / sizeof(float[2]))
#undef S_X
#undef S_Y
@ -2482,7 +2482,7 @@ static float axis_marker[8][2] = {
{-S_X, 0.0f}
#endif
};
#define MARKER_LEN (sizeof(axis_marker) / (sizeof(float[2])))
#define MARKER_LEN (sizeof(axis_marker) / sizeof(float[2]))
#define MARKER_FILL_LAYER 6
#undef S_X
#undef S_Y

View File

@ -315,7 +315,7 @@ static void gpencil_buffer_add_point(gpStrokeVert *verts,
/* Encode fill opacity defined by opacity modifier in vertex color alpha. If
* no opacity modifier, the value will be always 1.0f. The opacity factor can be any
* value between 0.0f and 2.0f */
col->fcol[3] = (((int)(col->fcol[3] * 10000.0f)) * 10.0f) + gps->fill_opacity_fac;
col->fcol[3] = ((int)(col->fcol[3] * 10000.0f) * 10.0f) + gps->fill_opacity_fac;
vert->strength = (round_cap0) ? pt->strength : -pt->strength;
vert->u_stroke = pt->uv_fac;

View File

@ -367,11 +367,11 @@ static GPUIndexBuf *lattice_batch_cache_get_edges(LatticeRenderData *rdata,
#define LATT_INDEX(u, v, w) ((((w)*rdata->dims.v_len + (v)) * rdata->dims.u_len) + (u))
for (int w = 0; w < rdata->dims.w_len; w++) {
int wxt = (ELEM(w, 0, rdata->dims.w_len - 1));
int wxt = ELEM(w, 0, rdata->dims.w_len - 1);
for (int v = 0; v < rdata->dims.v_len; v++) {
int vxt = (ELEM(v, 0, rdata->dims.v_len - 1));
int vxt = ELEM(v, 0, rdata->dims.v_len - 1);
for (int u = 0; u < rdata->dims.u_len; u++) {
int uxt = (ELEM(u, 0, rdata->dims.u_len - 1));
int uxt = ELEM(u, 0, rdata->dims.u_len - 1);
if (w && ((uxt || vxt) || !rdata->show_only_outside)) {
GPU_indexbuf_add_line_verts(&elb, LATT_INDEX(u, v, w - 1), LATT_INDEX(u, v, w));

View File

@ -727,7 +727,7 @@ static void draw_subdiv_cache_update_extra_coarse_face_data(DRWSubdivCache *cach
mesh->totpoly);
}
uint32_t *flags_data = (uint32_t *)(GPU_vertbuf_get_data(cache->extra_coarse_face_data));
uint32_t *flags_data = (uint32_t *)GPU_vertbuf_get_data(cache->extra_coarse_face_data);
if (mr->extract_type == MR_EXTRACT_BMESH) {
draw_subdiv_cache_extra_coarse_face_data_bm(cache->bm, mr->efa_act, flags_data);

View File

@ -172,7 +172,7 @@ void DRW_globals_update(void)
/* M_SQRT2 to be at least the same size of the old square */
gb->size_vertex = U.pixelsize *
(max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f));
max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f);
gb->size_vertex_gpencil = U.pixelsize * UI_GetThemeValuef(TH_GP_VERTEX_SIZE);
gb->size_face_dot = U.pixelsize * UI_GetThemeValuef(TH_FACEDOT_SIZE);
gb->size_edge = U.pixelsize * (1.0f / 2.0f); /* TODO: Theme. */

View File

@ -208,7 +208,7 @@ static GPUTexture *create_volume_texture(const int dim[3],
}
else {
/* We need to resize the input. */
int channels = (ELEM(texture_format, GPU_R8, GPU_R16F, GPU_R32F)) ? 1 : 4;
int channels = ELEM(texture_format, GPU_R8, GPU_R16F, GPU_R32F) ? 1 : 4;
float *rescaled_data = rescale_3d(dim, final_dim, channels, data);
if (rescaled_data) {
GPU_texture_update_sub(tex, GPU_DATA_FLOAT, rescaled_data, 0, 0, 0, UNPACK3(final_dim));

View File

@ -1820,7 +1820,7 @@ void DRW_draw_render_loop_offscreen(struct Depsgraph *depsgraph,
GPU_matrix_identity_set();
GPU_matrix_identity_projection_set();
const bool do_overlays = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0 ||
(ELEM(v3d->shading.type, OB_WIRE, OB_SOLID)) ||
ELEM(v3d->shading.type, OB_WIRE, OB_SOLID) ||
(ELEM(v3d->shading.type, OB_MATERIAL) &&
(v3d->shading.flag & V3D_SHADING_SCENE_WORLD) == 0) ||
(ELEM(v3d->shading.type, OB_RENDER) &&

View File

@ -184,7 +184,7 @@ static DRWShadingGroup *drw_volume_object_mesh_init(Scene *scene,
/* Smoke Simulation */
if ((md = BKE_modifiers_findby_type(ob, eModifierType_Fluid)) &&
(BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime)) &&
BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime) &&
((FluidModifierData *)md)->domain != nullptr) {
FluidModifierData *fmd = (FluidModifierData *)md;
FluidDomainSettings *fds = fmd->domain;

View File

@ -1127,7 +1127,7 @@ static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id
/* Check for selected nodes. */
if (fcu->rna_path &&
(BLI_str_quoted_substr(fcu->rna_path, "nodes[", node_name, sizeof(node_name)))) {
BLI_str_quoted_substr(fcu->rna_path, "nodes[", node_name, sizeof(node_name))) {
/* Get strip name, and check if this strip is selected. */
node = nodeFindNodebyName(ntree, node_name);

View File

@ -322,8 +322,8 @@ int ANIM_add_driver_with_target(ReportList *reports,
* then use the first one */
{
/* Use the shorter of the two (to avoid out of bounds access) */
int dst_len = (RNA_property_array_check(prop)) ? RNA_property_array_length(&ptr, prop) : 1;
int src_len = (RNA_property_array_check(prop)) ? RNA_property_array_length(&ptr2, prop2) : 1;
int dst_len = RNA_property_array_check(prop) ? RNA_property_array_length(&ptr, prop) : 1;
int src_len = RNA_property_array_check(prop) ? RNA_property_array_length(&ptr2, prop2) : 1;
int len = MIN2(dst_len, src_len);
@ -347,7 +347,7 @@ int ANIM_add_driver_with_target(ReportList *reports,
case CREATEDRIVER_MAPPING_1_N: /* 1-N - Specified target index for all */
default: {
int len = (RNA_property_array_check(prop)) ? RNA_property_array_length(&ptr, prop) : 1;
int len = RNA_property_array_check(prop) ? RNA_property_array_length(&ptr, prop) : 1;
for (int i = 0; i < len; i++) {
done_tot += add_driver_with_target(reports,

View File

@ -497,7 +497,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
if (ked && (ked->iterflags & KEYFRAME_ITER_INCL_HANDLES)) { \
/* Only act on visible items, so check handle visibility state. */ \
const bool handles_visible = ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ? \
(BEZT_ISSEL_ANY(bezt)) : \
BEZT_ISSEL_ANY(bezt) : \
true); \
if (handles_visible) { \
if (check(0)) { \
@ -809,7 +809,7 @@ void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt)
static short snap_bezier_nearest(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
{
if (bezt->f2 & SELECT) {
bezt->vec[1][0] = (float)(floorf(bezt->vec[1][0] + 0.5f));
bezt->vec[1][0] = (float)floorf(bezt->vec[1][0] + 0.5f);
}
return 0;
}
@ -1494,7 +1494,7 @@ static short select_bezier_add(KeyframeEditData *ked, BezTriple *bezt)
{
/* Only act on visible items, so check handle visibility state. */
const bool handles_visible = ked && ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ?
(BEZT_ISSEL_ANY(bezt)) :
BEZT_ISSEL_ANY(bezt) :
true);
/* if we've got info on what to select, use it, otherwise select all */
@ -1520,7 +1520,7 @@ static short select_bezier_subtract(KeyframeEditData *ked, BezTriple *bezt)
{
/* Only act on visible items, so check handle visibility state. */
const bool handles_visible = ked && ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ?
(BEZT_ISSEL_ANY(bezt)) :
BEZT_ISSEL_ANY(bezt) :
true);
/* if we've got info on what to deselect, use it, otherwise deselect all */

View File

@ -151,7 +151,7 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo
* if there is a considerable distance between the points, and also if the
* current is further away than the next one is to the previous.
*/
if (beztn && (IS_EQT(cur[0], next[0], thresh)) && (IS_EQT(next[1], prev[1], thresh) == 0)) {
if (beztn && IS_EQT(cur[0], next[0], thresh) && (IS_EQT(next[1], prev[1], thresh) == 0)) {
/* only add if current is further away from previous */
if (cur[1] > next[1]) {
if (IS_EQT(cur[1], prev[1], thresh) == 0) {
@ -654,8 +654,8 @@ void sample_fcurve(FCurve *fcu)
* keyframes while sampling will affect the outcome...
* - only start sampling+adding from index=1, so that we don't overwrite original keyframe
*/
range = (int)(ceil(end->vec[1][0] - start->vec[1][0]));
sfra = (int)(floor(start->vec[1][0]));
range = (int)ceil(end->vec[1][0] - start->vec[1][0]);
sfra = (int)floor(start->vec[1][0]);
if (range) {
value_cache = MEM_callocN(sizeof(TempFrameValCache) * range, "IcuFrameValCache");

View File

@ -1180,7 +1180,7 @@ static float *get_keyframe_values(ReportList *reports,
{
float *values;
if ((flag & INSERTKEY_MATRIX) && (visualkey_can_use(&ptr, prop))) {
if ((flag & INSERTKEY_MATRIX) && visualkey_can_use(&ptr, prop)) {
/* visual-keying is only available for object and pchan datablocks, as
* it works by keyframing using a value extracted from the final matrix
* instead of using the kt system to extract a value.

View File

@ -888,7 +888,7 @@ bool ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *ks)
/* TODO: check for missing callbacks! */
/* check if it can be used in the current context */
return (ksi->poll(ksi, C));
return ksi->poll(ksi, C);
}
return true;

View File

@ -2137,7 +2137,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op)
int flag_new = extend ? EBONE_PREV_FLAG_GET(ebone) : 0;
if ((ebone_mirror = ED_armature_ebone_get_mirrored(arm->edbo, ebone)) &&
(EBONE_VISIBLE(arm, ebone_mirror))) {
EBONE_VISIBLE(arm, ebone_mirror)) {
const int flag_mirror = EBONE_PREV_FLAG_GET(ebone_mirror);
flag_new |= flag_mirror;

View File

@ -692,7 +692,7 @@ static int pose_armature_layers_showall_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C);
bArmature *arm = armature_layers_get_data(&ob);
PointerRNA ptr;
int maxLayers = (RNA_boolean_get(op->ptr, "all")) ? 32 : 16;
int maxLayers = RNA_boolean_get(op->ptr, "all") ? 32 : 16;
/* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
bool layers[32] = {false};

View File

@ -1237,7 +1237,7 @@ static int pose_select_mirror_exec(bContext *C, wmOperator *op)
int flag_new = extend ? PBONE_PREV_FLAG_GET(pchan) : 0;
if ((pchan_mirror = BKE_pose_channel_get_mirrored(ob->pose, pchan->name)) &&
(PBONE_VISIBLE(arm, pchan_mirror->bone))) {
PBONE_VISIBLE(arm, pchan_mirror->bone)) {
const int flag_mirror = PBONE_PREV_FLAG_GET(pchan_mirror);
flag_new |= flag_mirror;

View File

@ -6817,7 +6817,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
View3D *v3d = CTX_wm_view3d(C);
const Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
int clear = (STREQ(op->idname, "CURVE_OT_shade_flat"));
int clear = STREQ(op->idname, "CURVE_OT_shade_flat");
uint objects_len;
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
scene, view_layer, CTX_wm_view3d(C), &objects_len);

View File

@ -343,7 +343,7 @@ Nurb *ED_curve_add_nurbs_primitive(
bp->vec[0] += fac * grid;
fac = (float)b - 1.5f;
bp->vec[1] += fac * grid;
if ((ELEM(a, 1, 2)) && (ELEM(b, 1, 2))) {
if (ELEM(a, 1, 2) && ELEM(b, 1, 2)) {
bp->vec[2] += grid;
}
mul_m4_v3(mat, bp->vec);

View File

@ -922,7 +922,7 @@ static void curve_select_more(Object *obedit)
bp = nu->bp;
selbpoints = BLI_BITMAP_NEW(a, "selectlist");
while (a > 0) {
if ((!BLI_BITMAP_TEST(selbpoints, a)) && (bp->hide == 0) && (bp->f1 & SELECT)) {
if (!BLI_BITMAP_TEST(selbpoints, a) && (bp->hide == 0) && (bp->f1 & SELECT)) {
/* upper control point */
if (a % nu->pntsu != 0) {
tempbp = bp - 1;

View File

@ -73,7 +73,7 @@ static void button2d_geom_draw_backdrop(const wmGizmo *gz,
GPU_viewport_size_get_f(viewport);
const float max_pixel_error = 0.25f;
int nsegments = (int)(ceilf(M_PI / acosf(1.0f - max_pixel_error / screen_scale)));
int nsegments = (int)ceilf(M_PI / acosf(1.0f - max_pixel_error / screen_scale));
nsegments = max_ff(nsegments, 8);
nsegments = min_ff(nsegments, 1000);

View File

@ -321,7 +321,7 @@ static void annotation_stroke_convertcoords(tGPsdata *p,
int mval_i[2];
round_v2i_v2fl(mval_i, mval);
if (annotation_project_check(p) &&
(ED_view3d_autodist_simple(p->region, mval_i, out, 0, depth))) {
ED_view3d_autodist_simple(p->region, mval_i, out, 0, depth)) {
/* projecting onto 3D-Geometry
* - nothing more needs to be done here, since view_autodist_simple() has already done it
*/
@ -1120,7 +1120,7 @@ static void annotation_stroke_eraser_dostroke(tGPsdata *p,
gpencil_point_to_xy(&p->gsc, gps, gps->points, &pc1[0], &pc1[1]);
/* Do bound-box check first. */
if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1])) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) {
if (!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) {
/* only check if point is inside */
if (len_v2v2_int(mval_i, pc1) <= radius) {
/* free stroke */
@ -1162,8 +1162,8 @@ static void annotation_stroke_eraser_dostroke(tGPsdata *p,
gpencil_point_to_xy(&p->gsc, gps, pt2, &pc2[0], &pc2[1]);
/* Check that point segment of the bound-box of the eraser stroke. */
if (((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1])) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) ||
((!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1])) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) {
if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) ||
(!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) {
/* Check if point segment of stroke had anything to do with
* eraser region (either within stroke painted, or on its lines)
* - this assumes that line-width is irrelevant.
@ -2520,7 +2520,7 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve
* (Disabling RIGHTMOUSE case here results in bugs like T32647)
* also making sure we have a valid event value, to not exit too early
*/
if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && (ELEM(event->val, KM_PRESS, KM_RELEASE))) {
if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && ELEM(event->val, KM_PRESS, KM_RELEASE)) {
/* if painting, end stroke */
if (p->status == GP_STATUS_PAINTING) {
int sketch = 0;

View File

@ -260,7 +260,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
}
/* Check if frame is in the list of frames to be exported. */
if ((only_selected) && (!BLI_ghash_haskey(keyframe_list, POINTER_FROM_INT(i)))) {
if ((only_selected) && !BLI_ghash_haskey(keyframe_list, POINTER_FROM_INT(i))) {
continue;
}

View File

@ -270,14 +270,13 @@ static void gpencil_timing_data_add_point(tGpTimingData *gtd,
}
else if (time < 0.0f) {
/* This is a gap, negative value! */
gtd->times[cur_point] = -(((float)(stroke_inittime - gtd->inittime)) + time +
gtd->offset_time);
gtd->times[cur_point] = -((float)(stroke_inittime - gtd->inittime) + time + gtd->offset_time);
delta_time = -gtd->times[cur_point] - gtd->times[cur_point - 1];
gtd->gap_tot_time += delta_time;
}
else {
gtd->times[cur_point] = (((float)(stroke_inittime - gtd->inittime)) + time + gtd->offset_time);
gtd->times[cur_point] = ((float)(stroke_inittime - gtd->inittime) + time + gtd->offset_time);
delta_time = gtd->times[cur_point] - fabsf(gtd->times[cur_point - 1]);
}
@ -1483,7 +1482,7 @@ static bool gpencil_convert_poll(bContext *C)
*/
return ((area && area->spacetype == SPACE_VIEW3D) && (gpl = BKE_gpencil_layer_active_get(gpd)) &&
(gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV)) &&
(gpf->strokes.first) && (!GPENCIL_ANY_EDIT_MODE(gpd)));
(gpf->strokes.first) && !GPENCIL_ANY_EDIT_MODE(gpd));
}
static int gpencil_convert_layer_exec(bContext *C, wmOperator *op)

View File

@ -1618,7 +1618,7 @@ static bool gpencil_strokes_paste_poll(bContext *C)
* 2) Copy buffer must at least have something (though it may be the wrong sort...).
*/
return (ED_gpencil_data_get_active(C) != NULL) &&
(!BLI_listbase_is_empty(&gpencil_strokes_copypastebuf));
!BLI_listbase_is_empty(&gpencil_strokes_copypastebuf);
}
typedef enum eGP_PasteMode {
@ -5014,7 +5014,7 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if ((mode == GP_SEPARATE_LAYER) && (BLI_listbase_is_single(&gpd_src->layers))) {
if ((mode == GP_SEPARATE_LAYER) && BLI_listbase_is_single(&gpd_src->layers)) {
BKE_report(op->reports, RPT_ERROR, "Cannot separate an object with one layer only");
return OPERATOR_CANCELLED;
}
@ -5463,7 +5463,7 @@ static bool gpencil_test_lasso(bGPDstroke *gps,
gpencil_point_to_world_space(pt, diff_mat, &pt2);
gpencil_point_to_xy(gsc, gps, &pt2, &x0, &y0);
/* test if in lasso */
return ((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(&data->rect, x0, y0) &&
return (!ELEM(V2D_IS_CLIPPED, x0, y0) && BLI_rcti_isect_pt(&data->rect, x0, y0) &&
BLI_lasso_is_point_inside(data->mcoords, data->mcoords_len, x0, y0, INT_MAX));
}

View File

@ -690,7 +690,7 @@ static bool gpencil_interpolate_set_init_values(bContext *C, wmOperator *op, tGP
tgpi->flag, (RNA_enum_get(op->ptr, "layers") == 1), GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS);
SET_FLAG_FROM_TEST(
tgpi->flag,
(GPENCIL_EDIT_MODE(tgpi->gpd) && (RNA_boolean_get(op->ptr, "interpolate_selected_only"))),
(GPENCIL_EDIT_MODE(tgpi->gpd) && RNA_boolean_get(op->ptr, "interpolate_selected_only")),
GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED);
tgpi->flipmode = RNA_enum_get(op->ptr, "flip");

Some files were not shown because too many files have changed in this diff Show More