Cleanup: clarify order of precedence: &/?
authorCampbell Barton <ideasman42@gmail.com>
Thu, 4 Jun 2015 05:28:26 +0000 (15:28 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 4 Jun 2015 05:41:27 +0000 (15:41 +1000)
13 files changed:
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenloader/intern/versioning_250.c
source/blender/editors/interface/view2d.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform_manipulator.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/render/intern/raytrace/rayobject_instance.cpp

index 5546fb49d81b459ffa099d746a37db9421d0c54c..bf6f7a5f22c6d41eed0c36346311c266a95355e4 100644 (file)
@@ -1610,7 +1610,7 @@ void rename_id(ID *id, const char *name)
 void name_uiprefix_id(char *name, const ID *id)
 {
        name[0] = id->lib ? 'L' : ' ';
-       name[1] = id->flag & LIB_FAKEUSER ? 'F' : (id->us == 0) ? '0' : ' ';
+       name[1] = (id->flag & LIB_FAKEUSER) ? 'F' : ((id->us == 0) ? '0' : ' ');
        name[2] = ' ';
 
        strcpy(name + 3, id->name + 2);
index 939d6eed4543c9558f0a8588615adb6cdc579b90..03bf7ddef4d26648a8b55ef0a1b71d32b2764308 100644 (file)
@@ -2116,7 +2116,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[4][4])
        }
        
        /* vec: 4 items! */
