Style Cleanup: whitespace and some formatting.

This commit is contained in:
2012-02-07 08:50:24 +00:00
parent 04e0c16bb6
commit f552164c71
35 changed files with 308 additions and 299 deletions

View File

@@ -49,8 +49,8 @@ def main():
check_commands = []
for c, inc_dirs, defs in source_info:
if not 'bevel' in c: continue
if 'MOD' in c: continue
# if not 'bevel' in c: continue
# if 'MOD' in c: continue
cmd = ([CHECKER_BIN] +
CHECKER_ARGS +
[c] +

View File

@@ -279,8 +279,7 @@ void BMO_CopySlot(BMOperator *source_op, BMOperator *dest_op, const char *src, c
if (!source_slot->data.ghash) return;
if (!dest_slot->data.ghash) {
dest_slot->data.ghash =
BLI_ghash_new(BLI_ghashutil_ptrhash,
dest_slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash,
BLI_ghashutil_ptrcmp, "bmesh operator 2");
}
@@ -288,15 +287,13 @@ void BMO_CopySlot(BMOperator *source_op, BMOperator *dest_op, const char *src, c
for ( ; (srcmap = BLI_ghashIterator_getValue(&it));
BLI_ghashIterator_step(&it))
{
dstmap = BLI_memarena_alloc(dest_op->arena,
sizeof(*dstmap) + srcmap->len);
dstmap = BLI_memarena_alloc(dest_op->arena, sizeof(*dstmap) + srcmap->len);
dstmap->element = srcmap->element;
dstmap->len = srcmap->len;
memcpy(dstmap + 1, srcmap + 1, srcmap->len);
BLI_ghash_insert(dest_slot->data.ghash,
dstmap->element, dstmap);
BLI_ghash_insert(dest_slot->data.ghash, dstmap->element, dstmap);
}
}
}
@@ -1101,7 +1098,7 @@ typedef struct BMOFlag {
int flag;
} BMOFlag;
#define PAIR(f) {#f, f},
#define PAIR(f) {#f, f},fv
static const char *bmesh_flags = {
PAIR(BM_SELECT);
PAIR(BM_SEAM);
@@ -1317,18 +1314,22 @@ int BMO_VInitOpf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
stop = 1;
break;
}
if (stop) break;
if (stop) {
break;
}
fmt++;
}
if (type == 'h')
BMO_HeaderFlag_To_Slot(bm, op,
slotname, va_arg(vlist, int), ret);
else if (type == 'a')
if (type == 'h') {
BMO_HeaderFlag_To_Slot(bm, op, slotname, va_arg(vlist, int), ret);
}
else if (type == 'a') {
BMO_All_To_Slot(bm, op, slotname, ret);
else
BMO_Flag_To_Slot(bm, op, slotname,
va_arg(vlist, int), ret);
}
else {
BMO_Flag_To_Slot(bm, op, slotname, va_arg(vlist, int), ret);
}
}
state = 1;

View File

@@ -453,8 +453,9 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
}
e = BM_Make_Edge(bm, firstv, lastv, BM_FACE_FIRST_LOOP(faces[i])->e, 1);
if (BM_FACE_FIRST_LOOP(faces[i])->prev->e != e)
if (BM_FACE_FIRST_LOOP(faces[i])->prev->e != e) {
BM_Copy_Attributes(bm, bm, BM_FACE_FIRST_LOOP(faces[i])->prev->e, e);
}
BLI_array_append(edges, e);
f = BM_Make_Ngon(bm, verts[0], verts[1], edges, BLI_array_count(edges), 0);

View File

@@ -227,8 +227,9 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
}
}
if (iso)
if (iso) {
BMO_Insert_MapPointer(source, op, "isovertmap", v, v2);
}
BMO_SetFlag(source, (BMHeader *)v, DUPE_DONE);
}

View File

@@ -182,8 +182,8 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
}
for (block = me->key->block.first, j = 0; block; block = block->next, j++) {
float *co = CustomData_bmesh_get_n(&bm->vdata, v->head.data,
CD_SHAPEKEY, j);
float *co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, CD_SHAPEKEY, j);
if (co) {
copy_v3_v3(co, ((float *)block->data) + 3 * i);
}

View File

