code cleanup: double promotion & some style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Thu, 3 May 2012 21:35:04 +0000 (21:35 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 3 May 2012 21:35:04 +0000 (21:35 +0000)
39 files changed:
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/mesh.c
source/blender/editors/armature/editarmature.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_slide.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/screen/area.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_input.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesrna/intern/rna_tracking.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

index a6666bf4faef332e7b13c7e4ac6097064f17e71e..bd079238b12ed4731736fa7a55a6883d6d0bb5ce 100644 (file)
@@ -586,7 +586,7 @@ static int layerEqual_mloopcol(void *data1, void *data2)
        b = m1->b - m2->b;
        a = m1->a - m2->a;
 
-       return r*r + g*g + b*b + a*a < 0.001;
+       return r * r + g * g + b * b + a * a < 0.001f;
 }
 
 static void layerMultiply_mloopcol(void *data, float fac)
index fdeb212b561d07101a3f62bbbaace1a1c4631ea1..40c04a170ca8ecceb4355691e8f1ea68e5907ce2 100644 (file)
@@ -2014,7 +2014,7 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex,
                
                        for (i=0; i<tot; i++, disps += side*side, ld++) {
                                ld->totdisp = side*side;
-                               ld->level = (int)(logf(side - 1.0f) / M_LN2) + 1;
+                               ld->level = (int)(logf(side - 1.0f) / (float)M_LN2) + 1;
                        
                                if (ld->disps)
                                        MEM_freeN(ld->disps);
index eb821ffc14740091401ec773106bd2dd574b51f3..a2e95622bcf2c499b9d66630d8c6fc9f0a694817 100644 (file)
@@ -4096,7 +4096,7 @@ static void select_similar_direction(bArmature *arm, EditBone *ebone_act, const
                        float dir[3];
                        sub_v3_v3v3(dir, ebone->head, ebone->tail);
 
-                       if (angle_v3v3(dir_act, dir) / M_PI < thresh) {
+                       if (angle_v3v3(dir_act, dir) / (float)M_PI < thresh) {
                                ED_armature_edit_bone_select(ebone);
                        }
                }
index c2a97b3ea70279a392d3d33370c4beab5f0a28a8..60c0ebbc7b302e128456c9f7fb767d6c725c1364 100644 (file)
@@ -475,7 +475,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
        
        ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &view_aligned);
        if (!view_aligned)
-               rot[0] += M_PI / 2.0f;
+               rot[0] += (float)M_PI / 2.0f;
        
        make_prim_init(C, "Monkey", &dia, mat, &state, loc, rot, layer);
 
index 2208d96ca46a0f1b67636ea381943a263c79bf23..b215f0ac3451ebdac78a2346421c83a1717156c3 100644 (file)
@@ -1412,7 +1412,7 @@ static KnifeEdge *knife_find_closest_edge(KnifeTool_OpData *kcd, float p[3], flo
        float co[3], cageco[3], sco[3], maxdist = knife_snap_size(kcd, kcd->ethresh);
 
        if (kcd->ignore_vert_snapping)
-               maxdist *= 0.5;
+               maxdist *= 0.5f;
 
        f = knife_find_closest_face(kcd, co, cageco, NULL);
        *is_space = !f;
@@ -1502,7 +1502,7 @@ static KnifeVert *knife_find_closest_vert(KnifeTool_OpData *kcd, float p[3], flo
        float co[3], cageco[3], sco[3], maxdist = knife_snap_size(kcd, kcd->vthresh);
 
        if (kcd->ignore_vert_snapping)
-               maxdist *= 0.5;
+               maxdist *= 0.5f;
 
        f = knife_find_closest_face(kcd, co, cageco, is_space);
 
index 32e70e798feb51442074db11e5f5ace9ebe9f44b..d38ec6436b9b99ef032ebc7fcd6a565d6e6e4a2b 100644 (file)
@@ -1129,7 +1129,7 @@ static float edgetag_cut_cost(BMEditMesh *UNUSED(em), BMEdge *e1, BMEdge *e2, BM
        /* but is biased to give higher values to sharp turns, so that it will take
         * paths with fewer "turns" when selecting between equal-weighted paths between
         * the two edges */
-       cost = cost + 0.5f * cost * (2.0f - sqrt(fabs(dot_v3v3(d1, d2))));
+       cost = cost + 0.5f * cost * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2))));
 
        return cost;
 }
@@ -2294,7 +2294,7 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
        float sharp = RNA_float_get(op->ptr, "sharpness");
        int i;
 
-       sharp = (sharp * M_PI) / 180.0;
+       sharp = (sharp * (float)M_PI) / 180.0f;
 
        BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) {
                BM_elem_flag_disable(f, BM_ELEM_TAG);
index 36ce610c64b4804c387845ea20bcf0d0f4636a6a..a86a274eb70db158cb1ba8d1eee1e2709f000ae8 100644 (file)
@@ -279,7 +279,7 @@ static void vtx_slide_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
                /* Get 3d view */
                View3D *view3d = CTX_wm_view3d(C);
                const float outline_w = UI_GetThemeValuef(TH_OUTLINE_WIDTH) + 0.8f;
-               const float pt_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) + 1.5;
+               const float pt_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) + 1.5f;
 
                int i = 0;
 
