style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Tue, 20 Mar 2012 04:27:14 +0000 (04:27 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 20 Mar 2012 04:27:14 +0000 (04:27 +0000)
13 files changed:
source/blender/blenkernel/intern/deform.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_queries.c
source/blender/bmesh/intern/bmesh_walkers_impl.c
source/blender/bmesh/operators/bmo_extrude.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/bmesh/tools/BME_bevel.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/mesh/bmesh_utils.c
source/blender/python/bmesh/bmesh_py_types_meshdata.c
source/blender/python/bmesh/bmesh_py_types_select.c

index 1d794ce7776dc1d6765e4e7d66126a3892f98be5..6de24856ce890654a5557b484ee31ad7d0514132 100644 (file)
@@ -220,7 +220,7 @@ void defvert_normalize_lock(MDeformVert *dvert, const int def_nr_lock)
                float lock_iweight = 1.0f;
 
                for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
-                       if(dw->def_nr != def_nr_lock) {
+                       if (dw->def_nr != def_nr_lock) {
                                tot_weight += dw->weight;
                        }
                        else {
@@ -235,7 +235,7 @@ void defvert_normalize_lock(MDeformVert *dvert, const int def_nr_lock)
 
                        float scalar = (1.0f / tot_weight) * lock_iweight;
                        for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
-                               if(dw != dw_lock) {
+                               if (dw != dw_lock) {
                                        dw->weight *= scalar;
 
                                        /* in case of division errors with very low weights */
@@ -638,7 +638,7 @@ void defvert_add_index_notest(MDeformVert *dvert, int defgroup, const float weig
                return;
 
        dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "defvert_add_to group, new deformWeight");
-       if(dvert->dw) {
+       if (dvert->dw) {
                memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
                MEM_freeN(dvert->dw);
        }
@@ -659,7 +659,7 @@ void defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
                int i = dw - dvert->dw;
 
                /* Security check! */
-               if(i < 0 || i >= dvert->totweight) {
+               if (i < 0 || i >= dvert->totweight) {
                        return;
                }
 
index 453cabd2e2fb7ac7823e246b47dd93d0d161db8a..b5e8b42c30c4546c77dd21e1b8a1ae6bb58ac9c7 100644 (file)
@@ -607,9 +607,9 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
                         * we cant make a crossvec from a vec thats the same as the vec
                         * unlikely but possible, so make sure if the normal is (0, 0, 1)
                         * that vec isn't the same or in the same direction even. */
-                       if (eve->no[0] < 0.5f)          vec[0] = 1.0f;
-                       else if (eve->no[1] < 0.5f)     vec[1] = 1.0f;
-                       else                                            vec[2] = 1.0f;
+                       if      (eve->no[0] < 0.5f) vec[0] = 1.0f;
+                       else if (eve->no[1] < 0.5f) vec[1] = 1.0f;
+                       else                        vec[2] = 1.0f;
                        cross_v3_v3v3(r_plane, eve->no, vec);
                }
        }
index 53b393b31406f5b51cfa1dc7886a888c20f19360..93ea6d53139b6a67b502dbc920a231d3bc22e7ab 100644 (file)
@@ -329,8 +329,8 @@ int BM_vert_edge_count_nonwire(BMVert *v)
        int count = 0;
        BMIter eiter;
        BMEdge *edge;
-       BM_ITER(edge, &eiter, NULL, BM_EDGES_OF_VERT, v){
-               if(edge->l) {
+       BM_ITER(edge, &eiter, NULL, BM_EDGES_OF_VERT, v) {
+               if (edge->l) {
                        count++;
                }
        }
index 3a5b7120430367f1124aa4f671eea6a8cb1ca302..fdc5f5f38c055189305379b2da846b327aca02ca 100644 (file)
@@ -467,7 +467,7 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
                        l = BM_face_other_vert_loop(owalk.f_hub, lwalk->lastv, v);
                        nexte = BM_edge_exists(v, l->v);
 
-            if(!BLI_ghash_haskey(walker->visithash, nexte)){
+            if (!BLI_ghash_haskey(walker->visithash, nexte)) {
                 lwalk = BMW_state_add(walker);
                 lwalk->cur = nexte;
                 lwalk->lastv = v;
index 8f86986f482b8c5afedb223671fd3192af836093..22867ba40e743ebc1e148b57407ba39818a78b4a 100644 (file)
@@ -147,7 +147,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
                        v3 = e->v2;
                        v4 = e->v1;
                }
-               /* not sure what to do about example face, pass  NULL for now */
+               /* not sure what to do about example face, pass NULL for now */
                f = BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE);
                
                if (BMO_elem_flag_test(bm, e, EXT_INPUT))
index 9b39ca8ea8c04e19fe47223374b1fabd99509469..c19c337192b022855b66ae66fe5636fa53896d20 100644 (file)
@@ -657,7 +657,7 @@ static SubDPattern *patterns[] = {
        NULL,
 };
 
-#define PLEN   (sizeof(patterns) / sizeof(void *))
+#define PLEN  (sizeof(patterns) / sizeof(void *))
 
 typedef struct SubDFaceData {
        BMVert *start; SubDPattern *pat;
index 9de78ff2f7a9ca818a24e4bbad3e51a451dbd75d..100cf78805451650f54661feb30c942fc8d62d84 100644 (file)
@@ -466,11 +466,11 @@ void bmo_vertexsmooth_exec(BMesh *bm, BMOperator *op)
  */
 static float ngon_perimeter(BMesh *bm, BMFace *f)
 {
-       BMIter  liter;
-       BMLoop  *l;
-       int             num_verts = 0;
-       float   v[3], sv[3];
-       float   perimeter = 0.0f;
+       BMIter  liter;
+       BMLoop *l;
+       int     num_verts = 0;
+       float   v[3], sv[3];
+       float   perimeter = 0.0f;
 
        BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
                if (num_verts == 0) {
@@ -498,11 +498,11 @@ static float ngon_perimeter(BMesh *bm, BMFace *f)
  */
 static float ngon_fake_area(BMesh *bm, BMFace *f)
 {
-       BMIter  liter;
-       BMLoop  *l;
-       int             num_verts = 0;
-       float   v[3], sv[3], c[3];
-       float   area = 0.0f;
+       BMIter  liter;
+       BMLoop *l;
+       int     num_verts = 0;
+       float   v[3], sv[3], c[3];
+       float   area = 0.0f;
 
        BM_face_center_mean_calc(bm, f, c);
 
@@ -528,13 +528,13 @@ static float ngon_fake_area(BMesh *bm, BMFace *f)
  * extra face data (computed data)
  */
 typedef struct SimSel_FaceExt {
-       BMFace          *f;                     /* the face */
-       float   c[3];                   /* center */
+       BMFace  *f;             /* the face */
+       float    c[3];          /* center */
        union {
-               float   area;           /* area */
-               float   perim;          /* perimeter */
-               float   d;                      /* 4th component of plane (the first three being the normal) */
-               struct Image    *t;     /* image pointer */
+               float   area;       /* area */
+               float   perim;      /* perimeter */
+               float   d;          /* 4th component of plane (the first three being the normal) */
+               struct Image *t;    /* image pointer */
        };
 } SimSel_FaceExt;
 
@@ -572,7 +572,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
        }
 
        /* allocate memory for the selected faces indices and for all temporary faces */
-       indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c");
+       indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c");
        f_ext = (SimSel_FaceExt *)MEM_callocN(sizeof(SimSel_FaceExt) * num_total, "f_ext util.c");
 
        /* loop through all the faces and fill the faces/indices structure */
@@ -692,15 +692,15 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
 /**************************************************************************** *
  * Similar Edges
  **************************************************************************** */
-#define EDGE_MARK      1
+#define EDGE_MARK 1
 
 /*
  * compute the angle of an edge (i.e. the angle between two faces)
  */
 static float edge_angle(BMesh *bm, BMEdge *e)
 {
-       BMIter  fiter;
-       BMFace  *f, *f_prev = NULL;
+       BMIter fiter;
+       BMFace *f, *f_prev = NULL;
 
        /* first edge faces, don't account for 3+ */
 
@@ -719,15 +719,15 @@ static float edge_angle(BMesh *bm, BMEdge *e)
  * extra edge information
  */
 typedef struct SimSel_EdgeExt {
-       BMEdge          *e;
+       BMEdge *e;
        union {
-               float           dir[3];
-               float           angle;                  /* angle between the face */
+               float dir[3];
+               float angle;            /* angle between the face */
        };
 
        union {
-               float           length;                 /* edge length */
-               int                     faces;                  /* faces count */
+               float length;           /* edge length */
+               int   faces;            /* faces count */
        };
 } SimSel_EdgeExt;
 
@@ -738,9 +738,9 @@ typedef struct SimSel_EdgeExt {
 void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
 {
        BMOIter es_iter;        /* selected edges iterator */
-       BMIter  e_iter;         /* mesh edges iterator */
-       BMEdge  *es;            /* selected edge */
-       BMEdge  *e;             /* mesh edge */
+       BMIter e_iter;          /* mesh edges iterator */
+       BMEdge *es;             /* selected edge */
+       BMEdge *e;              /* mesh edge */
        int idx = 0, i = 0 /* , f = 0 */;
        int *indices = NULL;
        SimSel_EdgeExt *e_ext = NULL;
@@ -760,7 +760,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
        }
 
        /* allocate memory for the selected edges indices and for all temporary edges */
-       indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c");
+       indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c");
        e_ext = (SimSel_EdgeExt *)MEM_callocN(sizeof(SimSel_EdgeExt) * num_total, "e_ext util.c");
 
        /* loop through all the edges and fill the edges/indices structure */
@@ -778,7 +778,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
                for (i = 0; i < num_total; i++) {
                        switch (type) {
                                case SIMEDGE_LENGTH:    /* compute the length of the edge */
-                                       e_ext[i].length = len_v3v3(e_ext[i].e->v1->co, e_ext[i].e->v2->co);
+                                       e_ext[i].length = len_v3v3(e_ext[i].e->v1->co, e_ext[i].e->v2->co);
                                        break;
 
                                case SIMEDGE_DIR:               /* compute the direction */
@@ -786,11 +786,11 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
                                        break;
 
                                case SIMEDGE_FACE:              /* count the faces around the edge */
-                                       e_ext[i].faces  = BM_edge_face_count(e_ext[i].e);
+                                       e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
                                        break;
 
                                case SIMEDGE_FACE_ANGLE:
-                                       e_ext[i].faces  = BM_edge_face_count(e_ext[i].e);
+                                       e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
                                        if (e_ext[i].faces == 2)
                                                e_ext[i].angle = edge_angle(bm, e_ext[i].e);
                                        break;
@@ -924,7 +924,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
        }
 
        /* allocate memory for the selected vertices indices and for all temporary vertices */
-       indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices");
+       indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices");
        v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra");
 
        /* loop through all the vertices and fill the vertices/indices structure */
@@ -938,7 +938,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
                switch (type) {
                        case SIMVERT_FACE:
                                /* calling BM_vert_face_count every time is time consumming, so call it only once per vertex */
-                               v_ext[i].num_faces      = BM_vert_face_count(v);
+                               v_ext[i].num_faces = BM_vert_face_count(v);
                                break;
 
                        case SIMVERT_VGROUP:
index aea08f8981a6bc21a75b40e9a01ec94fc4a50209..82ab6edf5dcf04f46774c14607948352ed9146a7 100644 (file)
@@ -1005,7 +1005,7 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
                                if(l2->f->len > 3)
                                        BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, FALSE); /* clip this corner off */
                                curedge = bmesh_disk_edge_next(curedge, v);
-                       } while(curedge != v->e);
+                       } while (curedge != v->e);
                        BME_Bevel_Dissolve_Disk(bm, v);
                }
        }
index 7a370cb150368ab4888884328f84b03c10c2d464..c33e547c72a6e812438015ed0dcf35f17a4a5fbb 100644 (file)
@@ -1170,17 +1170,13 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val
        case EDGE_MODE_TAG_CREASE:
         {
                float *crease = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_CREASE);
-               
-               if (val)                *crease = 1.0f;
-               else                    *crease = 0.0f;
+               *crease = (val) ? 1.0f : 0.0f;
                break;
         }
        case EDGE_MODE_TAG_BEVEL:
         {
                float *bweight = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_BWEIGHT);
-
-               if (val)                *bweight = 1.0f;
-               else                    *bweight = 0.0f;
+               *bweight = (val) ? 1.0f : 0.0f;
                break;
         }
        }
index a75fccb4d3bf7d1bd926028566a956deee57268b..120a1f312b746c5d2ac643bf163577895e1997c4 100644 (file)
@@ -2943,7 +2943,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
        int  i;
        
        //threshold = 0.000001; /* tolerance for vertex intersection */
-       // XXX  threshold = scene->toolsettings->select_thresh / 100;
+       // XXX threshold = scene->toolsettings->select_thresh / 100;
        
        /* Get screen coords of verts */
        scr = BLI_ghash_lookup(gh, e->v1);
index 256a6b4efadcfd528a105e12a535a7b1e9acff39..5ac663b573be8ba17f04703f8df32c1f07f59671 100644 (file)
@@ -560,7 +560,7 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
 
 static void free_undo(void *umv)
 {
-       if (((Mesh *)umv)->key) {
+       if (((Mesh *)umv)->key) {
                free_key(((Mesh *)umv)->key);
                MEM_freeN(((Mesh *)umv)->key);
        }
index e98413012019715f8cb6e3dd4fc05a5afd5aad19..7fffb205f2b2e8b3893435a762727ebc041f878a 100644 (file)
@@ -183,7 +183,7 @@ static int mathutils_bmloopcol_set(BaseMathObject *bmo, int UNUSED(subtype))
 static int mathutils_bmloopcol_get_index(BaseMathObject *bmo, int subtype, int UNUSED(index))
 {
        /* lazy, avoid repeteing the case statement */
-       if(mathutils_bmloopcol_get(bmo, subtype) == -1)
+       if (mathutils_bmloopcol_get(bmo, subtype) == -1)
                return -1;
        return 0;
 }
@@ -193,7 +193,7 @@ static int mathutils_bmloopcol_set_index(BaseMathObject *bmo, int subtype, int i
        const float f = bmo->data[index];
 
        /* lazy, avoid repeteing the case statement */
-       if(mathutils_bmloopcol_get(bmo, subtype) == -1)
+       if (mathutils_bmloopcol_get(bmo, subtype) == -1)
                return -1;
 
        bmo->data[index] = f;
index af1ebee7fc63c0c3f1cc3f68549e7f79dbdf5f1c..bf0e70c7ac1c8ffd0ed20a6db5f42eee32373fcb 100644 (file)
@@ -116,7 +116,7 @@ static PyObject *bpy_bmeditselseq_add(BPy_BMEditSelSeq *self, BPy_BMElem *value)
 
        BPY_BM_CHECK_OBJ(value);
 
-       if (self->bm != value->bm)      {
+       if (self->bm != value->bm) {
                PyErr_SetString(PyExc_ValueError,
                                "Element is not from this mesh");
                return NULL;