Code cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Mon, 17 Mar 2014 10:48:13 +0000 (21:48 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 17 Mar 2014 10:48:13 +0000 (21:48 +1100)
intern/cycles/app/cycles_xml.cpp
intern/cycles/blender/blender_mesh.cpp
intern/guardedalloc/intern/mallocn.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/implicit.c
source/blender/editors/curve/editcurve.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/render/intern/source/render_texture.c

index 10bcbf6a63e876eae3422f5dda66c62eeefea6ba..998531a577be73e2b66eaef196ad15f5a7973b2a 100644 (file)
@@ -877,7 +877,7 @@ static void xml_read_mesh(const XMLReadState& state, pugi::xml_node node)
                SubdParams sdparams(mesh, shader, smooth);
                xml_read_float(&sdparams.dicing_rate, node, "dicing_rate");
 
-               DiagSplit dsplit(sdparams);;
+               DiagSplit dsplit(sdparams);
                sdmesh.tessellate(&dsplit);
        }
        else {
index 61c6ef6af1b8f6b832157656f443eae22e39f6eb..0972cf6a93994c324864d6bd3dceeffeabd5ec87 100644 (file)
@@ -414,7 +414,7 @@ static void create_subd_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, PointerR
        //sdparams.camera = scene->camera;
 
        /* tesselate */
-       DiagSplit dsplit(sdparams);;
+       DiagSplit dsplit(sdparams);
        sdmesh.tessellate(&dsplit);
 }
 
index 2ac01a6c7e4b0d17fa05d318a394352ed86c10ba..4d00616202edfbfc124303fe6a302561848c0dd2 100644 (file)
@@ -43,7 +43,7 @@ size_t (*MEM_allocN_len)(const void *vmemh) = MEM_lockfree_allocN_len;
 void (*MEM_freeN)(void *vmemh) = MEM_lockfree_freeN;
 void *(*MEM_dupallocN)(const void *vmemh) = MEM_lockfree_dupallocN;
 void *(*MEM_reallocN_id)(void *vmemh, size_t len, const char *str) = MEM_lockfree_reallocN_id;
-void *(*MEM_recallocN_id)(void *vmemh, size_t len, const char *str) = MEM_lockfree_recallocN_id;;
+void *(*MEM_recallocN_id)(void *vmemh, size_t len, const char *str) = MEM_lockfree_recallocN_id;
 void *(*MEM_callocN)(size_t len, const char *str) = MEM_lockfree_callocN;
 void *(*MEM_mallocN)(size_t len, const char *str) = MEM_lockfree_mallocN;
 void *(*MEM_mapallocN)(size_t len, const char *str) = MEM_lockfree_mapallocN;
@@ -71,7 +71,7 @@ void MEM_use_guarded_allocator(void)
        MEM_freeN = MEM_guarded_freeN;
        MEM_dupallocN = MEM_guarded_dupallocN;
        MEM_reallocN_id = MEM_guarded_reallocN_id;
-       MEM_recallocN_id = MEM_guarded_recallocN_id;;
+       MEM_recallocN_id = MEM_guarded_recallocN_id;
        MEM_callocN = MEM_guarded_callocN;
        MEM_mallocN = MEM_guarded_mallocN;
        MEM_mapallocN = MEM_guarded_mapallocN;
index 3ab522ac24b655c13e8df2ecf78ee7c9769e62ac..220ceb81d44a74f7acbb3ef59b22a8dd9b440e37 100644 (file)
@@ -1149,13 +1149,14 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
                if ( spring ) {
                        spring_verts_ordered_set(spring, medge[i].v1, medge[i].v2);
-                       if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW && medge[i].flag & ME_LOOSEEDGE) {
+                       if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW && medge[i].flag & ME_LOOSEEDGE) {
                                // handle sewing (loose edges will be pulled together)
                                spring->restlen = 0.0f;
                                spring->stiffness = 1.0f;
                                spring->type = CLOTH_SPRING_TYPE_SEWING;
-                       } else {
-                               if(clmd->sim_parms->vgroup_shrink > 0)
+                       }
+                       else {
+                               if (clmd->sim_parms->vgroup_shrink > 0)
                                        shrink_factor = 1.0f - ((cloth->verts[spring->ij].shrink_factor + cloth->verts[spring->kl].shrink_factor) / 2.0f);
                                else
                                        shrink_factor = 1.0f - clmd->sim_parms->shrink_min;
@@ -1200,7 +1201,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
                }
 
                spring_verts_ordered_set(spring, mface[i].v1, mface[i].v3);
-               if(clmd->sim_parms->vgroup_shrink > 0)
+               if (clmd->sim_parms->vgroup_shrink > 0)
                        shrink_factor = 1.0f - ((cloth->verts[spring->ij].shrink_factor + cloth->verts[spring->kl].shrink_factor) / 2.0f);
                else
                        shrink_factor = 1.0f - clmd->sim_parms->shrink_min;