index c6b899bfd37346bd65a33c731a556791f9b8a4af..524ee02933945a3c905adb82c3e41621c4b04559 100644 (file)
@@ -2346,7 +2346,7 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
                        if (!BM_elem_flag_test(ev, BM_ELEM_HIDDEN)) {
                                switch (mode) {
                                        case -1: /* aligned */
-                                               if (fabs(ev->co[axis] - value) < limit)
+                                               if (fabsf(ev->co[axis] - value) < limit)
                                                        BM_vert_select_set(em->bm, ev, TRUE);
                                                break;
                                        case 0: /* neg */
@@ -2593,21 +2593,21 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
                                m1 = MAXSLOPE;
                                b1 = x12;
                        }
-                       x2max = MAX2(x21, x22) + 0.001; /* prevent missed edges   */
-                       x2min = MIN2(x21, x22) - 0.001; /* due to round off error */
-                       y2max = MAX2(y21, y22) + 0.001;
-                       y2min = MIN2(y21, y22) - 0.001;
+                       x2max = MAX2(x21, x22) + 0.001f; /* prevent missed edges   */
+                       x2min = MIN2(x21, x22) - 0.001f; /* due to round off error */
+                       y2max = MAX2(y21, y22) + 0.001f;
+                       y2min = MIN2(y21, y22) - 0.001f;
                        
                        /* Found an intersect,  calc intersect point */
                        if (m1 == m2) { /* co-incident lines */
                                /* cut at 50% of overlap area */
                                x1max = MAX2(x11, x12);
                                x1min = MIN2(x11, x12);
-                               xi = (MIN2(x2max, x1max) + MAX2(x2min, x1min)) / 2.0;
+                               xi = (MIN2(x2max, x1max) + MAX2(x2min, x1min)) / 2.0f;
                                
                                y1max = MAX2(y11, y12);
                                y1min = MIN2(y11, y12);
-                               yi = (MIN2(y2max, y1max) + MAX2(y2min, y1min)) / 2.0;
+                               yi = (MIN2(y2max, y1max) + MAX2(y2min, y1min)) / 2.0f;
                        }
                        else if (m2 == MAXSLOPE) {
                                xi = x22;
@@ -4034,7 +4034,7 @@ static int edbm_noise_exec(bContext *C, wmOperator *op)
 
        if (tex->type == TEX_STUCCI) {
                float b2, vec[3];
-               float ofs = tex->turbul / 200.0;
+               float ofs = tex->turbul / 200.0f;
                BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
                                b2 = BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]);
@@ -4121,7 +4121,7 @@ static int edbm_bevel_exec(bContext *C, wmOperator *op)
                w[i] = s;
                ftot += s;
 
-               df *= 2.0;
+               df *= 2.0f;
        }
 
        mul_vn_fl(w, recursion, 1.0f / (float)ftot);
index 2ebeb9ca22477667fd324f3f3e078324cab11d41..a17f335091bbc827bee79aecb6f065c81649230a 100644 (file)
@@ -671,7 +671,7 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, int do_face_idx
                                
                                sub_v2_v2v2(uvdiff, uv2, uv);
 
