style cleanup: braces with multi-line statements, also add some comments.

This commit is contained in:
2013-03-01 14:47:06 +00:00
parent 462e4bee87
commit 0ac07404ba
17 changed files with 48 additions and 23 deletions

View File

@@ -908,6 +908,12 @@ int BKE_mesh_validate_dm(DerivedMesh *dm)
TRUE, FALSE);
}
/**
* Calculate edges from polygons
*
* \param mesh The mesh to add edges into
* \param update When true create new edges co-exist
*/
void BKE_mesh_calc_edges(Mesh *mesh, int update)
{
CustomData edata;

View File

@@ -805,7 +805,8 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
/* Ensure that v1 is in the new face's node */
if (!BLI_ghash_haskey(n->bm_unique_verts, v1) &&
!BLI_ghash_haskey(n->bm_other_verts, v1)) {
!BLI_ghash_haskey(n->bm_other_verts, v1))
{
BLI_ghash_insert(n->bm_other_verts, v1, NULL);
}
}

View File

@@ -155,7 +155,8 @@ static void hull_output_triangles(BMesh *bm, GHash *hull_triangles)
BMEdge *e = BM_edge_exists(t->v[i], t->v[next]);
if (e &&
BMO_elem_flag_test(bm, e, HULL_FLAG_INPUT) &&
!BMO_elem_flag_test(bm, e, HULL_FLAG_HOLE)) {
!BMO_elem_flag_test(bm, e, HULL_FLAG_HOLE))
{
BMO_elem_flag_enable(bm, e, HULL_FLAG_OUTPUT_GEOM);
}
}

View File

@@ -931,7 +931,8 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p,
/* check that point segment of the boundbox of the eraser stroke */
if (((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(rect, x0, y0)) ||
((!ELEM(V2D_IS_CLIPPED, x1, y1)) && BLI_rcti_isect_pt(rect, x1, y1))) {
((!ELEM(V2D_IS_CLIPPED, x1, y1)) && BLI_rcti_isect_pt(rect, x1, y1)))
{
/* check if point segment of stroke had anything to do with
* eraser region (either within stroke painted, or on its lines)
* - this assumes that linewidth is irrelevant

View File

@@ -2585,7 +2585,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
/* if list length changes and active is out of view, scroll to it */
if ((ui_list->list_last_len != len) &&
(activei < ui_list->list_scroll || activei >= ui_list->list_scroll + items)) {
(activei < ui_list->list_scroll || activei >= ui_list->list_scroll + items))
{
ui_list->list_scroll = activei;
}

View File

@@ -145,7 +145,8 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
use_ngons,
use_object_instantiation,
sort_by_name,
second_life)) {
second_life))
{
return OPERATOR_FINISHED;
}
else {

View File

@@ -3321,7 +3321,8 @@ static int edbm_fill_exec(bContext *C, wmOperator *op)
if (!EDBM_op_init(em, &bmop, op,
"triangle_fill edges=%he use_beauty=%b",
BM_ELEM_SELECT, use_beauty)) {
BM_ELEM_SELECT, use_beauty))
{
return OPERATOR_CANCELLED;
}

View File