-       if (where_on_path(par, ctime, vec, dir, cu->flag & CU_FOLLOW ? quat : NULL, &radius, NULL)) {
+       if (where_on_path(par, ctime, vec, dir, (cu->flag & CU_FOLLOW) ? quat : NULL, &radius, NULL)) {
 
                if (cu->flag & CU_FOLLOW) {
 #if 0
index 402674c038975694e421e60691639299fcd99c55..e8bca50c3d724263f0945a4c37ede8d284121216 100644 (file)
@@ -3763,7 +3763,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
         SubsurfFlags flags)
 {
        int useSimple = (smd->subdivType == ME_SIMPLE_SUBSURF) ? CCG_SIMPLE_SUBDIV : 0;
-       CCGFlags useAging = smd->flags & eSubsurfModifierFlag_DebugIncr ? CCG_USE_AGING : 0;
+       CCGFlags useAging = (smd->flags & eSubsurfModifierFlag_DebugIncr) ? CCG_USE_AGING : 0;
        int useSubsurfUv = smd->flags & eSubsurfModifierFlag_SubsurfUv;
        int drawInteriorEdges = !(smd->flags & eSubsurfModifierFlag_ControlEdges);
        CCGDerivedMesh *result;
index 274fc474aded2bbd8079a3fe7bdf7b4b6e688c50..2727f3a39651d5a5e48d4e4dba79bfdb4e13ec23 100644 (file)
@@ -766,7 +766,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
                                        bSoundActuator *sAct = (bSoundActuator*) act->data;
                                        if (sAct->sound) {
                                                sound = blo_do_versions_newlibadr(fd, lib, sAct->sound);
-                                               sAct->flag = sound->flags & SOUND_FLAGS_3D ? ACT_SND_3D_SOUND : 0;
+                                               sAct->flag = (sound->flags & SOUND_FLAGS_3D) ? ACT_SND_3D_SOUND : 0;
                                                sAct->pitch = sound->pitch;
                                                sAct->volume = sound->volume;
                                                sAct->sound3D.reference_distance = sound->distance;
index 04ab50053a2dd654cb98703c11df369beb16c276..4f4b5ab07ff4edf3ae5a06d17ad74c969f2c17cb 100644 (file)
@@ -322,7 +322,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
 
                        if (do_init) {
                                float panelzoom = (style) ? style->panelzoom : 1.0f;
-                               float scrolw = v2d->scroll & V2D_SCROLL_RIGHT ? V2D_SCROLL_WIDTH : 0.0f;
+                               float scrolw = (v2d->scroll & V2D_SCROLL_RIGHT) ? V2D_SCROLL_WIDTH : 0.0f;
                                
                                v2d->tot.xmin = 0.0f;
                                v2d->tot.xmax = winx - scrolw;
index 6a9d7044e2cd677fc4d63a60bb6c769fd87d1404..30ab00a72c249f08fac31340ad3061b11b6fb5e9 100644 (file)
@@ -1026,8 +1026,8 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
                /* check if brush is subtracting, use different color then */
                /* TODO: no way currently to know state of pen flip or
                 * invert key modifier without starting a stroke */
-               if ((!(ups->draw_inverted) ^
-                    !(brush->flag & BRUSH_DIR_IN)) &&
+               if (((ups->draw_inverted == 0) ^
+                    ((brush->flag & BRUSH_DIR_IN) == 0)) &&
                    ELEM(brush->sculpt_tool, SCULPT_TOOL_DRAW,
                          SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
                          SCULPT_TOOL_PINCH, SCULPT_TOOL_CREASE))
index a569bf469b326d415d76e2f04d3026164c4d632c..58f1ebb9eacbdb0730eb98a2334d2d964653c811 100644 (file)
@@ -5085,7 +5085,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
                ps->blend = brush->blend;
                /* only check for inversion for the soften tool, elsewhere, a resident brush inversion flag can cause issues */
                if (brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
-                       ps->mode = ((ps->mode == BRUSH_STROKE_INVERT) ^ ((brush->flag & BRUSH_DIR_IN) != 0) ?
+                       ps->mode = (((ps->mode == BRUSH_STROKE_INVERT) ^ ((brush->flag & BRUSH_DIR_IN) != 0)) ?
                                    BRUSH_STROKE_INVERT : BRUSH_STROKE_NORMAL);
 
                        ps->blurkernel = paint_new_blur_kernel(brush, true);
index 0e75a344699b1984aa5ad1295acd4035986d8b1f..ede90b6e1f1a9ac85bbbec8028954aea5b5d515c 100644 (file)
@@ -1200,7 +1200,7 @@ static float brush_strength(const Sculpt *sd, const StrokeCache *cache, const fl
        /* Primary strength input; square it to make lower values more sensitive */
        const float root_alpha = BKE_brush_alpha_get(scene, brush);
        float alpha        = root_alpha * root_alpha;
-       float dir          = brush->flag & BRUSH_DIR_IN ? -1 : 1;
+       float dir          = (brush->flag & BRUSH_DIR_IN) ? -1 : 1;
        float pressure     = BKE_brush_use_alpha_pressure(scene, brush) ? cache->pressure : 1;
        float pen_flip     = cache->pen_flip ? -1 : 1;
        float invert       = cache->invert ? -1 : 1;
index c3bd657badfbdf13f949ab559ab104e5c78439b1..d5a811c84f5765fc3b3eff3bf5d1abdbf5257c12 100644 (file)
@@ -5778,7 +5778,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
        PTCacheEditPoint *point;
        PTCacheEditKey *key;
        ParticleEditSettings *pset = PE_settings(scene);
-       int i, k, totpoint = edit->totpoint, timed = pset->flag & PE_FADE_TIME ? pset->fade_frames : 0;
+       int i, k, totpoint = edit->totpoint, timed = (pset->flag & PE_FADE_TIME) ? pset->fade_frames : 0;
        int totkeys = 1;
        float sel_col[3];
        float nosel_col[3];
@@ -5918,7 +5918,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
                                                glColor3fv(nosel_col);
                                        /* has to be like this.. otherwise selection won't work, have try glArrayElement later..*/
                                        glBegin(GL_POINTS);
-                                       glVertex3fv(key->flag & PEK_USE_WCO ? key->world_co : key->co);
+                                       glVertex3fv((key->flag & PEK_USE_WCO) ? key->world_co : key->co);
                                        glEnd();
                                }
                        }
index b55a5ffbdbb2ace29d625b1d96eaabb748783dc9..acc6108f2642d647e54702f51c272537866d2ef7 100644 (file)
@@ -512,7 +512,7 @@ static int calc_manipulator_stats(const bContext *C)
 
                                for (k = 0, ek = point->keys; k < point->totkey; k++, ek++) {
                                        if (ek->flag & PEK_SELECT) {
-                                               calc_tw_center(scene, ek->flag & PEK_USE_WCO ? ek->world_co : ek->co);
+                                               calc_tw_center(scene, (ek->flag & PEK_USE_WCO) ? ek->world_co : ek->co);
                                                totsel++;
                                        }
                                }
index fa16ebbb5dad9ad7089a03406fd3b7c588630a0b..826004217363eb8d1b12e97e2971552cce1d696f 100644 (file)
@@ -771,7 +771,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
 
        for (i = 0; i < curdupface; i++) {
                mf = CDDM_get_tessface(splitdm, i);
-               test_index_face(mf, &splitdm->faceData, i, (mf->flag & ME_FACE_SEL ? 4 : 3));
+               test_index_face(mf, &splitdm->faceData, i, ((mf->flag & ME_FACE_SEL) ? 4 : 3));
        }
 
        BLI_edgehash_free(edgehash, NULL);
index 4fa86527334270848f5b1d1a8bb11701c67aa1f2..ee23469a13104c9140df77af10db95792463eff1 100644 (file)
@@ -148,7 +148,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        unsigned int i, j;
        unsigned int i1, i2;
        unsigned int step_tot = use_render_params ? ltmd->render_steps : ltmd->steps;
-       const bool do_flip = ltmd->flag & MOD_SCREW_NORMAL_FLIP ? 1 : 0;
+       const bool do_flip = (ltmd->flag & MOD_SCREW_NORMAL_FLIP) != 0;
 
        const int quad_ord[4] = {
            do_flip ? 3 : 0,
index 01e592cba0c9022f9a2d627b160f98d8b073e3b0..d080ddcc37504884ba88659a3f0f2d7e581551d3 100644 (file)
@@ -197,7 +197,7 @@ static void RE_rayobject_instance_bb(RayObject *o, float *min, float *max)
 
        //There must be a faster way than rotating all the 8 vertexs of the BB
        for (i = 0; i < 8; i++) {
-               for (j = 0; j < 3; j++) t[j] = i & (1 << j) ? M[j] : m[j];
+               for (j = 0; j < 3; j++) t[j] = (i & (1 << j)) ? M[j] : m[j];
                mul_m4_v3(obj->target2global, t);
                DO_MINMAX(t, min, max);
        }