-                               if (fabs(uvdiff[0]) < limit[0] && fabs(uvdiff[1]) < limit[1]) {
+                               if (fabsf(uvdiff[0]) < limit[0] && fabsf(uvdiff[1]) < limit[1]) {
                                        if (lastv) lastv->next = next;
                                        else vlist = next;
                                        iterv->next = newvlist;
index fb9b012a31a39268b6e200ddefde85a77d5602a6..f611a985797b1f6692d7dc82981c8b7dc47de4d6 100644 (file)
@@ -275,11 +275,11 @@ int ED_mesh_uv_loop_reset_ex(struct bContext *C, struct Mesh *me, const int laye
                else if (len > 2) {
                        float fac = 0.0f, dfac = 1.0f / (float)len;
 
-                       dfac *= M_PI * 2;
+                       dfac *= (float)M_PI * 2.0f;
 
                        for (i = 0; i < len; i++) {
-                               fuvs[i][0] = 0.5f * sin(fac) + 0.5f;
-                               fuvs[i][1] = 0.5f * cos(fac) + 0.5f;
+                               fuvs[i][0] = 0.5f * sinf(fac) + 0.5f;
+                               fuvs[i][1] = 0.5f * cosf(fac) + 0.5f;
 
                                fac += dfac;
                        }
index b4d5d2c1c7935364e36c782a60fded16fd2bca67..acafe62150f1be8854656d6d1739a07b3c3a21f4 100644 (file)
@@ -1257,7 +1257,7 @@ static void vgroup_blend(Object *ob, const float fac)
        int i, dvert_tot = 0;
        const int def_nr = ob->actdef - 1;
 
-       BLI_assert(fac >= 0.0 && fac <= 1.0f);
+       BLI_assert(fac >= 0.0f && fac <= 1.0f);
 
        if (ob->type != OB_MESH) {
                return;
index 772c114e6d6c761665c5c0c13711ad0b0e93f495..2fa1e759e21746160957c22a1fd047587b3ef3e0 100644 (file)
@@ -172,8 +172,8 @@ static void area_draw_azone(short x1, short y1, short x2, short y2)
        int dx = x2 - x1;
        int dy = y2 - y1;
 
-       dx= copysign(ceil(0.3f*fabs(dx)), dx);
-       dy= copysign(ceil(0.3f*fabs(dy)), dy);
+       dx = copysign(ceilf(0.3f * fabsf(dx)), dx);
+       dy = copysign(ceilf(0.3f * fabsf(dy)), dy);
 
        glEnable(GL_BLEND);
        glEnable(GL_LINE_SMOOTH);
index 4545c498fed7009832ae2fa6654817f70454469b..707d5b2aa7c204c9e97c446adcc5c4110693e04f 100644 (file)
@@ -207,8 +207,8 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float
                        float strength;
                        strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
 
-                       sculptdata->uv[i].uv[0] = (1.0 - strength) * sculptdata->uv[i].uv[0] + strength * (tmp_uvdata[i].p[0] - 0.5f * (tmp_uvdata[i].b[0] + tmp_uvdata[i].sum_b[0] / tmp_uvdata[i].ncounter));
-                       sculptdata->uv[i].uv[1] = (1.0 - strength) * sculptdata->uv[i].uv[1] + strength * (tmp_uvdata[i].p[1] - 0.5f * (tmp_uvdata[i].b[1] + tmp_uvdata[i].sum_b[1] / tmp_uvdata[i].ncounter));
+                       sculptdata->uv[i].uv[0] = (1.0f - strength) * sculptdata->uv[i].uv[0] + strength * (tmp_uvdata[i].p[0] - 0.5f * (tmp_uvdata[i].b[0] + tmp_uvdata[i].sum_b[0] / tmp_uvdata[i].ncounter));
+                       sculptdata->uv[i].uv[1] = (1.0f - strength) * sculptdata->uv[i].uv[1] + strength * (tmp_uvdata[i].p[1] - 0.5f * (tmp_uvdata[i].b[1] + tmp_uvdata[i].sum_b[1] / tmp_uvdata[i].ncounter));
 
                        for (element = sculptdata->uv[i].element; element; element = element->next) {
                                MLoopUV *luv;
@@ -271,8 +271,8 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul
                        float strength;
                        strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
 
-                       sculptdata->uv[i].uv[0] = (1.0 - strength) * sculptdata->uv[i].uv[0] + strength * tmp_uvdata[i].p[0];
-                       sculptdata->uv[i].uv[1] = (1.0 - strength) * sculptdata->uv[i].uv[1] + strength * tmp_uvdata[i].p[1];
+                       sculptdata->uv[i].uv[0] = (1.0f - strength) * sculptdata->uv[i].uv[0] + strength * tmp_uvdata[i].p[0];
+                       sculptdata->uv[i].uv[1] = (1.0f - strength) * sculptdata->uv[i].uv[1] + strength * tmp_uvdata[i].p[1];
 
                        for (element = sculptdata->uv[i].element; element; element = element->next) {
                                MLoopUV *luv;
@@ -347,8 +347,8 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
                                strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
                                normalize_v2(diff);
 
-                               sculptdata->uv[i].uv[0] -= strength * diff[0] * 0.001;
-                               sculptdata->uv[i].uv[1] -= strength * diff[1] * 0.001;
+                               sculptdata->uv[i].uv[0] -= strength * diff[0] * 0.001f;
+                               sculptdata->uv[i].uv[1] -= strength * diff[1] * 0.001f;
 
                                for (element = sculptdata->uv[i].element; element; element = element->next) {
                                        MLoopUV *luv;
index ec383e1dbdbcf5c22f5bcc23d27049e012f9aef5..e1828bbef32299ba714f4274554ba6480e855723 100644 (file)
@@ -313,15 +313,15 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
                                double scalar = bUnit_GetScaler(usys, i);
 
                                dx_scalar = dx * scalar / unit->scale_length;
-                               if (dx_scalar < (GRID_MIN_PX * 2))
+                               if (dx_scalar < (GRID_MIN_PX * 2.0))
                                        continue;
 
                                /* Store the smallest drawn grid size units name so users know how big each grid cell is */
                                if (*grid_unit == NULL) {
                                        *grid_unit = bUnit_GetNameDisplay(usys, i);
-                                       rv3d->gridview = (scalar * v3d->grid) / unit->scale_length;
+                                       rv3d->gridview = (float)((scalar * v3d->grid) / (double)unit->scale_length);
                                }
-                               blend_fac = 1 - ((GRID_MIN_PX * 2) / dx_scalar);
+                               blend_fac = 1.0f - ((GRID_MIN_PX * 2.0f) / (float)dx_scalar);
 
                                /* tweak to have the fade a bit nicer */
                                blend_fac = (blend_fac * blend_fac) * 2.0f;
@@ -355,7 +355,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
                                        }
                                }
                                else {  // start blending out
-                                       UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
+                                       UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6.0f));
                                        drawgrid_draw(ar, wx, wy, x, y, dx);
 
                                        UI_ThemeColor(TH_GRID);
@@ -363,7 +363,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
                                }
                        }
                        else {  // start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX*10))
-                               UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
+                               UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6.0f));
                                drawgrid_draw(ar, wx, wy, x, y, dx);
 
                                UI_ThemeColor(TH_GRID);
index 44fee7d663dca8f00dc060f844e83f5c58036aec..39cda3efd9308aa0b8939fdcea36d0ce22615033 100644 (file)
@@ -696,7 +696,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
                        if (dot_v3v3(xaxis, m_inv[0]) < 0) {
                                negate_v3(xaxis);
                        }
-                       fac = angle_normalized_v3v3(zvec_global, m_inv[2]) / M_PI;
+                       fac = angle_normalized_v3v3(zvec_global, m_inv[2]) / (float)M_PI;
                        fac = fabsf(fac - 0.5f) * 2;
                        fac = fac * fac;
                        interp_v3_v3v3(xaxis, xaxis, m_inv[0], fac);
index 8a211c6a22e58bc5db64cecb5d625b36914b58bd..f106fcc268e20c6c66a269d9978b15029e498663 100644 (file)
@@ -2199,7 +2199,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f
        int bbsel;
        CircleSelectUserData data;
        
-       bbsel = EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0));
+       bbsel = EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
 
        vc->em = BMEdit_FromObject(vc->obedit);
@@ -2250,7 +2250,7 @@ static void paint_facesel_circle_select(ViewContext *vc, int select, const int m
        if (me) {
                bm_vertoffs = me->totpoly + 1; /* max index array */
 
-               /* bbsel= */ /* UNUSED */ EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0));
+               /* bbsel= */ /* UNUSED */ EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
                edbm_backbuf_check_and_select_tfaces(me, select == LEFTMOUSE);
                EDBM_backbuf_free();
        }