@@ -1224,7 +1225,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
                }
 
                spring_verts_ordered_set(spring, mface[i].v2, mface[i].v4);
-               if(clmd->sim_parms->vgroup_shrink > 0)
+               if (clmd->sim_parms->vgroup_shrink > 0)
                        shrink_factor = 1.0f - ((cloth->verts[spring->ij].shrink_factor + cloth->verts[spring->kl].shrink_factor) / 2.0f);
                else
                        shrink_factor = 1.0f - clmd->sim_parms->shrink_min;
index f3fa5f75dbb66711f82e080e76dd2a77b81b2b75..b5f631648eac170692fdca23197e6a5f49606146 100644 (file)
@@ -596,7 +596,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
        while (dl) {
                if (dl->type == DL_SURF) {
                        if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U) == 0) {
-                               if ( (cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
+                               if ((cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
                                        dlnew = MEM_callocN(sizeof(DispList), "filldisp");
                                        BLI_addtail(&front, dlnew);
                                        dlnew->verts = fp1 = MEM_mallocN(sizeof(float) * 3 * dl->parts, "filldisp1");
index 08959850fb959d412eed53607ca3252d35220531..cceb792519494e660d11f7c45fcd722f382667f7 100644 (file)
@@ -1271,16 +1271,17 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
                        k = scaling / (clmd->sim_parms->avg_spring_len + FLT_EPSILON);
 
                        // TODO: verify, half verified (couldn't see error)
-                       if(s->type & CLOTH_SPRING_TYPE_SEWING) {
-                               // sewing springs usually have a large distance at first so clamp the force so we don't get tunnelling through colission objects
-                               float force = k*(length-L);
-                               if(force > clmd->sim_parms->max_sewing) {
-                                       force = clmd->sim_parms->max_sewing;
-                               }
-                               mul_fvector_S(stretch_force, dir, force);
-                       } else {
-                               mul_fvector_S(stretch_force, dir, k*(length-L));
-                       }
+                       if (s->type & CLOTH_SPRING_TYPE_SEWING) {
+                               // sewing springs usually have a large distance at first so clamp the force so we don't get tunnelling through colission objects
+                               float force = k*(length-L);
+                               if (force > clmd->sim_parms->max_sewing) {
+                                       force = clmd->sim_parms->max_sewing;
+                               }
+                               mul_fvector_S(stretch_force, dir, force);
+                       }
+                       else {
+                               mul_fvector_S(stretch_force, dir, k * (length - L));
+                       }
 
                        VECADD(s->f, s->f, stretch_force);
 
index 31c91ad01eb414dd0a73992cac1d081b07fc6ac2..db233c6753b720660181c60dc4c571975dad829f 100644 (file)
@@ -4369,7 +4369,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
                        if (isNurbsel_count(cu, nu) == 1) {
                                /* only 1 selected, not first or last, a little complex, but intuitive */
                                if (nu->pntsv == 1) {
-                                       if ( (nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) {
+                                       if ((nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) {
                                                /* pass */
                                        }
                                        else {
index 94f6174de65b25a3d4539031812ddbc7eeede487..4a298e183e6e790700812020a57ee28b837e0c38 100644 (file)
@@ -494,7 +494,7 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
        
        if (RNA_struct_find_property(op->ptr, "index")) {
                int index = RNA_int_get(op->ptr, "index");
-               if ( (index > -1) && (index < nentries)) {
+               if ((index > -1) && (index < nentries)) {
                        char name[FILE_MAX];
                        
                        fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index);
index 3af947b472ea6c1a30d0da6583d56312511acca7..d8a66979565868002da7a48deadc74ee45ab0d1d 100644 (file)
@@ -882,7 +882,7 @@ static void stitch_propagate_uv_final_position(Scene *scene,
                        }
 
                        /* end of calculations, keep only the selection flag */
-                       if ( (!state->snap_islands) || ((!state->midpoints) && (element_iter->island == state->static_island))) {
+                       if ((!state->snap_islands) || ((!state->midpoints) && (element_iter->island == state->static_island))) {
                                element_iter->flag &= STITCH_SELECTED;
                        }
 
index 2718d2090cdf8862dd02bfc27776ff977177e96a..ce1f1467393ad3a87756681925d4105a4562ea3f 100644 (file)
@@ -2321,7 +2321,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
 
                        /* texture output */
 
-                       if ( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+                       if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
                                texres.tin = rgb_to_grayscale(&texres.tr);
                                rgbnor -= TEX_RGB;
                        }
@@ -2759,7 +2759,7 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float col_
                        
                        /* texture output */
 
-                       if ( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+                       if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
                                texres.tin = rgb_to_grayscale(&texres.tr);
                                rgbnor -= TEX_RGB;
                        }