@@ -558,8 +558,10 @@ static int ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGrou
}
/* Loop through the vertices.*/
for (i = 0, dv_src = dv_array_src, dv_dst = dv_array_dst; i < me_dst->totvert;
i++, dv_dst++, dv_src++, mv_src++, mv_dst++) {
for (i = 0, dv_src = dv_array_src, dv_dst = dv_array_dst;
i < me_dst->totvert;
i++, dv_dst++, dv_src++, mv_src++, mv_dst++)
{
if (*dv_dst == NULL) {
continue;

View File

@@ -3742,7 +3742,8 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
if (brush->sculpt_tool == SCULPT_TOOL_LAYER) {
/* not supported yet for multires or dynamic topology */
if (!ss->multires && !ss->bm && !ss->layer_co &&
(brush->flag & BRUSH_PERSISTENT)) {
(brush->flag & BRUSH_PERSISTENT))
{
if (!ss->layer_co)
ss->layer_co = MEM_mallocN(sizeof(float) * 3 * ss->totvert,
"sculpt mesh vertices copy");

View File

@@ -1180,9 +1180,8 @@ static void file_expand_directory(bContext *C)
/* change "C:" --> "C:\", [#28102] */
else if ((isalpha(sfile->params->dir[0]) &&
(sfile->params->dir[1] == ':')) &&
(sfile->params->dir[2] == '\0')
) {
(sfile->params->dir[2] == '\0'))
{
sfile->params->dir[2] = '\\';
sfile->params->dir[3] = '\0';
}

View File

@@ -1131,8 +1131,8 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(
/* skip if out of view */
if (node->totr.xmax < ar->v2d.cur.xmin || node->totr.xmin > ar->v2d.cur.xmax ||
node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax) {
node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax)
{
uiEndBlock(C, node->block);
node->block = NULL;
return;

View File

@@ -3699,6 +3699,8 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
void VIEW3D_OT_background_image_add(wmOperatorType *ot)
{
/* identifiers */
/* note: having key shortcut here is bad practice,
* but for now keep because this displays when dragging an image over the 3D viewport */
ot->name = "Add Background Image (Ctrl for Empty Object)";
ot->description = "Add a new background image";
ot->idname = "VIEW3D_OT_background_image_add";

View File

@@ -617,7 +617,8 @@ static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, const
LassoSelectUserData *data = userData;
if (BLI_rctf_isect_pt_v(data->rect_fl, screen_co) &&
BLI_lasso_is_point_inside(data->mcords, data->moves, screen_co[0], screen_co[1], IS_CLIPPED)) {
BLI_lasso_is_point_inside(data->mcords, data->moves, screen_co[0], screen_co[1], IS_CLIPPED))
{
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
}
}
@@ -717,7 +718,8 @@ static void do_lasso_select_mball__doSelectElem(void *userData, struct MetaElem
LassoSelectUserData *data = userData;
if (BLI_rctf_isect_pt_v(data->rect_fl, screen_co) &&
BLI_lasso_is_point_inside(data->mcords, data->moves, screen_co[0], screen_co[1], INT_MAX)) {
BLI_lasso_is_point_inside(data->mcords, data->moves, screen_co[0], screen_co[1], INT_MAX))
{
if (data->select) ml->flag |= SELECT;
else ml->flag &= ~SELECT;
data->is_change = TRUE;

View File

@@ -1519,7 +1519,8 @@ static IK_Scene *convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan, f
if (!ret ||
!scene->addCache(ikscene->cache) ||
!scene->addSolver(ikscene->solver) ||
!scene->initialize()) {
!scene->initialize())
{
delete ikscene;
ikscene = NULL;
}
@@ -1566,7 +1567,8 @@ static int init_scene(Object *ob)
if (ob->pose->ikdata) {
for (scene = ((IK_Data *)ob->pose->ikdata)->first;
scene != NULL;
scene = scene->next) {
scene = scene->next)
{
if (fabs(scene->blScale - scale) > KDL::epsilon)
return 1;
scene->channels[0].pchan->flag |= POSE_IKTREE;

View File

@@ -29,6 +29,10 @@
/** \file DNA_key_types.h
* \ingroup DNA
*
* This file defines structures for Shape-Keys (not animation keyframes),
* attached to Mesh, Curve and Lattice Data. Even though Key's are ID blocks they
* aren't intended to be shared between multiple data blocks as with other ID types.
*/
#include "DNA_defs.h"

View File

@@ -4864,7 +4864,7 @@ static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
}
}
char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
char *RNA_pointer_as_string(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
{
if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) {
return rna_pointer_as_string__idprop(C, ptr_prop);

View File

@@ -156,7 +156,8 @@ static int pyrna_struct_keyframe_parse(
/* note, parse_str MUST start with 's|ifsO!' */
if (!PyArg_ParseTupleAndKeywords(args, kw, parse_str, (char **)kwlist, &path, index, cfra, group_name,
&PySet_Type, &pyoptions)) {
&PySet_Type, &pyoptions))
{
return -1;
}