index 5ee3e4bb96ddc51fa9f2a8372c74d8b9383ffc9b..599d4a559edec97ac4d09b26a87fc86798520a38 100644 (file)
@@ -3694,9 +3694,9 @@ void flushTransGraphData(TransInfo *t)
                        switch (sipo->autosnap) {
                                case SACTSNAP_FRAME: /* snap to nearest frame (or second if drawing seconds) */
                                        if (sipo->flag & SIPO_DRAWTIME)
-                                               td2d->loc[0]= (float)(floor((td2d->loc[0]/secf) + 0.5f) * secf);
+                                               td2d->loc[0] = (float)(floorf((td2d->loc[0]/secf) + 0.5f) * secf);
                                        else
-                                               td2d->loc[0]= (float)(floor(td2d->loc[0]+0.5f));
+                                               td2d->loc[0] = (float)(floorf(td2d->loc[0]+0.5f));
                                        break;
                                
                                case SACTSNAP_MARKER: /* snap to nearest marker */
index 0bf02d1a2bff925b036ff32f87c4428940dfb7c4..bea1002b5c69958af02425243585c327df4bbd4a 100644 (file)
@@ -204,16 +204,16 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
                                                }
                                                
                                                if (axis & 2) {
-                                                       if (fabs(iloc[1])<=tolerance[1] ||
-                                                          loc[1]*iloc[1]<0.0f)
+                                                       if (fabsf(iloc[1]) <= tolerance[1] ||
+                                                          loc[1] * iloc[1]<0.0f)
                                                        {
                                                                loc[1]= 0.0f;
                                                                clip = 1;
                                                        }
                                                }
                                                if (axis & 4) {
-                                                       if (fabs(iloc[2])<=tolerance[2] ||
-                                                          loc[2]*iloc[2]<0.0f)
+                                                       if (fabsf(iloc[2]) <= tolerance[2] ||
+                                                          loc[2] * iloc[2] < 0.0f)
                                                        {
                                                                loc[2]= 0.0f;
                                                                clip = 1;
@@ -541,12 +541,12 @@ static void recalcData_nla(TransInfo *t)
                switch (snla->autosnap) {
                        case SACTSNAP_FRAME: /* snap to nearest frame/time  */
                                if (snla->flag & SNLA_DRAWTIME) {
-                                       tdn->h1[0]= (float)( floor((tdn->h1[0]/secf) + 0.5f) * secf );
-                                       tdn->h2[0]= (float)( floor((tdn->h2[0]/secf) + 0.5f) * secf );
+                                       tdn->h1[0] = (float)(floor(((double)tdn->h1[0] / secf) + 0.5) * secf);
+                                       tdn->h2[0] = (float)(floor(((double)tdn->h2[0] / secf) + 0.5) * secf);
                                }
                                else {
-                                       tdn->h1[0]= (float)( floor(tdn->h1[0]+0.5f) );
-                                       tdn->h2[0]= (float)( floor(tdn->h2[0]+0.5f) );
+                                       tdn->h1[0] = floorf(tdn->h1[0] + 0.5f);
+                                       tdn->h2[0] = floorf(tdn->h2[0] + 0.5f);
                                }
                                break;
                        
index 467e3dc600e82bc3ee3e6b651530382847fd6e7a..0f0d1cc8344ff7f4d9889199aeb21ad122adbb7e 100644 (file)
@@ -199,17 +199,17 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mva
                        mdx = (mi->precision_mval[0] + (float)(mval[0] - mi->precision_mval[0]) / 10.0f) - data[2];
                        mdy = (mi->precision_mval[1] + (float)(mval[1] - mi->precision_mval[1]) / 10.0f) - data[3];
 
-                       distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f;
+                       distance = (length != 0.0) ? (mdx * dx + mdy * dy) / length: 0.0;
                }
                else {
                        int mdx, mdy;
                        mdx = mval[0] - data[2];
                        mdy = mval[1] - data[3];
 
-                       distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f;
+                       distance = (length != 0.0) ? (mdx * dx + mdy * dy) / length: 0.0;
                }
 
-               output[0] = (float)((length != 0.0f)? distance / length: 0.0f);
+               output[0] = (length != 0.0) ? (double)(distance / length) : 0.0f;
        }
 }
 
index fb7e2254e45eef51b5e9ac12c0ee9f0dd97c7450..a90f82536549782775bc83cf1dc0b119235af54e 100644 (file)
@@ -855,7 +855,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                glDisable(GL_BLEND);
 
                /* draw vert preview */
-               glPointSize(pointsize * 2.0);
+               glPointSize(pointsize * 2.0f);
                UI_ThemeColor4(TH_STITCH_PREVIEW_STITCHABLE);
                glVertexPointer(2, GL_FLOAT, 0, stitch_preview->preview_stitchable);
                glDrawArrays(GL_POINTS, 0, stitch_preview->num_stitchable);
index 1073369a36d0c10bbe0b8fe096979a47face5d47..b515f30e1508fa672addfb3d92783f5a7f881120 100644 (file)
@@ -799,9 +799,9 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em,
                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
 
                        if (penalty && uvedit_uv_select_test(em, scene, l))
-                               dist = fabs(co[0] - luv->uv[0]) + penalty[0] + fabs(co[1] - luv->uv[1]) + penalty[1];
+                               dist = fabsf(co[0] - luv->uv[0]) + penalty[0] + fabsf(co[1] - luv->uv[1]) + penalty[1];
                        else
-                               dist = fabs(co[0] - luv->uv[0]) + fabs(co[1] - luv->uv[1]);
+                               dist = fabsf(co[0] - luv->uv[0]) + fabsf(co[1] - luv->uv[1]);
 
                        if (dist <= mindist) {
                                if (dist == mindist)
index 9474ae95c3418753ec4229752b56857c4f341e1f..b30821dc56a0abb683cc5e7f7c13b81cf38d1a3b 100644 (file)
@@ -257,8 +257,8 @@ static void stitch_uv_rotate(float rotation, float medianPoint[2], float uv[2])
        uv[0] -= medianPoint[0];
        uv[1] -= medianPoint[1];
 
-       uv_rotation_result[0] = cos(rotation) * uv[0] - sin(rotation) * uv[1];
-       uv_rotation_result[1] = sin(rotation) * uv[0] + cos(rotation) * uv[1];
+       uv_rotation_result[0] = cosf(rotation) * uv[0] - sinf(rotation) * uv[1];
+       uv_rotation_result[1] = sinf(rotation) * uv[0] + cosf(rotation) * uv[1];
 
        uv[0] = uv_rotation_result[0] + medianPoint[0];
        uv[1] = uv_rotation_result[1] + medianPoint[1];
@@ -286,8 +286,8 @@ static int stitch_check_uvs_stitchable(UvElement *element, UvElement *element_it
                l_iter = element_iter->l;
                luv_iter = CustomData_bmesh_get(&state->em->bm->ldata, l_iter->head.data, CD_MLOOPUV);
 
-               if (fabs(luv_orig->uv[0] - luv_iter->uv[0]) < limit &&
-                   fabs(luv_orig->uv[1] - luv_iter->uv[1]) < limit)
+               if (fabsf(luv_orig->uv[0] - luv_iter->uv[0]) < limit &&
+                   fabsf(luv_orig->uv[1] - luv_iter->uv[1]) < limit)
                {
                        return 1;
                }
@@ -403,7 +403,7 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta
        edgecos = uv1[0] * uv2[0] + uv1[1] * uv2[1];
        edgesin = uv1[0] * uv2[1] - uv2[0] * uv1[1];
 
-       rotation = (edgesin > 0) ? acos(MAX2(-1.0, MIN2(1.0, edgecos))) : -acos(MAX2(-1.0, MIN2(1.0, edgecos)));
+       rotation = (edgesin > 0.0f) ? acosf(MAX2(-1.0f, MIN2(1.0f, edgecos))) : -acosf(MAX2(-1.0f, MIN2(1.0f, edgecos)));
 
        island_stitch_data[element1->island].num_rot_elements++;
        island_stitch_data[element1->island].rotation += rotation;
@@ -412,7 +412,7 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta
 
 static void stitch_island_calculate_vert_rotation(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data)
 {
-       float edgecos = 1, edgesin = 0;
+       float edgecos = 1.0f, edgesin = 0.0f;
        int index;
        UvElement *element_iter;
        float rotation = 0;
@@ -441,12 +441,12 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
                        negate_v2_v2(normal, state->normals + index_tmp2 * 2);
                        edgecos = dot_v2v2(normal, state->normals + index_tmp1 * 2);
                        edgesin = cross_v2v2(normal, state->normals + index_tmp1 * 2);
-                       rotation += (edgesin > 0) ? acos(edgecos) : -acos(edgecos);
+                       rotation += (edgesin > 0.0f) ? acosf(edgecos) : -acosf(edgecos);
                }
        }
 
        if (state->midpoints)
-               rotation /= 2.0;
+               rotation /= 2.0f;
        island_stitch_data[element->island].num_rot_elements++;
        island_stitch_data[element->island].rotation += rotation;
 }
