Cleanup: remove redundant parenthesis

This commit is contained in:
2021-08-05 16:48:29 +10:00
parent d8582d966f
commit f5acfd9c04
48 changed files with 95 additions and 95 deletions

View File

@@ -260,7 +260,7 @@ ccl_device_forceinline bool kernel_path_shader_apply(KernelGlobals *kg,
PROFILING_INIT(kg, PROFILING_SHADER_APPLY);
#ifdef __SHADOW_TRICKS__
if ((sd->object_flag & SD_OBJECT_SHADOW_CATCHER)) {
if (sd->object_flag & SD_OBJECT_SHADOW_CATCHER) {
if (state->flag & PATH_RAY_TRANSPARENT_BACKGROUND) {
state->flag |= (PATH_RAY_SHADOW_CATCHER | PATH_RAY_STORE_SHADOW_INFO);

View File

@@ -426,7 +426,7 @@ bool BKE_animsys_rna_path_resolve(PointerRNA *ptr,
}
/* less than 1.0 evaluates to false, use epsilon to avoid float error */
#define ANIMSYS_FLOAT_AS_BOOL(value) ((value) > ((1.0f - FLT_EPSILON)))
#define ANIMSYS_FLOAT_AS_BOOL(value) ((value) > (1.0f - FLT_EPSILON))
bool BKE_animsys_read_from_rna_path(PathResolvedRNA *anim_rna, float *r_value)
{
@@ -2625,7 +2625,7 @@ static void animsys_create_action_track_strip(const AnimData *adt,
bAction *action = adt->action;
if ((adt->flag & ADT_NLA_EDIT_ON)) {
if (adt->flag & ADT_NLA_EDIT_ON) {
action = adt->tmpact;
}

View File

@@ -56,7 +56,7 @@ bool BKE_autoexec_match(const char *path)
if (path_cmp->path[0] == '\0') {
/* pass */
}
else if ((path_cmp->flag & USER_PATHCMP_GLOB)) {
else if (path_cmp->flag & USER_PATHCMP_GLOB) {
if (fnmatch(path_cmp->path, path, fnmatch_flags) == 0) {
return true;
}

View File

@@ -4153,7 +4153,7 @@ static void BKE_fluid_modifier_process(
{
const int scene_framenr = (int)DEG_get_ctime(depsgraph);
if ((fmd->type & MOD_FLUID_TYPE_FLOW)) {
if (fmd->type & MOD_FLUID_TYPE_FLOW) {
BKE_fluid_modifier_processFlow(fmd, depsgraph, scene, ob, me, scene_framenr);
}
else if (fmd->type & MOD_FLUID_TYPE_EFFEC) {

View File

@@ -571,7 +571,7 @@ static void lib_override_linked_group_tag_recursive(LibOverrideGroupTagData *dat
* would use one of those.
* NOTE: missing IDs (aka placeholders) are never overridden. */
if (ELEM(GS(to_id->name), ID_OB, ID_GR)) {
if ((to_id->tag & LIB_TAG_MISSING)) {
if (to_id->tag & LIB_TAG_MISSING) {
to_id->tag |= missing_tag;
}
else {
@@ -604,7 +604,7 @@ static void lib_override_linked_group_tag(LibOverrideGroupTagData *data)
const bool is_resync = data->is_resync;
BLI_assert(!data->is_override);
if ((id_root->tag & LIB_TAG_MISSING)) {
if (id_root->tag & LIB_TAG_MISSING) {
id_root->tag |= data->missing_tag;
}
else {
@@ -654,7 +654,7 @@ static void lib_override_linked_group_tag(LibOverrideGroupTagData *data)
if (instantiating_collection == NULL &&
instantiating_collection_override_candidate != NULL) {
if ((instantiating_collection_override_candidate->id.tag & LIB_TAG_MISSING)) {
if (instantiating_collection_override_candidate->id.tag & LIB_TAG_MISSING) {
instantiating_collection_override_candidate->id.tag |= data->missing_tag;
}
else {
@@ -730,7 +730,7 @@ static void lib_override_overrides_group_tag(LibOverrideGroupTagData *data)
BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id_root));
BLI_assert(data->is_override);
if ((id_root->override_library->reference->tag & LIB_TAG_MISSING)) {
if (id_root->override_library->reference->tag & LIB_TAG_MISSING) {
id_root->tag |= data->missing_tag;
}
else {

View File

@@ -1026,7 +1026,7 @@ static void pbvh_update_normals_accum_task_cb(void *__restrict userdata,
PBVHNode *node = data->nodes[n];
float(*vnors)[3] = data->vnors;
if ((node->flag & PBVH_UpdateNormals)) {
if (node->flag & PBVH_UpdateNormals) {
unsigned int mpoly_prev = UINT_MAX;
float fn[3];

View File

@@ -3369,7 +3369,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
}
/* NOTE: breaking baking should leave calculated frames in cache, not clear it */
if ((cancel || G.is_break)) {
if (cancel || G.is_break) {
break;
}

View File

@@ -2178,7 +2178,7 @@ int BKE_scene_base_iter_next(
/* exception: empty scene layer */
while ((*scene)->set) {
(*scene) = (*scene)->set;
ViewLayer *view_layer_set = BKE_view_layer_default_render((*scene));
ViewLayer *view_layer_set = BKE_view_layer_default_render(*scene);
if (view_layer_set->object_bases.first) {
*base = view_layer_set->object_bases.first;
*ob = (*base)->object;
@@ -2199,7 +2199,7 @@ int BKE_scene_base_iter_next(
/* (*scene) is finished, now do the set */
while ((*scene)->set) {
(*scene) = (*scene)->set;
ViewLayer *view_layer_set = BKE_view_layer_default_render((*scene));
ViewLayer *view_layer_set = BKE_view_layer_default_render(*scene);
if (view_layer_set->object_bases.first) {
*base = view_layer_set->object_bases.first;
*ob = (*base)->object;
@@ -2898,7 +2898,7 @@ Base *_setlooper_base_step(Scene **sce_iter, ViewLayer *view_layer, Base *base)
next_set:
/* Reached the end, get the next base in the set. */
while ((*sce_iter = (*sce_iter)->set)) {
ViewLayer *view_layer_set = BKE_view_layer_default_render((*sce_iter));
ViewLayer *view_layer_set = BKE_view_layer_default_render(*sce_iter);
base = (Base *)view_layer_set->object_bases.first;
if (base) {
@@ -3118,7 +3118,7 @@ bool BKE_scene_multiview_is_render_view_active(const RenderData *rd, const Scene
return false;
}
if ((srv->viewflag & SCE_VIEW_DISABLE)) {
if (srv->viewflag & SCE_VIEW_DISABLE) {
return false;
}

View File

@@ -475,7 +475,7 @@ static void studiolight_load_equirect_image(StudioLight *sl)
NULL, (failed || (specular_ibuf == NULL)) ? magenta : black, 1, 1, 4);
}
if ((sl->flag & STUDIOLIGHT_TYPE_MATCAP)) {
if (sl->flag & STUDIOLIGHT_TYPE_MATCAP) {
sl->matcap_diffuse.ibuf = diffuse_ibuf;
sl->matcap_specular.ibuf = specular_ibuf;
if (specular_ibuf != NULL) {
@@ -1192,7 +1192,7 @@ static void studiolight_add_files_from_datafolder(const int folder_id,
uint totfile = BLI_filelist_dir_contents(folder, &dir);
int i;
for (i = 0; i < totfile; i++) {
if ((dir[i].type & S_IFREG)) {
if (dir[i].type & S_IFREG) {
studiolight_add_file(dir[i].path, flag);
}
}
@@ -1473,7 +1473,7 @@ struct StudioLight *BKE_studiolight_find_default(int flag)
}
LISTBASE_FOREACH (StudioLight *, sl, &studiolights) {
if ((sl->flag & flag)) {
if (sl->flag & flag) {
return sl;
}
}
@@ -1484,7 +1484,7 @@ struct StudioLight *BKE_studiolight_find(const char *name, int flag)
{
LISTBASE_FOREACH (StudioLight *, sl, &studiolights) {
if (STREQLEN(sl->name, name, FILE_MAXFILE)) {
if ((sl->flag & flag)) {
if (sl->flag & flag) {
return sl;
}
@@ -1542,32 +1542,32 @@ void BKE_studiolight_ensure_flag(StudioLight *sl, int flag)
return;
}
if ((flag & STUDIOLIGHT_EXTERNAL_IMAGE_LOADED)) {
if (flag & STUDIOLIGHT_EXTERNAL_IMAGE_LOADED) {
studiolight_load_equirect_image(sl);
}
if ((flag & STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED)) {
if (flag & STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED) {
studiolight_calculate_radiance_cubemap_buffers(sl);
}
if ((flag & STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED)) {
if (flag & STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED) {
if (!studiolight_load_spherical_harmonics_coefficients(sl)) {
studiolight_calculate_diffuse_light(sl);
}
}
if ((flag & STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE)) {
if (flag & STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE) {
studiolight_create_equirect_radiance_gputexture(sl);
}
if ((flag & STUDIOLIGHT_EQUIRECT_IRRADIANCE_GPUTEXTURE)) {
if (flag & STUDIOLIGHT_EQUIRECT_IRRADIANCE_GPUTEXTURE) {
studiolight_create_equirect_irradiance_gputexture(sl);
}
if ((flag & STUDIOLIGHT_EQUIRECT_IRRADIANCE_IMAGE_CALCULATED)) {
if (flag & STUDIOLIGHT_EQUIRECT_IRRADIANCE_IMAGE_CALCULATED) {
if (!studiolight_load_irradiance_equirect_image(sl)) {
studiolight_calculate_irradiance_equirect_image(sl);
}
}
if ((flag & STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE)) {
if (flag & STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE) {
studiolight_create_matcap_diffuse_gputexture(sl);
}
if ((flag & STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE)) {
if (flag & STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE) {
studiolight_create_matcap_specular_gputexture(sl);
}
}

View File

@@ -322,7 +322,7 @@ static bool tracking_check_marker_margin(const libmv_Marker *libmv_marker,
static bool autotrack_is_marker_usable(const MovieTrackingMarker *marker)
{
if ((marker->flag & MARKER_DISABLED)) {
if (marker->flag & MARKER_DISABLED) {
return false;
}
return true;
@@ -797,7 +797,7 @@ void BKE_autotrack_context_finish(AutoTrackContext *context)
clip, context->start_scene_frame);
LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
if ((plane_track->flag & PLANE_TRACK_AUTOKEY)) {
if (plane_track->flag & PLANE_TRACK_AUTOKEY) {
continue;
}
for (int track_index = 0; track_index < context->num_all_tracks; track_index++) {

View File

@@ -741,7 +741,7 @@ static AVStream *alloc_video_stream(FFMpegContext *context,
}
}
if ((of->oformat->flags & AVFMT_GLOBALHEADER)) {
if (of->oformat->flags & AVFMT_GLOBALHEADER) {
PRINT("Using global header\n");
c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}

View File

@@ -1787,7 +1787,7 @@ bool isect_ray_tri_v3(const float ray_origin[3],
}
*r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) {
if (*r_lambda < 0.0f) {
return false;
}
@@ -1864,7 +1864,7 @@ bool isect_ray_tri_epsilon_v3(const float ray_origin[3],
}
*r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) {
if (*r_lambda < 0.0f) {
return false;
}
@@ -2024,7 +2024,7 @@ bool isect_ray_tri_threshold_v3(const float ray_origin[3],
cross_v3_v3v3(q, s, e1);
*r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) {
if (*r_lambda < 0.0f) {
return false;
}
@@ -3325,7 +3325,7 @@ bool isect_ray_aabb_v3_simple(const float orig[3],
t[5] = (double)(bb_max[2] - orig[2]) * invdirz;
hit_dist[0] = (float)fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5]));
hit_dist[1] = (float)fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5]));
if ((hit_dist[1] < 0.0f || hit_dist[0] > hit_dist[1])) {
if ((hit_dist[1] < 0.0f) || (hit_dist[0] > hit_dist[1])) {
return false;
}

View File

@@ -2390,7 +2390,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Triangulate) {
TriangulateModifierData *tmd = (TriangulateModifierData *)md;
if ((tmd->flag & MOD_TRIANGULATE_BEAUTY)) {
if (tmd->flag & MOD_TRIANGULATE_BEAUTY) {
tmd->quad_method = MOD_TRIANGULATE_QUAD_BEAUTY;
tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
}

View File

@@ -1335,7 +1335,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
ME_OPT_EDGES = (1 << 8),
};
if ((me->flag & ME_SUBSURF)) {
if (me->flag & ME_SUBSURF) {
SubsurfModifierData *smd = (SubsurfModifierData *)BKE_modifier_new(
eModifierType_Subsurf);

View File

@@ -57,8 +57,8 @@ void CryptomatteOperation::executePixel(float output[4], int x, int y, void *dat
::memcpy(&m3hash, &input[0], sizeof(uint32_t));
/* Since the red channel is likely to be out of display range,
* setting green and blue gives more meaningful images. */
output[1] = ((float)((m3hash << 8)) / (float)UINT32_MAX);
output[2] = ((float)((m3hash << 16)) / (float)UINT32_MAX);
output[1] = ((float)(m3hash << 8) / (float)UINT32_MAX);
output[2] = ((float)(m3hash << 16) / (float)UINT32_MAX);
}
for (float hash : m_objectIndex) {
if (input[0] == hash) {

View File

@@ -65,7 +65,7 @@ void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb)
COLLECTION_HIDE_RENDER;
for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
if ((lc->collection->flag & visibility_flag)) {
if (lc->collection->flag & visibility_flag) {
continue;
}
if ((lc->flag & LAYER_COLLECTION_EXCLUDE) == 0) {

View File

@@ -399,7 +399,7 @@ typedef struct WORKBENCH_ViewLayerData {
/* inline helper functions */
BLI_INLINE bool workbench_is_specular_highlight_enabled(WORKBENCH_PrivateData *wpd)
{
if ((wpd->shading.flag & V3D_SHADING_SPECULAR_HIGHLIGHT)) {
if (wpd->shading.flag & V3D_SHADING_SPECULAR_HIGHLIGHT) {
if (STUDIOLIGHT_ENABLED(wpd) || MATCAP_ENABLED(wpd)) {
return (wpd->studio_light->flag & STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS) != 0;
}

View File

@@ -512,7 +512,7 @@ static void drw_context_state_init(void)
if (DST.draw_ctx.object_mode & OB_MODE_POSE) {
DST.draw_ctx.object_pose = DST.draw_ctx.obact;
}
else if ((DST.draw_ctx.object_mode & OB_MODE_ALL_WEIGHT_PAINT)) {
else if (DST.draw_ctx.object_mode & OB_MODE_ALL_WEIGHT_PAINT) {
DST.draw_ctx.object_pose = BKE_object_pose_armature_get(DST.draw_ctx.obact);
}
else {

View File

@@ -283,11 +283,11 @@ void DRW_state_reset_ex(DRWState state)
static void drw_state_validate(void)
{
/* Cannot write to stencil buffer without stencil test. */
if ((DST.state & DRW_STATE_WRITE_STENCIL_ENABLED)) {
if (DST.state & DRW_STATE_WRITE_STENCIL_ENABLED) {
BLI_assert(DST.state & DRW_STATE_STENCIL_TEST_ENABLED);
}
/* Cannot write to depth buffer without depth test. */
if ((DST.state & DRW_STATE_WRITE_DEPTH)) {
if (DST.state & DRW_STATE_WRITE_DEPTH) {
BLI_assert(DST.state & DRW_STATE_DEPTH_TEST_ENABLED);
}
}

View File

@@ -908,7 +908,7 @@ static int pose_paste_exec(bContext *C, wmOperator *op)
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
/* Recalculate paths if any of the bones have paths... */
if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) {
if (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) {
ED_pose_recalculate_paths(C, scene, ob, POSE_PATH_CALC_RANGE_FULL);
}
@@ -1219,7 +1219,7 @@ static int pose_clear_transform_generic_exec(bContext *C,
ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
/* now recalculate paths */
if ((ob_iter->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) {
if (ob_iter->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) {
ED_pose_recalculate_paths(C, scene, ob_iter, POSE_PATH_CALC_RANGE_FULL);
}

View File

@@ -110,7 +110,7 @@ void AssetMarkHelper::reportResults(ReportList &reports) const
{
/* User feedback on failure. */
if (!wasSuccessful()) {
if ((stats.tot_already_asset > 0)) {
if (stats.tot_already_asset > 0) {
BKE_report(&reports,
RPT_ERROR,
"Selected data-blocks are already assets (or do not support use as assets)");

View File

@@ -431,7 +431,7 @@ Nurb *ED_curve_add_nurbs_primitive(
if (newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) {
ed_editnurb_spin(umat, NULL, obedit, tmp_vec, tmp_cent);
}
else if ((U.flag & USER_ADD_VIEWALIGNED)) {
else if (U.flag & USER_ADD_VIEWALIGNED) {
ed_editnurb_spin(viewmat, NULL, obedit, zvec, mat[3]);
}
else {
@@ -466,7 +466,7 @@ Nurb *ED_curve_add_nurbs_primitive(
if (newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) {
ed_editnurb_spin(umat, NULL, obedit, tmp_vec, tmp_cent);
}
else if ((U.flag & USER_ADD_VIEWALIGNED)) {
else if (U.flag & USER_ADD_VIEWALIGNED) {
ed_editnurb_spin(viewmat, NULL, obedit, zvec, mat[3]);
}
else {

View File

@@ -6173,7 +6173,7 @@ int UI_but_return_value_get(uiBut *but)
void UI_but_drag_set_id(uiBut *but, ID *id)
{
but->dragtype = WM_DRAG_ID;
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
if (but->dragflag & UI_BUT_DRAGPOIN_FREE) {
WM_drag_data_free(but->dragtype, but->dragpoin);
but->dragflag &= ~UI_BUT_DRAGPOIN_FREE;
}
@@ -6200,7 +6200,7 @@ void UI_but_drag_set_asset(uiBut *but,
but->dragtype = WM_DRAG_ASSET;
ui_def_but_icon(but, icon, 0); /* no flag UI_HAS_ICON, so icon doesn't draw in button */
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
if (but->dragflag & UI_BUT_DRAGPOIN_FREE) {
WM_drag_data_free(but->dragtype, but->dragpoin);
}
but->dragpoin = asset_drag;
@@ -6212,7 +6212,7 @@ void UI_but_drag_set_asset(uiBut *but,
void UI_but_drag_set_rna(uiBut *but, PointerRNA *ptr)
{
but->dragtype = WM_DRAG_RNA;
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
if (but->dragflag & UI_BUT_DRAGPOIN_FREE) {
WM_drag_data_free(but->dragtype, but->dragpoin);
but->dragflag &= ~UI_BUT_DRAGPOIN_FREE;
}
@@ -6222,7 +6222,7 @@ void UI_but_drag_set_rna(uiBut *but, PointerRNA *ptr)
void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free)
{
but->dragtype = WM_DRAG_PATH;
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
if (but->dragflag & UI_BUT_DRAGPOIN_FREE) {
WM_drag_data_free(but->dragtype, but->dragpoin);
but->dragflag &= ~UI_BUT_DRAGPOIN_FREE;
}
@@ -6235,7 +6235,7 @@ void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free)
void UI_but_drag_set_name(uiBut *but, const char *name)
{
but->dragtype = WM_DRAG_NAME;
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
if (but->dragflag & UI_BUT_DRAGPOIN_FREE) {
WM_drag_data_free(but->dragtype, but->dragpoin);
but->dragflag &= ~UI_BUT_DRAGPOIN_FREE;
}
@@ -6253,7 +6253,7 @@ void UI_but_drag_set_image(
{
but->dragtype = WM_DRAG_PATH;
ui_def_but_icon(but, icon, 0); /* no flag UI_HAS_ICON, so icon doesn't draw in button */
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
if (but->dragflag & UI_BUT_DRAGPOIN_FREE) {
WM_drag_data_free(but->dragtype, but->dragpoin);
but->dragflag &= ~UI_BUT_DRAGPOIN_FREE;
}

View File

@@ -6779,7 +6779,7 @@ static bool ui_numedit_but_HSVCIRCLE(uiBut *but,
ui_color_picker_hsv_to_rgb(hsv, rgb);
if ((cpicker->use_luminosity_lock)) {
if (cpicker->use_luminosity_lock) {
if (!is_zero_v3(rgb)) {
normalize_v3_length(rgb, cpicker->luminosity_lock_value);
}

View File

@@ -1014,7 +1014,7 @@ static void init_iconfile_list(struct ListBase *list)
int index = 1;
for (int i = 0; i < totfile; i++) {
if ((dir[i].type & S_IFREG)) {
if (dir[i].type & S_IFREG) {
const char *filename = dir[i].relname;
if (BLI_path_extension_check(filename, ".png")) {

View File

@@ -2906,7 +2906,7 @@ static void areas_do_frame_follow(bContext *C, bool middle)
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
/* do follow here if editor type supports it */
if ((screen_ctx->redraws_flag & TIME_FOLLOW)) {
if (screen_ctx->redraws_flag & TIME_FOLLOW) {
if ((region->regiontype == RGN_TYPE_WINDOW &&
ELEM(area->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) ||
(area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) {

View File

@@ -190,7 +190,7 @@ static void HC_relaxation_iteration_uv(BMEditMesh *em,
/* This is supposed to happen only if "Pin Edges" is on,
* since we have initialization on stroke start.
* If ever uv brushes get their own mode we should check for toolsettings option too. */
if ((sculptdata->uv[i].flag & MARK_BOUNDARY)) {
if (sculptdata->uv[i].flag & MARK_BOUNDARY) {
continue;
}
@@ -268,7 +268,7 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em,
/* This is supposed to happen only if "Pin Edges" is on,
* since we have initialization on stroke start.
* If ever uv brushes get their own mode we should check for toolsettings option too. */
if ((sculptdata->uv[i].flag & MARK_BOUNDARY)) {
if (sculptdata->uv[i].flag & MARK_BOUNDARY) {
continue;
}

View File

@@ -969,7 +969,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
BLI_join_dirfile(name, sizeof(name), xdg_runtime_dir, "gvfs/");
const uint dir_len = BLI_filelist_dir_contents(name, &dir);
for (uint i = 0; i < dir_len; i++) {
if ((dir[i].type & S_IFDIR)) {
if (dir[i].type & S_IFDIR) {
const char *dirname = dir[i].relname;
if (dirname[0] != '.') {
/* Dir names contain a lot of unwanted text.

View File

@@ -1139,7 +1139,7 @@ static void draw_seq_strip(const bContext *C,
}
/* Draw strip offsets when flag is enabled or during "solo preview". */
if ((sseq->flag & SEQ_SHOW_STRIP_OVERLAY)) {
if (sseq->flag & SEQ_SHOW_STRIP_OVERLAY) {
if (!is_single_image && (seq->startofs || seq->endofs) && pixely > 0) {
if ((sseq->draw_flag & SEQ_DRAW_OFFSET_EXT) || (seq == special_seq_update)) {
draw_sequence_extensions_overlay(scene, seq, pos, pixely);

View File

@@ -131,7 +131,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
if ((seq->flag & SELECT)) {
if (seq->flag & SELECT) {
ListBase queue = {NULL, NULL};
LinkData *link;
short stop = 0, do_update;
@@ -197,7 +197,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
}
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
if ((seq->flag & SELECT)) {
if (seq->flag & SELECT) {
if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) {
SEQ_proxy_set(seq, turnon);
if (seq->strip->proxy == NULL) {

View File

@@ -292,7 +292,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *op)
}
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ((seq->flag & SELECT)) {
if (seq->flag & SELECT) {
xmin = min_ii(xmin, seq->startdisp);
xmax = max_ii(xmax, seq->enddisp);

View File

@@ -548,7 +548,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op)
walk->teleport.duration = U.walk_navigation.teleport_time;
walk->mouse_speed = U.walk_navigation.mouse_speed;
if ((U.walk_navigation.flag & USER_WALK_GRAVITY)) {
if (U.walk_navigation.flag & USER_WALK_GRAVITY) {
walk_navigation_mode_set(walk, WALK_MODE_GRAVITY);
}
else {
@@ -563,7 +563,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op)
walk->gravity_state = WALK_GRAVITY_STATE_OFF;
if ((walk->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)) {
if (walk->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
walk->gravity = fabsf(walk->scene->physics_settings.gravity[2]);
}
else {
@@ -1199,11 +1199,11 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm)
direction = 0;
if ((walk->active_directions & WALK_BIT_FORWARD)) {
if (walk->active_directions & WALK_BIT_FORWARD) {
direction += 1;
}
if ((walk->active_directions & WALK_BIT_BACKWARD)) {
if (walk->active_directions & WALK_BIT_BACKWARD) {
direction -= 1;
}
@@ -1223,11 +1223,11 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm)
direction = 0;
if ((walk->active_directions & WALK_BIT_LEFT)) {
if (walk->active_directions & WALK_BIT_LEFT) {
direction += 1;
}
if ((walk->active_directions & WALK_BIT_RIGHT)) {
if (walk->active_directions & WALK_BIT_RIGHT) {
direction -= 1;
}
@@ -1245,11 +1245,11 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm)
direction = 0;
if ((walk->active_directions & WALK_BIT_UP)) {
if (walk->active_directions & WALK_BIT_UP) {
direction -= 1;
}
if ((walk->active_directions & WALK_BIT_DOWN)) {
if (walk->active_directions & WALK_BIT_DOWN) {
direction = 1;
}

View File

@@ -2156,7 +2156,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc,
for (a = 0; a < hits; a++) {
if (has_bones) {
/* skip non-bone objects */
if ((buffer[4 * a + 3] & 0xFFFF0000)) {
if (buffer[4 * a + 3] & 0xFFFF0000) {
if (base->object->runtime.select_id == (buffer[(4 * a) + 3] & 0xFFFF)) {
basact = base;
}

View File

@@ -1828,7 +1828,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
if ((t->flag & T_EDIT) && t->obedit_type == OB_MESH) {
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
if ((((Mesh *)(tc->obedit->data))->flag & ME_AUTOSMOOTH)) {
if (((Mesh *)(tc->obedit->data))->flag & ME_AUTOSMOOTH) {
BMEditMesh *em = NULL; /* BKE_editmesh_from_object(t->obedit); */
bool do_skip = false;

View File

@@ -1515,7 +1515,7 @@ int transform_convert_pose_transflags_update(Object *ob,
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
bone = pchan->bone;
if (PBONE_VISIBLE(arm, bone)) {
if ((bone->flag & BONE_SELECTED)) {
if (bone->flag & BONE_SELECTED) {
bone->flag |= BONE_TRANSFORM;
}
else {

View File

@@ -141,7 +141,7 @@ static SeqCollection *query_snap_targets(const TransInfo *t, SeqCollection *snap
const short snap_flag = SEQ_tool_settings_snap_flag_get(t->scene);
SeqCollection *snap_targets = SEQ_collection_create(__func__);
LISTBASE_FOREACH (Sequence *, seq, seqbase) {
if ((seq->flag & SELECT)) {
if (seq->flag & SELECT) {
continue; /* Selected are being transformed. */
}
if ((seq->flag & SEQ_MUTE) && (snap_flag & SEQ_SNAP_IGNORE_MUTED)) {

View File

@@ -3912,7 +3912,7 @@ BMLoop **ED_uvedit_selected_verts(Scene *scene, BMesh *bm, int len_max, int *r_v
BM_ITER_ELEM (l_iter, &liter, f, BM_LOOPS_OF_FACE) {
if (!BM_elem_flag_test(l_iter, BM_ELEM_TAG)) {
const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l_iter, cd_loop_uv_offset);
if ((luv->flag & MLOOPUV_VERTSEL)) {
if (luv->flag & MLOOPUV_VERTSEL) {
BM_elem_flag_enable(l_iter->v, BM_ELEM_TAG);
verts[verts_len++] = l_iter;

View File

@@ -266,7 +266,7 @@ static PyObject *Freestyle_evaluateCurveMappingF(PyObject * /*self*/, PyObject *
cumap = (CurveMapping *)py_srna->ptr.data;
BKE_curvemapping_init(cumap);
/* disable extrapolation if enabled */
if ((cumap->flag & CUMA_EXTEND_EXTRAPOLATE)) {
if (cumap->flag & CUMA_EXTEND_EXTRAPOLATE) {
cumap->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
BKE_curvemapping_changed(cumap, false);
}

View File

@@ -527,7 +527,7 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap,
fe = fe->nextEdge();
continue;
}
if ((maxCard < qiMajority)) {
if (maxCard < qiMajority) {
// ARB: change &wFace to wFace and use reference in called function
tmpQI = computeVisibility<G, I>(
ioViewMap, fe, grid, epsilon, *ve, &wFace, &foundOccluders);
@@ -725,7 +725,7 @@ static void computeDetailedVisibility(ViewMap *ioViewMap,
fe = fe->nextEdge();
continue;
}
if ((maxCard < qiMajority)) {
if (maxCard < qiMajority) {
// ARB: change &wFace to wFace and use reference in called function
tmpQI = computeVisibility<G, I>(
ioViewMap, fe, grid, epsilon, *ve, &wFace, &foundOccluders);
@@ -891,7 +891,7 @@ static void computeFastVisibility(ViewMap *ioViewMap, G &grid, real epsilon)
continue;
}
if (even_test) {
if ((maxCard < qiMajority)) {
if (maxCard < qiMajority) {
// ARB: change &wFace to wFace and use reference in called function
tmpQI = computeVisibility<G, I>(
ioViewMap, fe, grid, epsilon, *ve, &wFace, &foundOccluders);
@@ -1607,7 +1607,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
memset(qiClasses, 0, 256 * sizeof(*qiClasses));
set<ViewShape *> occluders;
do {
if ((maxCard < qiMajority)) {
if (maxCard < qiMajority) {
tmpQI = ComputeRayCastingVisibility(fe, _Grid, epsilon, occluders, &aFace, timestamp++);
#if LOGGING
@@ -1763,7 +1763,7 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real ep
fe = (*ve)->fedgeA();
do {
if (even_test) {
if ((maxCard < qiMajority)) {
if (maxCard < qiMajority) {
tmpQI = ComputeRayCastingVisibility(fe, _Grid, epsilon, occluders, &aFace, timestamp++);
// ARB: This is an error condition, not an alert condition.

View File

@@ -42,7 +42,7 @@
static void invert(int *val)
{
int tval = *val;
*val = ((tval >> 24)) | ((tval << 8) & 0x00ff0000) | ((tval >> 8) & 0x0000ff00) | ((tval << 24));
*val = (tval >> 24) | ((tval << 8) & 0x00ff0000) | ((tval >> 8) & 0x0000ff00) | (tval << 24);
}
static void sinvert(short int *val)

View File

@@ -132,7 +132,7 @@ static void init_switch_view(const bContext *C, PointerRNA *ptr)
for (nr = 0, srv = rd->views.first; srv; srv = srv->next, nr++) {
sock = ntreeCompositSwitchViewAddSocket(ntree, node, srv->name);
if ((srv->viewflag & SCE_VIEW_DISABLE)) {
if (srv->viewflag & SCE_VIEW_DISABLE) {
sock->flag |= SOCK_HIDDEN;
}
}

View File

@@ -443,7 +443,7 @@ static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key,
}
if (value) {
/* dvert[group_index] = 0.5 */
/* Handle `dvert[group_index] = 0.5`. */
if (i < 0) {
PyErr_SetString(PyExc_KeyError,
"BMDeformVert[key] = x: "
@@ -453,7 +453,7 @@ static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key,
MDeformWeight *dw = BKE_defvert_ensure_index(self->data, i);
const float f = PyFloat_AsDouble(value);
if (f == -1 && PyErr_Occurred()) { // parsed key not a number
if (f == -1 && PyErr_Occurred()) { /* Parsed key not a number. */
PyErr_SetString(PyExc_TypeError,
"BMDeformVert[key] = x: "
"assigned value not a number");
@@ -463,7 +463,7 @@ static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key,
dw->weight = clamp_f(f, 0.0f, 1.0f);
}
else {
/* del dvert[group_index] */
/* Handle `del dvert[group_index]`. */
MDeformWeight *dw = BKE_defvert_find_index(self->data, i);
if (dw == NULL) {

View File

@@ -79,7 +79,7 @@ static bool bpy_gizmotype_target_property_def(wmGizmoType *gzt, PyObject *item)
goto fail;
}
if ((params.array_length < 1 || params.array_length > RNA_MAX_ARRAY_LENGTH)) {
if ((params.array_length < 1) || (params.array_length > RNA_MAX_ARRAY_LENGTH)) {
PyErr_SetString(PyExc_ValueError, "'array_length' out of range");
goto fail;
}

View File

@@ -114,7 +114,7 @@ static PyObject *py_structseq_from_strings(PyTypeObject *py_type,
BLI_assert(py_struct_seq != NULL);
for (str_iter = str_items; *str_iter; str_iter++) {
PyStructSequence_SET_ITEM(py_struct_seq, pos++, PyUnicode_FromString((*str_iter)));
PyStructSequence_SET_ITEM(py_struct_seq, pos++, PyUnicode_FromString(*str_iter));
}
return py_struct_seq;

View File

@@ -2524,7 +2524,7 @@ void RE_RenderAnim(Render *re,
if (G.is_break == true) {
/* remove touched file */
if (is_movie == false && do_write_file) {
if ((rd.mode & R_TOUCH)) {
if (rd.mode & R_TOUCH) {
if (!is_multiview_name) {
if ((BLI_file_size(name) == 0)) {
/* BLI_exists(name) is implicit */

View File

@@ -784,7 +784,7 @@ void render_result_views_new(RenderResult *rr, const RenderData *rd)
render_result_views_free(rr);
/* check renderdata for amount of views */
if ((rd->scemode & R_MULTIVIEW)) {
if (rd->scemode & R_MULTIVIEW) {
for (srv = rd->views.first; srv; srv = srv->next) {
if (BKE_scene_multiview_is_render_view_active(rd, srv) == false) {
continue;

View File

@@ -585,7 +585,7 @@ void wm_tweakevent_test(bContext *C, const wmEvent *event, int action)
}
else {
/* no tweaks if event was handled */
if ((action & WM_HANDLER_BREAK)) {
if (action & WM_HANDLER_BREAK) {
WM_gesture_end(win, win->tweak);
}
else {

View File

@@ -121,7 +121,7 @@ static bool parse_int_relative(const char *str,
*r_err_msg = msg;
return false;
}
if ((errno == ERANGE) || ((value < INT_MIN || value > INT_MAX))) {
if ((errno == ERANGE) || ((value < INT_MIN) || (value > INT_MAX))) {
static const char *msg = "exceeds range";
*r_err_msg = msg;
return false;
@@ -225,7 +225,7 @@ static bool parse_int_strict_range(const char *str,
*r_err_msg = msg;
return false;
}
if ((errno == ERANGE) || ((value < min || value > max))) {
if ((errno == ERANGE) || ((value < min) || (value > max))) {
static const char *msg = "exceeds range";
*r_err_msg = msg;
return false;