Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-20 08:27:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-20 08:27:14 +0400
commitbe116242d43c58ddf08b5d28379cdb0a26b6bb5c (patch)
tree5c8775dd5cc2c379962b09c7f4fe471d39a07d34
parent3427749090a427f29a1eecbe7f921a8e8007002c (diff)
style cleanup
-rw-r--r--source/blender/blenkernel/intern/deform.c8
-rw-r--r--source/blender/bmesh/intern/bmesh_marking.c6
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c4
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c2
-rw-r--r--source/blender/bmesh/operators/bmo_extrude.c2
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c2
-rw-r--r--source/blender/bmesh/operators/bmo_utils.c68
-rw-r--r--source/blender/bmesh/tools/BME_bevel.c2
-rw-r--r--source/blender/editors/mesh/bmesh_select.c8
-rw-r--r--source/blender/editors/mesh/bmesh_tools.c2
-rw-r--r--source/blender/editors/mesh/bmesh_utils.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c4
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_select.c2
13 files changed, 54 insertions, 58 deletions
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 1d794ce7776..6de24856ce8 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -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;
}
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c
index 453cabd2e2f..b5e8b42c30c 100644
--- a/source/blender/bmesh/intern/bmesh_marking.c
+++ b/source/blender/bmesh/intern/bmesh_marking.c
@@ -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);
}
}
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index 53b393b3140..93ea6d53139 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -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++;
}
}
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 3a5b7120430..fdc5f5f38c0 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -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;
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c
index 8f86986f482..22867ba40e7 100644
--- a/source/blender/bmesh/operators/bmo_extrude.c
+++ b/source/blender/bmesh/operators/bmo_extrude.c
@@ -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))
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index 9b39ca8ea8c..c19c337192b 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -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;
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c
index 9de78ff2f7a..100cf788054 100644
--- a/source/blender/bmesh/operators/bmo_utils.c
+++ b/source/blender/bmesh/operators/bmo_utils.c
@@ -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:
diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c
index aea08f8981a..82ab6edf5dc 100644
--- a/source/blender/bmesh/tools/BME_bevel.c
+++ b/source/blender/bmesh/tools/BME_bevel.c
@@ -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);
}
}
diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c
index 7a370cb1503..c33e547c72a 100644
--- a/source/blender/editors/mesh/bmesh_select.c
+++ b/source/blender/editors/mesh/bmesh_select.c
@@ -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;
}
}
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c
index a75fccb4d3b..120a1f312b7 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/bmesh_tools.c
@@ -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);
diff --git a/source/blender/editors/mesh/bmesh_utils.c b/source/blender/editors/mesh/bmesh_utils.c
index 256a6b4efad..5ac663b573b 100644
--- a/source/blender/editors/mesh/bmesh_utils.c
+++ b/source/blender/editors/mesh/bmesh_utils.c
@@ -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);
}
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index e9841301201..7fffb205f2b 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -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;
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c
index af1ebee7fc6..bf0e70c7ac1 100644
--- a/source/blender/python/bmesh/bmesh_py_types_select.c
+++ b/source/blender/python/bmesh/bmesh_py_types_select.c
@@ -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;