@@ -1364,7 +1364,7 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
                case PADPLUSKEY:
                case WHEELUPMOUSE:
                        if (event->alt) {
-                               stitch_state->limit_dist += 0.01;
+                               stitch_state->limit_dist += 0.01f;
                                if (!stitch_process_data(stitch_state, scene, 0)) {
                                        return stitch_cancel(C, op);
                                }
@@ -1377,8 +1377,8 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
                case PADMINUS:
                case WHEELDOWNMOUSE:
                        if (event->alt) {
-                               stitch_state->limit_dist -= 0.01;
-                               stitch_state->limit_dist = MAX2(0.01, stitch_state->limit_dist);
+                               stitch_state->limit_dist -= 0.01f;
+                               stitch_state->limit_dist = MAX2(0.01f, stitch_state->limit_dist);
                                if (!stitch_process_data(stitch_state, scene, 0)) {
                                        return stitch_cancel(C, op);
                                }
index 743869e82cce55c73b31a559cd30830f46e74596..b2c7dd59f1d5491e57dc3185bcfac436a6333433 100644 (file)
@@ -1027,7 +1027,7 @@ static void correct_uv_aspect(BMEditMesh *em)
                        
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                               luv->uv[0] = ((luv->uv[0] - 0.5) * scale) + 0.5;
+                               luv->uv[0] = ((luv->uv[0] - 0.5f) * scale) + 0.5f;
                        }
                }
        }
@@ -1040,7 +1040,7 @@ static void correct_uv_aspect(BMEditMesh *em)
                        
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                               luv->uv[1] = ((luv->uv[1] - 0.5) * scale) + 0.5;
+                               luv->uv[1] = ((luv->uv[1] - 0.5f) * scale) + 0.5f;
                        }
                }
        }
index 1737f3b79e692781c0ad2251b9daaaf67cb72e04..06eefc36723d04f57e4eb87ffa0c088ac798ae17 100644 (file)
@@ -133,9 +133,8 @@ typedef struct Library {
                                                         * some cases its useful to access the absolute one,
                                                         * This is set on file read.
                                                         * Use BKE_library_filepath_set() rather than
-                                                        * setting 'name' directly and it will be kepk in
+                                                        * setting 'name' directly and it will be kept in
                                                         * sync - campbell */
-       int tot, pad;                   /* tot, idblock and filedata are only fo read and write */
        struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */
 } Library;
 
@@ -151,7 +150,7 @@ typedef struct PreviewImage {
        unsigned int h[2];
        short changed[2];
        short changed_timestamp[2];
-       unsigned int * rect[2];
+       unsigned int *rect[2];
 } PreviewImage;
 
 /**
@@ -255,4 +254,3 @@ typedef struct PreviewImage {
 #endif
 
 #endif
-
index de2c9919df08711906074e044a12c18426254e19..dfc70e5bd661f18e9b66589ed17aeec6e0b87834 100644 (file)
@@ -92,8 +92,8 @@ typedef struct Image {
        unsigned int bindcode;  /* only for current image... */
        unsigned int *repbind;  /* for repeat of parts of images */
        
-       struct PackedFile * packedfile;
-       struct PreviewImage * preview;
+       struct PackedFile *packedfile;
+       struct PreviewImage *preview;
 
        /* game engine tile animation */
        float lastupdate;
@@ -141,4 +141,3 @@ typedef struct Image {
 #define IMA_GEN_FLOAT          1
 
 #endif
-
index 85adf5247177cba017bc34661df5e61a48d549d3..5eb4e2190e43a9e5d63dc491a800e222ad58dc92 100644 (file)
@@ -265,7 +265,7 @@ static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value)
        if (clip->lastsize[0])
                value = clip->lastsize[0]*value/camera->sensor_width;
 
-       if (value >= 0.0001)
+       if (value >= 0.0001f)
                camera->focal = value;
 }
 
index 711c7e6e4ffd3d37c71d30690ac84da534d808ff..8d6295ee6d4d4b2d226f3680b6fce678aa7d9005 100644 (file)
@@ -113,7 +113,7 @@ static void VertexIt_Fill(CSG_IteratorPtr it, CSG_IVertex *vert)
 static void VertexIt_Step(CSG_IteratorPtr it)
 {
        VertexIt * iterator = (VertexIt *)it;
-       iterator->pos ++;
+       iterator->pos++;
 } 
  
 static void VertexIt_Reset(CSG_IteratorPtr it)
@@ -207,7 +207,7 @@ static void FaceIt_Fill(CSG_IteratorPtr it, CSG_IFace *face)
 static void FaceIt_Step(CSG_IteratorPtr it)
 {
        FaceIt * face_it = (FaceIt *)it;                
-       face_it->pos ++;
+       face_it->pos++;
 }
 
 static void FaceIt_Reset(CSG_IteratorPtr it)