@@ -144,12 +144,14 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op)
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
BM_SetIndex(f, 0); /* set_dirty! */
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
if (BMO_TestFlag(bm, l->v, ELE_DEL))
if (BMO_TestFlag(bm, l->v, ELE_DEL)) {
BMO_SetFlag(bm, f, FACE_MARK|ELE_DEL);
if (BMO_TestFlag(bm, l->e, EDGE_COL))
}
if (BMO_TestFlag(bm, l->e, EDGE_COL)) {
BM_SetIndex(f, BM_GetIndex(f) + 1); /* set_dirty! */
}
}
}
bm->elem_index_dirty |= BM_FACE;
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
@@ -167,10 +169,12 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op)
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
v = l->v;
v2 = ((BMLoop *)l->next)->v;
if (BMO_TestFlag(bm, v, ELE_DEL))
if (BMO_TestFlag(bm, v, ELE_DEL)) {
v = BMO_Get_MapPointer(bm, op, "targetmap", v);
if (BMO_TestFlag(bm, v2, ELE_DEL))
}
if (BMO_TestFlag(bm, v2, ELE_DEL)) {
v2 = BMO_Get_MapPointer(bm, op, "targetmap", v2);
}
e2 = v != v2 ? BM_Edge_Exist(v, v2) : NULL;
if (e2) {
@@ -198,10 +202,12 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op)
v = loops[0]->v;
v2 = loops[1]->v;
if (BMO_TestFlag(bm, v, ELE_DEL))
if (BMO_TestFlag(bm, v, ELE_DEL)) {
v = BMO_Get_MapPointer(bm, op, "targetmap", v);
if (BMO_TestFlag(bm, v2, ELE_DEL))
}
if (BMO_TestFlag(bm, v2, ELE_DEL)) {
v2 = BMO_Get_MapPointer(bm, op, "targetmap", v2);
}
f2 = BM_Make_Ngon(bm, v, v2, edges, a, 1);
if (f2 && (f2 != f)) {
@@ -282,8 +288,9 @@ void bmesh_pointmerge_facedata_exec(BMesh *bm, BMOperator *op)
BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) {
BM_ITER(l, &iter, bm, BM_LOOPS_OF_VERT, v) {
if (l == firstl)
if (l == firstl) {
continue;
}
CustomData_bmesh_copy_data(&bm->ldata, &bm->ldata, firstl->head.data, &l->head.data);
}

View File

@@ -288,8 +288,7 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge,
float percent, percent2 = 0.0f;
if (BMO_TestFlag(bm, edge, EDGE_PERCENT) && totpoint == 1)
percent = BMO_Get_MapFloat(bm, params->op,
"edgepercents", edge);
percent = BMO_Get_MapFloat(bm, params->op, "edgepercents", edge);
else {
percent = 1.0f / (float)(totpoint + 1-curpoint);
percent2 = (float)(curpoint + 1) / (float)(totpoint + 1);
@@ -312,8 +311,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par
temp.v2 = &ov2;
for (i = 0; i < numcuts; i++) {
v = subdivideedgenum(bm, eed, &temp, i, params->numcuts, params,
&newe, vsta, vend);
v = subdivideedgenum(bm, eed, &temp, i, params->numcuts, params, &newe, vsta, vend);
BMO_SetFlag(bm, v, SUBD_SPLIT);
BMO_SetFlag(bm, eed, SUBD_SPLIT);
@@ -1037,7 +1035,9 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op)
j = a = 0;
for (nl = BMIter_New(&liter, bmesh, BM_LOOPS_OF_FACE, face);
nl; nl = BMIter_Step(&liter)) {
nl;
nl = BMIter_Step(&liter))
{
if (nl->v == facedata[i].start) {
a = j + 1;
break;

View File

@@ -66,11 +66,9 @@ void triangulate_exec(BMesh *bm, BMOperator *op)
}
}
BM_Triangulate_Face(bm, face, projectverts, EDGE_NEW,
FACE_NEW, newfaces);
BM_Triangulate_Face(bm, face, projectverts, EDGE_NEW, FACE_NEW, newfaces);
BMO_Insert_MapPointer(bm, op, "facemap",
face, face);
BMO_Insert_MapPointer(bm, op, "facemap", face, face);
for (i = 0; newfaces[i]; i++) {
BMO_Insert_MapPointer(bm, op, "facemap",
newfaces[i], face);

View File

@@ -1256,8 +1256,9 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
h = BLI_heap_new();
for (i = 0; i < num_total; i++ )
for (i = 0; i < num_total; i++) {
vert_list[i].hn = BLI_heap_insert(h, vert_list[i].weight, vert_list[i].v);
}
while (!BLI_heap_empty(h)) {
BMEdge *e;