style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Tue, 22 May 2012 22:03:41 +0000 (22:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 22 May 2012 22:03:41 +0000 (22:03 +0000)
18 files changed:
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/sculpt_paint/paint_mask.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/intern/node_common.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c
source/blender/render/intern/source/convertblender.c

index b38f0f78cdb6ecd56867a0e05eadf4706aa73a39..e067b7195ce1c75e4e29c8e3f385cc0b525994bc 100644 (file)
@@ -429,10 +429,10 @@ static DerivedMesh *cloth_to_triangles(DerivedMesh *dm)
        MFace *mface2 = NULL;
 
        /* calc faces */
-       for(i = 0; i < numfaces; i++)
-       {
-               if(mface[i].v4)
+       for (i = 0; i < numfaces; i++) {
+               if (mface[i].v4) {
                        quads++;
+               }
        }
                
        result = CDDM_from_template(dm, dm->getNumVerts(dm), 0, numfaces + quads, 0, 0);
@@ -443,8 +443,7 @@ static DerivedMesh *cloth_to_triangles(DerivedMesh *dm)
        DM_ensure_tessface(result);
        mface2 = result->getTessFaceArray(result);
 
-       for(i = 0, j = numfaces; i < numfaces; i++)
-       {
+       for (i = 0, j = numfaces; i < numfaces; i++) {
                // DG TODO: is this necessary?
                mface2[i].v1 = mface[i].v1;
                mface2[i].v2 = mface[i].v2;
@@ -453,8 +452,7 @@ static DerivedMesh *cloth_to_triangles(DerivedMesh *dm)
                mface2[i].v4 = 0;
                //test_index_face(&mface2[i], &result->faceData, i, 3);
 
-               if(mface[i].v4)
-               {
+               if (mface[i].v4) {
                        DM_copy_tessface_data(dm, result, i, j, 1);
 
                        mface2[j].v1 = mface[i].v1;
index a93653537c7968a4924527cb3ca35d12aa140a69..7c5cf68affa9e2ee381df1895e7bce7b613fbba8 100644 (file)
@@ -345,19 +345,17 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
                        }
                }
 
-               if(result)
-               {
+               if (result) {
                        int i = 0;
 
-                       for(i = 0; i < 3; i++)
-                       {
-                               if(cloth1->verts[collpair->ap1].impulse_count > 0 && ABS(cloth1->verts[collpair->ap1].impulse[i]) < ABS(i1[i]))
+                       for (i = 0; i < 3; i++) {
+                               if (cloth1->verts[collpair->ap1].impulse_count > 0 && ABS(cloth1->verts[collpair->ap1].impulse[i]) < ABS(i1[i]))
                                        cloth1->verts[collpair->ap1].impulse[i] = i1[i];
 
-                               if(cloth1->verts[collpair->ap2].impulse_count > 0 && ABS(cloth1->verts[collpair->ap2].impulse[i]) < ABS(i2[i]))
+                               if (cloth1->verts[collpair->ap2].impulse_count > 0 && ABS(cloth1->verts[collpair->ap2].impulse[i]) < ABS(i2[i]))
                                        cloth1->verts[collpair->ap2].impulse[i] = i2[i];
 
-                               if(cloth1->verts[collpair->ap3].impulse_count > 0 && ABS(cloth1->verts[collpair->ap3].impulse[i]) < ABS(i3[i]))
+                               if (cloth1->verts[collpair->ap3].impulse_count > 0 && ABS(cloth1->verts[collpair->ap3].impulse[i]) < ABS(i3[i]))
                                        cloth1->verts[collpair->ap3].impulse[i] = i3[i];
                        }
                }
@@ -681,8 +679,9 @@ static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, Collision
                        }
                }
 
-               if(!result)
+               if (!result) {
                        break;
+               }
        }
        return ret;
 }
index 04bce0a8f6381d85e0280b7166c6f04dbdda0427..4e7653e24737838037d2788d4a25b90aa3af780f 100644 (file)
@@ -997,22 +997,22 @@ static void layerDefault_mvert_skin(void *data, int count)
        MVertSkin *vs = data;
        int i;
        
-       for(i = 0; i < count; i++) {
+       for (i = 0; i < count; i++) {
                copy_v3_fl(vs[i].radius, 0.25f);
                vs[i].flag = 0;
        }
 }
+
 static void layerInterp_mvert_skin(void **sources, float *weights,
-                                                                  float *UNUSED(sub_weights),
-                                                                  int count, void *dest)
+                                   float *UNUSED(sub_weights),
+                                   int count, void *dest)
 {
        float radius[3], w;
        MVertSkin *vs;
        int i;
 
        zero_v3(radius);
-       for(i = 0; i < count; i++) {
+       for (i = 0; i < count; i++) {
                w = weights ? weights[i] : 1.0f;
                vs = sources[i];
 
index 8de832e508d9895a6270d5ed62cb9464a85e8f99..6b9253e96571fdf5acf179b28bccc09d52b0630b 100644 (file)
@@ -3030,10 +3030,12 @@ int BKE_object_is_animated(Scene *scene, Object *ob)
        ModifierData *md;
 
        for (md = modifiers_getVirtualModifierList(ob); md; md = md->next)
-               if(modifier_dependsOnTime(md) && 
-                       (modifier_isEnabled(scene, md, eModifierMode_Realtime) || 
-                       modifier_isEnabled(scene, md, eModifierMode_Render)))
+               if (modifier_dependsOnTime(md) &&
+                   (modifier_isEnabled(scene, md, eModifierMode_Realtime) ||
+                    modifier_isEnabled(scene, md, eModifierMode_Render)))
+               {
                        return 1;
+               }
        return 0;
 }
 
index 54b68e2828e48ad2bc1148730dcc7f4c32b95be6..63df006aa66aabf2e4c13c53895cd797910c9cd1 100644 (file)
@@ -3826,7 +3826,7 @@ static void direct_link_customdata(FileData *fd, CustomData *data, int count)
                        layer->data = newdataadr(fd, layer->data);
                        if (layer->type == CD_MDISPS)
                                direct_link_mdisps(fd, count, layer->data, layer->flag & CD_FLAG_EXTERNAL);
-                       else if(layer->type == CD_GRID_PAINT_MASK)
+                       else if (layer->type == CD_GRID_PAINT_MASK)
                                direct_link_grid_paint_mask(fd, count, layer->data);
                        i++;
                }
@@ -7437,7 +7437,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
                
-               for(cu = main->curve.first; cu; cu = cu->id.next) {
+               for (cu = main->curve.first; cu; cu = cu->id.next) {
                        if (cu->bevfac2 == 0.0f) {
                                cu->bevfac1 = 0.0f;
                                cu->bevfac2 = 1.0f;
index 297eb6027ae36e82e68fc3cc6cb4e5b9d351c5a5..f14837f096ed01570bdc96846e04b3961ba6002e 100644 (file)
@@ -1662,17 +1662,17 @@ static void write_mdisps(WriteData *wd, int count, MDisps *mdlist, int external)
 
 static void write_grid_paint_mask(WriteData *wd, int count, GridPaintMask *grid_paint_mask)
 {
-       if(grid_paint_mask) {
+       if (grid_paint_mask) {
                int i;
                
                writestruct(wd, DATA, "GridPaintMask", count, grid_paint_mask);
-               for(i = 0; i < count; ++i) {
+               for (i = 0; i < count; ++i) {
                        GridPaintMask *gpm = &grid_paint_mask[i];
-                       if(gpm->data) {
+                       if (gpm->data) {
                                const int gridsize = ccg_gridsize(gpm->level);
                                writedata(wd, DATA,
-                                                 sizeof(*gpm->data) * gridsize * gridsize,
-                                                 gpm->data);
+                                         sizeof(*gpm->data) * gridsize * gridsize,
+                                         gpm->data);
                        }
                }
        }
index 919d2173bd2a37ad9057bd6991feffd78c560e2b..298ecf764d6867e3dd5a0c6254e93f5f30f045f8 100644 (file)
@@ -64,7 +64,7 @@ static void mask_flood_fill_set_elem(float *elem,
                                                                         PaintMaskFloodMode mode,
                                                                         float value)
 {
-       switch(mode) {
+       switch (mode) {
        case PAINT_MASK_FLOOD_VALUE:
                (*elem) = value;
                break;
@@ -96,7 +96,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
 
        sculpt_undo_push_begin("Mask flood fill");
 
-       for(i = 0; i < totnode; i++) {
+       for (i = 0; i < totnode; i++) {
                PBVHVertexIter vi;
 
                sculpt_undo_push_node(ob, nodes[i], SCULPT_UNDO_MASK);
index 76003be8dc9966fe41cbe20635aebdcce67c21fa..db75198bcd4af5a28a9d96c0d4538df5736465d3 100644 (file)
@@ -2296,7 +2296,7 @@ void node_composit_backdrop_boxmask(SpaceNode* snode, ImBuf* backdrop, bNode* no
 
 
        /* keep this, saves us from a version patch */
-       if(snode->zoom==0.0f) snode->zoom= 1.0f;
+       if (snode->zoom == 0.0f) snode->zoom = 1.0f;
 
        glColor3f(1.0, 1.0, 1.0);
 
@@ -2337,7 +2337,7 @@ void node_composit_backdrop_ellipsemask(SpaceNode* snode, ImBuf* backdrop, bNode
 
 
        /* keep this, saves us from a version patch */
-       if(snode->zoom==0.0f) snode->zoom= 1.0f;
+       if (snode->zoom == 0.0f) snode->zoom = 1.0f;
 
        glColor3f(1.0, 1.0, 1.0);
 
index 5000e0f2163cb7c69dd4b8836958b13dc6700723..c4ea8c4025fd98dcbe3c7abc573919906351ae45 100644 (file)
@@ -2521,7 +2521,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
                                        /* when linking to group outputs, update the socket type */
                                        /* XXX this should all be part of a generic update system */
                                        if (!link->tonode) {
-                                               if(link->tosock->type != link->fromsock->type)
+                                               if (link->tosock->type != link->fromsock->type)
                                                        nodeSocketSetType(link->tosock, link->fromsock->type);
                                        }
                                }
index 6ba506bbc5cbb576bf6f2e27a76af141bd6d3885..9633917344f99c74dee0d0be6dd8f820a25ece73 100644 (file)
@@ -2412,11 +2412,11 @@ static void draw_dm_verts__mapFunc(void *userData, int index, const float co[3],
 
        if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BM_elem_flag_test(eve, BM_ELEM_SELECT) == data->sel) {
                /* skin nodes: draw a red circle around the root
-                  node(s) */
-               if(data->has_vskin) {
+                * node(s) */
+               if (data->has_vskin) {
                        const MVertSkin *vs = CustomData_bmesh_get(&data->em->bm->vdata,
-                                                                                                          eve->head.data,
-                                                                                                          CD_MVERT_SKIN);
+                                                                  eve->head.data,
+                                                                  CD_MVERT_SKIN);
                        if (vs->flag & MVERT_SKIN_ROOT) {
                                float radius = (vs->radius[0] + vs->radius[1]) * 0.5f;
                                bglEnd();
index fea6f7266b2132940b7515cef595be3ce193a6f0..45e5fb10bc0ca3c2117bb5289e41aaef32b0ddc9 100644 (file)
@@ -617,7 +617,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
                char axis;
        
                /* Initialize */
-               switch(key_type) {
+               switch (key_type) {
                        case XKEY:
                                axis = 'X';
                                constraint_axis = CON_AXIS0;
@@ -1141,9 +1141,11 @@ int calculateTransformCenter(bContext *C, int centerMode, float *cent3d, int *ce
 
                calculateCenter(t);
 
-               if(cent2d)
+               if (cent2d) {
                        copy_v2_v2_int(cent2d, t->center2d);
-               if(cent3d) {
+               }
+
+               if (cent3d) {
                        // Copy center from constraint center. Transform center can be local
                        copy_v3_v3(cent3d, t->con.center);
                }
index 213a22b2c10238ee608f052e8b5491a0b4ef960b..1e22179a432df259d73762e382e26bec74252a5c 100644 (file)
@@ -1920,10 +1920,10 @@ static void VertsToTransData(TransInfo *t, TransData *td, TransDataExtension *tx
                td->val = bweight;
                td->ival = bweight ? *(bweight) : 1.0f;
        }
-       else if(t->mode == TFM_SKIN_RESIZE) {
+       else if (t->mode == TFM_SKIN_RESIZE) {
                MVertSkin *vs = CustomData_bmesh_get(&em->bm->vdata,
-                                                                                        eve->head.data,
-                                                                                        CD_MVERT_SKIN);
+                                                    eve->head.data,
+                                                    CD_MVERT_SKIN);
                /* skin node size */
                td->ext = tx;
                copy_v3_v3(tx->isize, vs->radius);
index 6da7d9e10e301c420956801e4bc8ccd2b19b53f3..f09310e53c70f444918f4988892a44ee3c873c3e 100644 (file)
@@ -195,7 +195,7 @@ GPUBuffer *GPU_buffer_alloc(int size)
        /* bad case, leads to leak of buf since buf->pointer will allocate
         * NULL, leading to return without cleanup. In any case better detect early
         * psy-fi */
-       if(size == 0)
+       if (size == 0)
                return NULL;
 
        pool = gpu_get_global_buffer_pool();
index b266af150609fee3c662f60e8322a8e5630fe156..8099f6d3f13e28da0ba2167fc01a5186790db73a 100644 (file)
@@ -586,9 +586,9 @@ static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_pr
        int totnode, curnode, rendering= 1, n;
        bNodeTreeExec *exec= ntree->execdata;
        
-       if(ntree==NULL) return;
+       if (ntree == NULL) return;
        
-       if(do_preview)
+       if (do_preview)
                ntreeInitPreview(ntree, 0, 0);
        
        if (!ntree->execdata) {
@@ -598,7 +598,7 @@ static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_pr
        ntree_composite_texnode(ntree, 1);
        
        /* prevent unlucky accidents */
-       if(G.background)
+       if (G.background)
                rd->scemode &= ~R_COMP_CROP;
        
        /* setup callerdata for thread callback */
@@ -613,15 +613,15 @@ static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_pr
 
        BLI_init_threads(&threads, exec_composite_node, rd->threads);
        
-       while(rendering) {
+       while (rendering) {
                
-               if(BLI_available_threads(&threads)) {
+               if (BLI_available_threads(&threads)) {
                        nodeexec= getExecutableNode(exec);
-                       if(nodeexec) {
+                       if (nodeexec) {
                                node = nodeexec->node;
-                               if(ntree->progress && totnode)
+                               if (ntree->progress && totnode)
                                        ntree->progress(ntree->prh, (1.0f - curnode/(float)totnode));
-                               if(ntree->stats_draw) {
+                               if (ntree->stats_draw) {
                                        char str[128];
                                        BLI_snprintf(str, sizeof(str), "Compositing %d %s", curnode, node->name);
                                        ntree->stats_draw(ntree->sdh, str);
@@ -640,21 +640,21 @@ static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_pr
                
                rendering= 0;
                /* test for ESC */
-               if(ntree->test_break && ntree->test_break(ntree->tbh)) {
-                       for(node= ntree->nodes.first; node; node= node->next)
+               if (ntree->test_break && ntree->test_break(ntree->tbh)) {
+                       for (node= ntree->nodes.first; node; node= node->next)
                                node->exec |= NODE_READY;
                }
                
                /* check for ready ones, and if we need to continue */
-               for(n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+               for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
                        node = nodeexec->node;
-                       if(node->exec & NODE_READY) {
-                               if((node->exec & NODE_FINISHED)==0) {
+                       if (node->exec & NODE_READY) {
+                               if ((node->exec & NODE_FINISHED)==0) {
                                        BLI_remove_thread(&threads, nodeexec); /* this waits for running thread to finish btw */
                                        node->exec |= NODE_FINISHED;
                                        
                                        /* freeing unused buffers */
-                                       if(rd->scemode & R_COMP_FREE)
+                                       if (rd->scemode & R_COMP_FREE)
                                                freeExecutableNode(exec);
                                }
                        }
@@ -670,7 +670,7 @@ static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_pr
 
 void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int do_preview)
 {
-       if(G.rt == 200)
+       if (G.rt == 200)
                ntreeCompositExecTreeOld(ntree, rd, do_preview);
        else
                COM_execute(ntree, rendering);
index 21aad779f89aabb6b73dff803ed6a164d19860db..fa1af821a2dce59336c6962308e297f12d91bbc6 100644 (file)
@@ -552,7 +552,7 @@ static bNodeSocket *group_verify_socket(bNodeTree *ntree, ListBase *lb, int in_o
                sock->groupsock = gsock;
                
                BLI_strncpy(sock->name, gsock->name, sizeof(sock->name));
-               if(gsock->type != sock->type)
+               if (gsock->type != sock->type)
                        nodeSocketSetType(sock, gsock->type);
                
                /* XXX hack: group socket input/output roles are inverted internally,
index 9fa02046e498ed7aa30e2257ef4fe94378125bd9..1d3099db189e639a9ce5b64af40f8326f8b579ed 100644 (file)
@@ -178,7 +178,7 @@ void BPY_modules_update(bContext *C)
 
        /* refreshes the main struct */
        BPY_update_rna_module();
-       if(bpy_context_module)
+       if (bpy_context_module)
                bpy_context_module->ptr.data = (void *)C;
 }
 
index e25fac9b310336981f9d4ab8be28ff401d195b8e..fe18fd040eb410ead86c80eefb3c8d11bce3344e 100644 (file)
@@ -6347,7 +6347,7 @@ PyObject *BPY_rna_module(void)
 
 void BPY_update_rna_module(void)
 {
-       if(rna_module_ptr) {
+       if (rna_module_ptr) {
 #if 0
                RNA_main_pointer_create(G.main, rna_module_ptr);
 #else
index eb628b87b3d59e45d498fce95115ab24920589bb..150bfae47311fb177ab89b75297a0f3bb25d6398 100644 (file)
@@ -4318,7 +4318,7 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
                                /* Baking lets us define a quad split order */
                                split_quads(obr, re->r.bake_quad_split);
                        }
-                       else if(BKE_object_is_animated(re->scene, ob))
+                       else if (BKE_object_is_animated(re->scene, ob))
                                split_quads(obr, 1);
                        else {
                                if ((re->r.mode & R_SIMPLIFY && re->r.simplify_flag & R_SIMPLE_NO_TRIANGULATE) == 0)