@@ -441,7 +441,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
 
                                        mat_nr = 0;
                                        for (a = 0; a < ob1->totcol; a++) {
-                                               if (give_current_material(ob1, a+1) == orig_mat) {
+                                               if (give_current_material(ob1, a + 1) == orig_mat) {
                                                        mat_nr = a;
                                                        break;
                                                }
@@ -601,7 +601,7 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type)
        dm_select = mesh_create_derived_view(scene, ob_select, 0); // no modifiers in editmode ??
 
        maxmat= ob->totcol + ob_select->totcol;
-       mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat");
+       mat = (Material **)MEM_mallocN(sizeof(Material *) * maxmat, "NewBooleanMeshMat");
        
        /* put some checks in for nice user feedback */
        if (dm == NULL || dm_select == NULL) {
@@ -632,7 +632,7 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type)
 
        /* add materials to object */
        for (a = 0; a < totmat; a++)
-               assign_material(ob_new, mat[a], a+1);
+               assign_material(ob_new, mat[a], a + 1);
 
        MEM_freeN(mat);
 
index d5d8439c7496b0980b3970331886d1e325103c87..1bc23ab5040d12acc5c0505616bd9373228d5ba7 100644 (file)
@@ -113,7 +113,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, Scene *scene, Ob
                                CollisionModifierData *coll_clmd = (CollisionModifierData *)modifiers_findByType(ob1, eModifierType_Collision);
                                if (coll_clmd) {
                                        DagNode *curNode = dag_get_node(forest, ob1);
-                                       dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Cloth Collision");
+                                       dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Cloth Collision");
                                }
                        }
                }
index 83a366815def4ad0975ddad67ce02da9bd83a26b..9636104cb06dc0dad8676cbb78395ae7e938d99e 100644 (file)
@@ -117,7 +117,7 @@ static void deformVerts(ModifierData *md, Object *ob,
        
        /* if possible use/create DerivedMesh */
        if (derivedData) dm = CDDM_copy(derivedData);
-       else if (ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+       else if (ob->type == OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
        
        if (!ob->pd) {
                printf("CollisionModifier deformVerts: Should not happen!\n");
@@ -138,7 +138,7 @@ static void deformVerts(ModifierData *md, Object *ob,
                
                numverts = dm->getNumVerts (dm);
                
-               if ((current_time > collmd->time_xnew)|| (BKE_ptcache_get_continue_physics())) {
+               if ((current_time > collmd->time_xnew) || (BKE_ptcache_get_continue_physics())) {
                        unsigned int i;
 
                        // check if mesh has changed
@@ -148,7 +148,7 @@ static void deformVerts(ModifierData *md, Object *ob,
                        if (collmd->time_xnew == -1000) { /* first time */
                                collmd->x = dm->dupVertArray(dm); // frame start position
                                
-                               for ( i = 0; i < numverts; i++ ) {
+                               for (i = 0; i < numverts; i++) {
                                        // we save global positions
                                        mul_m4_v3(ob->obmat, collmd->x[i].co);
                                }
index f55faf9c18342b15db341f063596fda1e9c9ee78..e1a8e2214760e7aca6d8063c52f8e83e147e2c59 100644 (file)
@@ -140,7 +140,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
                        /* we assume the decim_faces tells how much to reduce */
 
                        while (lod.face_num > numTris*dmd->percent) {
-                               if ( LOD_CollapseEdge(&lod)==0) break;
+                               if ( LOD_CollapseEdge(&lod) == 0) break;
                        }
 
                        if (lod.vertex_num>2) {
@@ -160,7 +160,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 
                        if (lod.vertex_num>2) {
                                mface = CDDM_get_tessfaces(result);
-                               for (a=0; a<lod.face_num; a++) {
+                               for (a = 0; a < lod.face_num; a++) {
                                        MFace *mf = &mface[a];
                                        int *tri = &lod.triangle_index_buffer[a*3];
                                        mf->v1 = tri[0];
index 70294588fd49b9e29b94c1413e2aad9ed9a2e77b..4d9b8de061e926383472ebb7e7af7f81ee016990 100644 (file)
@@ -189,7 +189,7 @@ static void displaceModifier_do(
 
        modifier_init_texture(dmd->modifier.scene, dmd->texture);
 
-       for (i = 0; i < numVerts; ++i) {
+       for (i = 0; i < numVerts; i++) {
                TexResult texres;
                float delta = 0, strength = dmd->strength;
 
index def02081be8c41393e17366c525d7d7803578261..3e399707040268dc569854ed38d74e1d3551bc3f 100644 (file)
@@ -64,7 +64,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj
        BMEditMesh *em;
        BMIter iter;
        BMEdge *e;
-       float threshold = cos((emd->split_angle + 0.00001) * M_PI / 180.0);
+       float threshold = cosf((emd->split_angle + 0.00001f) * (float)M_PI / 180.0f);
 
        em = DM_to_editbmesh(dm, NULL, FALSE);
        bm = em->bm;
index b115e5bb244729b5a76a6a5ad2d374c78929d3f2..ef3a6d8217e3efa1a4e04267c16bfb5ce5f34fb9 100644 (file)
@@ -122,7 +122,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
                DagNode *curNode = dag_get_node(forest, hmd->object);
                
                if (hmd->subtarget[0])
-                       dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, "Hook Modifier");
+                       dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Hook Modifier");
                else
                        dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, "Hook Modifier");
        }
@@ -195,9 +195,9 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
                                        for (j = 0; j < numVerts; j++) {
                                                if (origindex_ar[j] == *index_pt) {
                                                        float *co = vertexCos[j];
-                                                       if ((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
+                                                       if ((fac = hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
                                                                if (dvert)
-                                                                       fac *= defvert_find_weight(dvert+j, defgrp_index);
+                                                                       fac *= defvert_find_weight(dvert + j, defgrp_index);
                                                                
                                                                if (fac) {
                                                                        mul_v3_m4v3(vec, mat, co);
@@ -210,12 +210,12 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
                        }
                }
                else { /* missing dm or ORIGINDEX */
-                       for (i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
+                       for (i = 0, index_pt = hmd->indexar; i < hmd->totindex; i++, index_pt++) {
                                if (*index_pt < numVerts) {
                                        float *co = vertexCos[*index_pt];
-                                       if ((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
+                                       if ((fac = hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
                                                if (dvert)
-                                                       fac *= defvert_find_weight(dvert+(*index_pt), defgrp_index);
+                                                       fac *= defvert_find_weight(dvert + (*index_pt), defgrp_index);
                                                
                                                if (fac) {
                                                        mul_v3_m4v3(vec, mat, co);
@@ -227,13 +227,13 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
                }
        }
        else if (dvert) {       /* vertex group hook */
-               const float fac_orig= hmd->force;
+               const float fac_orig = hmd->force;
                
                for (i = 0; i < max_dvert; i++, dvert++) {
                        float fac;
                        float *co = vertexCos[i];
                        
-                       if ((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
+                       if ((fac = hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
                                fac *= defvert_find_weight(dvert, defgrp_index);
                                if (fac) {
                                        mul_v3_m4v3(vec, mat, co);
index 32376acc553d32a0d245f9856bcaf4e533f72297..a8f5f008e0cce70d1cea048e5de0b7a3f4a9e5ec 100644 (file)
@@ -407,7 +407,9 @@ ModifierTypeInfo modifierType_Mask = {
        /* structName */        "MaskModifierData",
        /* structSize */        sizeof(MaskModifierData),
        /* type */              eModifierTypeType_Nonconstructive,
-       /* flags */             eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_SupportsMapping|eModifierTypeFlag_SupportsEditmode,
+       /* flags */             eModifierTypeFlag_AcceptsMesh |
+                               eModifierTypeFlag_SupportsMapping |
+                               eModifierTypeFlag_SupportsEditmode,
 
        /* copyData */          copyData,
        /* deformVerts */       NULL,
index aee8dd21903e22091906e7e7047ab3ba941a5805..1bcafc2918eb7ab0f430585f3c27b3b86f5f8bcc 100644 (file)
@@ -142,24 +142,24 @@ static float meshdeform_dynamic_bind(MeshDeformModifierData *mmd, float (*dco)[3
        size= mmd->dyngridsize;
 
        for (i=0; i<3; i++) {
-               gridvec[i]= (vec[i] - mmd->dyncellmin[i] - mmd->dyncellwidth*0.5f)/mmd->dyncellwidth;
-               ivec[i]= (int)gridvec[i];
-               dvec[i]= gridvec[i] - ivec[i];
+               gridvec[i] = (vec[i] - mmd->dyncellmin[i] - mmd->dyncellwidth*0.5f)/mmd->dyncellwidth;
+               ivec[i] = (int)gridvec[i];
+               dvec[i] = gridvec[i] - ivec[i];
        }
 
        for (i=0; i<8; i++) {
-               if (i & 1) { x= ivec[0]+1; wx= dvec[0]; }
-               else { x= ivec[0]; wx= 1.0f-dvec[0]; } 
+               if (i & 1) { x = ivec[0] + 1; wx = dvec[0]; }
+               else       { x = ivec[0]; wx = 1.0f - dvec[0]; } 
 
-               if (i & 2) { y= ivec[1]+1; wy= dvec[1]; }
-               else { y= ivec[1]; wy= 1.0f-dvec[1]; } 
+               if (i & 2) { y = ivec[1] + 1; wy = dvec[1]; }
+               else       { y = ivec[1];     wy = 1.0f - dvec[1]; } 
 
-               if (i & 4) { z= ivec[2]+1; wz= dvec[2]; }
-               else { z= ivec[2]; wz= 1.0f-dvec[2]; } 
+               if (i & 4) { z = ivec[2] + 1; wz = dvec[2]; }
+               else       { z = ivec[2];     wz = 1.0f - dvec[2]; } 
 
-               CLAMP(x, 0, size-1);
-               CLAMP(y, 0, size-1);
-               CLAMP(z, 0, size-1);
+               CLAMP(x, 0, size - 1);
+               CLAMP(y, 0, size - 1);
+               CLAMP(z, 0, size - 1);
 
                a= x + y*size + z*size*size;
                weight= wx*wy*wz;
@@ -314,7 +314,7 @@ static void meshdeformModifier_do(
                        totweight= 0.0f;
                        zero_v3(co);
 
-                       for (a=offsets[b]; a<offsets[b+1]; a++) {
+                       for (a = offsets[b]; a < offsets[b + 1]; a++) {
                                weight= influences[a].weight;
                                madd_v3_v3fl(co, dco[influences[a].vertex], weight);
                                totweight += weight;
@@ -322,7 +322,7 @@ static void meshdeformModifier_do(
                }
 
                if (totweight > 0.0f) {
-                       mul_v3_fl(co, fac/totweight);
+                       mul_v3_fl(co, fac / totweight);
                        mul_m3_v3(icagemat, co);
                        if (G.rt != 527)
                                add_v3_v3(vertexCos[b], co);
@@ -394,8 +394,8 @@ void modifier_mdef_compact_influences(ModifierData *md)
        }
 
        /* allocate bind influences */
-       mmd->bindinfluences= MEM_callocN(sizeof(MDefInfluence)*mmd->totinfluence, "MDefBindInfluence");
-       mmd->bindoffsets= MEM_callocN(sizeof(int)*(totvert+1), "MDefBindOffset");
+       mmd->bindinfluences = MEM_callocN(sizeof(MDefInfluence) * mmd->totinfluence, "MDefBindInfluence");
+       mmd->bindoffsets = MEM_callocN(sizeof(int) * (totvert + 1), "MDefBindOffset");
 
        /* write influences */
        totinfluence= 0;
@@ -417,8 +417,8 @@ void modifier_mdef_compact_influences(ModifierData *md)
                        weight= weights[a + b*totcagevert];
 
                        if (weight > MESHDEFORM_MIN_INFLUENCE) {
-                               mmd->bindinfluences[totinfluence].weight= weight/totweight;
-                               mmd->bindinfluences[totinfluence].vertex= a;
+                               mmd->bindinfluences[totinfluence].weight = weight / totweight;
+                               mmd->bindinfluences[totinfluence].vertex = a;
                                totinfluence++;
                        }
                }
index 09924b5b0a42a1d3c8351921ac19295971db00df..2df0bd17eaf927aaafb1c2499f783e2534b43695 100644 (file)
@@ -231,10 +231,10 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
 
                ml2 = ml + mp->loopstart + maxLoops;
                e = ml2[0].e;
-               for (j = 0; j < mp->totloop-1; j++) {
-                       ml2[j].e = ml2[j+1].e;
+               for (j = 0; j < mp->totloop - 1; j++) {
+                       ml2[j].e = ml2[j + 1].e;
                }
-               ml2[mp->totloop-1].e = e;
+               ml2[mp->totloop - 1].e = e;
                
                mp->loopstart += maxLoops;
        }
index d3e54651eea1859a484b3d4637b9bd2ef9622190..71839312cf5b1d5c3860764e8ead6dca03543daf 100644 (file)
@@ -478,7 +478,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                                
                                sub_v3_v3v3(e1, mvert[ml_next->v].co, mvert[ml->v].co);
                                sub_v3_v3v3(e2, mvert[ml_prev->v].co, mvert[ml->v].co);
-                               angle = M_PI - angle_normalized_v3v3(e1, e2);
+                               angle = (float)M_PI - angle_normalized_v3v3(e1, e2);
                                BLI_array_append(face_angles, angle);
                        }
                        
@@ -644,13 +644,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                                ml[j].v = ed->v1+numVerts;
                                ml[j++].e = eidx+numEdges;
 
-                               ml[j].v = ed->v2+numVerts;
-                               ml[j++].e = numEdges*2 + old_vert_arr[ed->v2];
+                               ml[j].v = ed->v2 + numVerts;
+                               ml[j++].e = numEdges * 2 + old_vert_arr[ed->v2];
                        }
                        
                        if (edge_origIndex) {
-                               edge_origIndex[ml[j-3].e] = ORIGINDEX_NONE;
-                               edge_origIndex[ml[j-1].e] = ORIGINDEX_NONE;
+                               edge_origIndex[ml[j - 3].e] = ORIGINDEX_NONE;
+                               edge_origIndex[ml[j - 1].e] = ORIGINDEX_NONE;
                        }
 
                        /* use the next material index if option enabled */
@@ -667,13 +667,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 
                        if (crease_inner) {
                                /* crease += crease_inner; without wrapping */
-                               unsigned char *cr= (unsigned char *)&(medge[numEdges + eidx].crease);
-                               int tcr= *cr + crease_inner;
-                               *cr= tcr > 255 ? 255 : tcr;
+                               unsigned char *cr = (unsigned char *)&(medge[numEdges + eidx].crease);
+                               int tcr = *cr + crease_inner;
+                               *cr = tcr > 255 ? 255 : tcr;
                        }
                        
 #ifdef SOLIDIFY_SIDE_NORMALS
-                       normal_quad_v3(nor, mvert[ml[j-4].v].co, mvert[ml[j-3].v].co, mvert[ml[j-2].v].co, mvert[ml[j-1].v].co);
+                       normal_quad_v3(nor, mvert[ml[j - 4].v].co,
+                                           mvert[ml[j - 3].v].co,
+                                           mvert[ml[j - 2].v].co,
+                                           mvert[ml[j - 1].v].co);
 
                        add_v3_v3(edge_vert_nos[ed->v1], nor);
                        add_v3_v3(edge_vert_nos[ed->v2], nor);
index 38a93091700434d5608b92c93f1710d33bfe1f24..5ee8103630db7849a970e0c346208503c688146a 100644 (file)
@@ -192,7 +192,7 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
 
        modifier_get_vgroup(ob, dm, wmd->defgrp_name, &dvert, &defgrp_index);
 
-       if (wmd->curfalloff==NULL) /* should never happen, but bad lib linking could cause it */
+       if (wmd->curfalloff == NULL) /* should never happen, but bad lib linking could cause it */
                wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 
        invert_m4_m4(obinv, ob->obmat);
@@ -229,9 +229,10 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
        for (i = 0; i < numVerts; i++) {
                float *co = vertexCos[i];
 
-               if (wmd->falloff_type==eWarp_Falloff_None ||
-                       ((fac=len_v3v3(co, mat_from[3])) < wmd->falloff_radius && (fac=(wmd->falloff_radius-fac)/wmd->falloff_radius)) ) {
-
+               if (wmd->falloff_type == eWarp_Falloff_None ||
+                   ((fac = len_v3v3(co, mat_from[3])) < wmd->falloff_radius &&
+                    (fac = (wmd->falloff_radius-fac) / wmd->falloff_radius)))
+               {
                        /* skip if no vert group found */
                        if (dvert && defgrp_index >= 0) {
                                dv = &dvert[i];
index bcfdced4ffd9149574b02c251cf965a3dcbe98cf..31cd20e7f971034ceaf1a73474d9232d9d4a2904 100644 (file)
@@ -112,7 +112,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
                                 dist_f,loc2trgt) \
                          schedule(static)
 #endif
-       for (i = 0; i < numVerts; ++i) {
+       for (i = 0; i < numVerts; i++) {
                float tmp_co[3];
 
                /* Convert the vertex to tree coordinates. */
@@ -319,12 +319,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
        if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
                curNode = dag_get_node(forest, wmd->mask_tex_map_obj);
 
-               dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
+               dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
                                 "WeightVGProximity Modifier");
        }
 
        if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
-               dag_add_relation(forest, obNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
+               dag_add_relation(forest, obNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
                                 "WeightVGProximity Modifier");
 }
 
@@ -546,10 +546,10 @@ ModifierTypeInfo modifierType_WeightVGProximity = {
        /* structName */        "WeightVGProximityModifierData",
        /* structSize */        sizeof(WeightVGProximityModifierData),
        /* type */              eModifierTypeType_NonGeometrical,
-       /* flags */             eModifierTypeFlag_AcceptsMesh
-                              |eModifierTypeFlag_SupportsMapping
-                              |eModifierTypeFlag_SupportsEditmode
-                              |eModifierTypeFlag_UsesPreview,
+       /* flags */             eModifierTypeFlag_AcceptsMesh |
+                               eModifierTypeFlag_SupportsMapping |
+                               eModifierTypeFlag_SupportsEditmode |
+                               eModifierTypeFlag_UsesPreview,
 
        /* copyData */          copyData,
        /* deformVerts */       NULL,