style cleanup: whitespace / commas
authorCampbell Barton <ideasman42@gmail.com>
Sun, 29 Apr 2012 15:47:02 +0000 (15:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 29 Apr 2012 15:47:02 +0000 (15:47 +0000)
249 files changed:
source/blender/avi/intern/avi.c
source/blender/avi/intern/avirgb.c
source/blender/avi/intern/codecs.c
source/blender/avi/intern/endian.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenkernel/BKE_cloth.h
source/blender/blenkernel/BKE_font.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_ocean.h
source/blender/blenkernel/BKE_softbody.h
source/blender/blenkernel/depsgraph_private.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/navmesh_conversion.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/ocean.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/unit.c
source/blender/blenkernel/intern/writeframeserver.c
source/blender/blenlib/BLI_fileops_types.h
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/BLI_kdtree.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/jitter.c
source/blender/blenlib/intern/listbase.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/string.c
source/blender/blenlib/intern/string_utf8.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/iff.h
source/blender/bmesh/intern/bmesh_walkers_impl.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationExporter.h
source/blender/collada/AnimationImporter.cpp
source/blender/collada/AnimationImporter.h
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/ArmatureImporter.h
source/blender/collada/CameraExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/collada/LightExporter.cpp
source/blender/collada/TransformWriter.cpp
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/editcurve.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_opengl.c
source/blender/editors/screen/area.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_material.c
source/blender/ikplugin/intern/iksolver_plugin.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/bmp.c
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/imageprocess.c
source/blender/imbuf/intern/indexer_dv.c
source/blender/imbuf/intern/iris.c
source/blender/imbuf/intern/jp2.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/targa.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_listBase.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_fluidsim.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_movieclip.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_property.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_texture_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
source/blender/nodes/composite/nodes/node_composite_channelMatte.c
source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
source/blender/nodes/composite/nodes/node_composite_colorMatte.c
source/blender/nodes/composite/nodes/node_composite_colorSpill.c
source/blender/nodes/composite/nodes/node_composite_colorbalance.c
source/blender/nodes/composite/nodes/node_composite_diffMatte.c
source/blender/nodes/composite/nodes/node_composite_directionalblur.c
source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
source/blender/nodes/composite/nodes/node_composite_filter.c
source/blender/nodes/composite/nodes/node_composite_gamma.c
source/blender/nodes/composite/nodes/node_composite_glare.c
source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
source/blender/nodes/composite/nodes/node_composite_levels.c
source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
source/blender/nodes/composite/nodes/node_composite_texture.c
source/blender/nodes/composite/nodes/node_composite_tonemap.c
source/blender/nodes/intern/node_socket.c
source/blender/nodes/shader/nodes/node_shader_texture.c
source/blender/nodes/texture/nodes/node_texture_bricks.c
source/blender/nodes/texture/nodes/node_texture_mixRgb.c
source/blender/nodes/texture/nodes/node_texture_texture.c
source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/apple/quicktime_import.c
source/blender/render/intern/include/render_types.h
source/blender/render/intern/include/sunsky.h
source/blender/render/intern/raytrace/bvh.h
source/blender/render/intern/raytrace/rayobject_blibvh.cpp
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/raytrace/rayobject_qbvh.cpp
source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
source/blender/render/intern/raytrace/rayobject_svbvh.cpp
source/blender/render/intern/raytrace/rayobject_vbvh.cpp
source/blender/render/intern/raytrace/reorganize.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/sunsky.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/voxeldata.c
source/blender/render/intern/source/zbuf.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/VideoTexture/ImageRender.cpp

index 637d4be..ea83afb 100644 (file)
@@ -638,7 +638,7 @@ AviError AVI_open_movie (const char *name, AviMovie *movie)
                        return AVI_ERROR_FORMAT;
                }
 
-               movie->entries = (AviIndexEntry *) MEM_mallocN (movie->index_entries * sizeof(AviIndexEntry),"movieentries");
+               movie->entries = (AviIndexEntry *) MEM_mallocN (movie->index_entries * sizeof(AviIndexEntry), "movieentries");
 
                for (temp=0; temp < movie->index_entries; temp++) {
                        movie->entries[temp].ChunkId = GET_FCC (movie->fp);
@@ -701,7 +701,7 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
        fseek (movie->fp, movie->read_offset + movie->entries[i-1].Offset, SEEK_SET);
 
        temp = GET_FCC(movie->fp);
-       buffer = MEM_mallocN (temp,"readbuffer");
+       buffer = MEM_mallocN (temp, "readbuffer");
 
        if (fread (buffer, 1, temp, movie->fp) != temp) {
                MEM_freeN(buffer);
@@ -755,14 +755,14 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
        if (movie->fp == NULL)
                return AVI_ERROR_OPEN;
 
-       movie->offset_table = (int64_t *) MEM_mallocN ((1+streams*2) * sizeof (int64_t),"offsettable");
+       movie->offset_table = (int64_t *) MEM_mallocN ((1+streams*2) * sizeof (int64_t), "offsettable");
        
        for (i=0; i < 1 + streams*2; i++)
                movie->offset_table[i] = -1L;
 
        movie->entries = NULL;
 
-       movie->header = (AviMainHeader *) MEM_mallocN (sizeof(AviMainHeader),"movieheader");
+       movie->header = (AviMainHeader *) MEM_mallocN (sizeof(AviMainHeader), "movieheader");
 
        movie->header->fcc = FCC("avih");
        movie->header->size = 56;
@@ -781,7 +781,7 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
        movie->header->Reserved[2] = 0;
        movie->header->Reserved[3] = 0;
 
-       movie->streams = (AviStreamRec *) MEM_mallocN (sizeof(AviStreamRec) * movie->header->Streams,"moviestreams");
+       movie->streams = (AviStreamRec *) MEM_mallocN (sizeof(AviStreamRec) * movie->header->Streams, "moviestreams");
 
        va_start (ap, streams);
 
@@ -818,7 +818,7 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
 #if 0
                        if (movie->streams[i].format == AVI_FORMAT_MJPEG) {
                                movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader) 
-                                                                               + sizeof(AviMJPEGUnknown),"moviestreamformatL");
+                                                                               + sizeof(AviMJPEGUnknown), "moviestreamformatL");
                                movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader) + sizeof(AviMJPEGUnknown);
                        }
                        else {
@@ -952,7 +952,7 @@ AviError AVI_write_frame (AviMovie *movie, int frame_num, ...)
 
        if (frame_num+1 > movie->index_entries) {
                temp = (AviIndexEntry *) MEM_mallocN ((frame_num+1) * 
-                       (movie->header->Streams+1) * sizeof(AviIndexEntry),"newidxentry");
+                       (movie->header->Streams+1) * sizeof(AviIndexEntry), "newidxentry");
                if (movie->entries != NULL) {
                        memcpy (temp, movie->entries, movie->index_entries * (movie->header->Streams+1)
                                * sizeof(AviIndexEntry));
@@ -1062,7 +1062,7 @@ AviError AVI_close_compress (AviMovie *movie)
 
        fseek (movie->fp, movie->movi_offset, SEEK_SET);
 
-       PUT_FCCN((movi_size-(movie->movi_offset+4L)),movie->fp);
+       PUT_FCCN((movi_size-(movie->movi_offset+4L)), movie->fp);
 
        fclose (movie->fp);
 
index 8e5806c..e06d0bb 100644 (file)
@@ -45,7 +45,7 @@
 
 void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size)
 {
-       int x, y,i, rowstride;
+       int x, y, i, rowstride;
        unsigned char *buf;
        AviBitmapInfoHeader *bi;
        short bits= 32;
@@ -127,7 +127,7 @@ void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buff
        *size= movie->header->Height * movie->header->Width * 3;
        if (movie->header->Width%2) *size+= movie->header->Height;
        
-       buf = MEM_mallocN (*size,"toavirgbbuf");
+       buf = MEM_mallocN (*size, "toavirgbbuf");
 
        rowstride = movie->header->Width*3;
        if (movie->header->Width%2) rowstride++;
index 2c24417..222900b 100644 (file)
@@ -90,9 +90,9 @@ int avi_get_data_id (AviFormat format, int stream)
        char fcc[5];
 
        if (avi_get_format_type (format) == FCC("vids"))
-               sprintf (fcc,"%2.2ddc",stream);
+               sprintf (fcc, "%2.2ddc", stream);
        else if (avi_get_format_type (format) == FCC("auds"))
-               sprintf (fcc,"%2.2ddc",stream);
+               sprintf (fcc, "%2.2ddc", stream);
        else
                return 0;
 
index adcc7e8..eb9e586 100644 (file)
@@ -49,7 +49,7 @@
 #ifdef __BIG_ENDIAN__
 static void invert (int *num)
 {
-       int new=0,i,j;
+       int new=0, i, j;
 
        for (j=0; j < 4; j++) {
                for (i=0; i<8; i++) {
@@ -63,7 +63,7 @@ static void invert (int *num)
 static void sinvert (short int *num)
 {
        short int new=0;
-       int i,j;
+       int i, j;
 
        for (j=0; j < 2; j++) {
                for (i=0; i<8; i++) {
index 033efbf..9309cf1 100644 (file)
@@ -341,7 +341,7 @@ static void blf_texture5_draw(const float shadow_col[4], float uv[2][2], float x
 static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x1, float y1, float x2, float y2)
 {
        float soft[9] = {1/16.0f, 2/16.0f, 1/16.0f,
-                        2/16.0f,4/16.0f, 2/16.0f,
+                        2/16.0f, 4/16.0f, 2/16.0f,
                         1/16.0f, 2/16.0f, 1/16.0f};
 
        float color[4], *fp = soft;
index 623dbd9..378cc72 100644 (file)
@@ -169,10 +169,10 @@ typedef enum
 /* Spring types as defined in the paper.*/
 typedef enum
 {
-       CLOTH_SPRING_TYPE_STRUCTURAL  = ( 1 << 1 ),
-       CLOTH_SPRING_TYPE_SHEAR  = ( 1 << 2 ) ,
-       CLOTH_SPRING_TYPE_BENDING  = ( 1 << 3 ),
-       CLOTH_SPRING_TYPE_GOAL  = ( 1 << 4 ),
+       CLOTH_SPRING_TYPE_STRUCTURAL  = (1 << 1),
+       CLOTH_SPRING_TYPE_SHEAR       = (1 << 2),
+       CLOTH_SPRING_TYPE_BENDING     = (1 << 3),
+       CLOTH_SPRING_TYPE_GOAL        = (1 << 4)
 } CLOTH_SPRING_TYPES;
 
 /* SPRING FLAGS */
index e94787c..16e98f2 100644 (file)
@@ -49,7 +49,7 @@ struct Main;
 struct chartrans {
        float xof, yof;
        float rot;
-       short linenr,charnr;
+       short linenr, charnr;
        char dobreak;
 };
 
index b18d250..be21996 100644 (file)
@@ -85,7 +85,7 @@ struct ID *find_id(const char *type, const char *name);
 void clear_id_newpoins(void);
 
 void IDnames_to_pupstring(const char **str, const char *title, const char *extraops,
-                          struct ListBase *lb,struct ID* link, short *nr);
+                          struct ListBase *lb, struct ID* link, short *nr);
 void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops,
                            struct ListBase *lb, struct ID *link, short *nr);
 
index 742e6ef..14cb5d1 100644 (file)
@@ -146,7 +146,7 @@ void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert);
 void mesh_delete_material_index(struct Mesh *me, short index);
 void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
 void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh);
-void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts,struct  MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
+void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts, struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
 
 /* used for unit testing; compares two meshes, checking only
  * differences we care about.  should be usable with leaf's
index cb161b2..a4eddd0 100644 (file)
@@ -123,7 +123,7 @@ typedef struct bNodeTemplate {
  * implementing the node behavior.
  */
 typedef struct bNodeType {
-       void *next,*prev;
+       void *next, *prev;
        short needs_free;               /* set for allocated types that need to be freed */
        
        int type;
index 7c0d99b..5f7f774 100644 (file)
@@ -79,8 +79,8 @@ struct Ocean *BKE_add_ocean(void);
 void BKE_free_ocean_data(struct Ocean *oc);
 void BKE_free_ocean(struct Ocean *oc);
 
-void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, float l, float A, float w, float damp, 
-                                       float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed);
+void BKE_init_ocean(struct Ocean* o, int M, int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
+                    float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed);
 void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount);
 
 /* sampling the ocean surface */
index 6714225..547fd9e 100644 (file)
@@ -39,9 +39,9 @@ typedef struct BodyPoint {
        float origS[3], origE[3], origT[3], pos[3], vec[3], force[3];
        float goal;
        float prevpos[3], prevvec[3], prevdx[3], prevdv[3]; /* used for Heun integration */
-       float impdv[3],impdx[3];
+       float impdv[3], impdx[3];
        int nofsprings; int *springs;
-       float choke,choke2,frozen;
+       float choke, choke2, frozen;
        float colball;
        short loc_flag; //reserved by locale module specific states
        //char octantflag;
@@ -68,7 +68,7 @@ extern void                           sbObjectToSoftbody(struct Object *ob);
 /* pass NULL to unlink again */
 extern void             sbSetInterruptCallBack(int (*f)(void));
 
-extern void             SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3]);
+extern void             SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]);
 
 
 #endif
index f27ee2f..c5e2f09 100644 (file)
@@ -117,10 +117,10 @@ DagNode * get_top_node_queue(DagNodeQueue *queue);
 DagForest *getMainDag(void);
 void setMainDag(DagForest *dag);
 DagForest * dag_init(void);
-DagNode * dag_find_node (DagForest *forest,void * fob);
-DagNode * dag_add_node (DagForest *forest,void * fob);
-DagNode * dag_get_node (DagForest *forest,void * fob);
-DagNode * dag_get_sub_node (DagForest *forest,void * fob);
+DagNode * dag_find_node (DagForest *forest, void * fob);
+DagNode * dag_add_node (DagForest *forest, void * fob);
+DagNode * dag_get_node (DagForest *forest, void * fob);
+DagNode * dag_get_sub_node (DagForest *forest, void * fob);
 void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, const char *name);
 
 void graph_bfs(void);
index 0fd030b..4406ca6 100644 (file)
@@ -322,7 +322,7 @@ int DM_release(DerivedMesh *dm)
 {
        if (dm->needsFree) {
                bvhcache_free(&dm->bvhCache);
-               GPU_drawobject_free( dm );
+               GPU_drawobject_free(dm);
                CustomData_free(&dm->vertData, dm->numVertData);
                CustomData_free(&dm->edgeData, dm->numEdgeData);
                CustomData_free(&dm->faceData, dm->numTessFaceData);
@@ -2536,11 +2536,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
 
                        if (mf->v4) {
                                v4= &mvert[mf->v4];
-                               normal_quad_v3( fno,v4->co, v3->co, v2->co, v1->co);
+                               normal_quad_v3(fno, v4->co, v3->co, v2->co, v1->co);
                        }
                        else {
                                v4= NULL;
-                               normal_tri_v3( fno,v3->co, v2->co, v1->co);
+                               normal_tri_v3(fno, v3->co, v2->co, v1->co);
                        }
                
                        if (mtface) {
@@ -2551,11 +2551,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
                        }
                        else {
                                uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
-                               map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
-                               map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
-                               map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
+                               map_to_sphere( &uv[0][0], &uv[0][1], orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
+                               map_to_sphere( &uv[1][0], &uv[1][1], orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
+                               map_to_sphere( &uv[2][0], &uv[2][1], orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
                                if (v4)
-                                       map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
+                                       map_to_sphere( &uv[3][0], &uv[3][1], orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
                        }
                
                        tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang);
@@ -2578,11 +2578,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
                        len= (mf->v4)? 4 : 3; 
 
                        if (mtface == NULL) {
-                               map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
-                               map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
-                               map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
+                               map_to_sphere( &uv[0][0], &uv[0][1], orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
+                               map_to_sphere( &uv[1][0], &uv[1][1], orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
+                               map_to_sphere( &uv[2][0], &uv[2][1], orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
                                if (len==4)
-                                       map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
+                                       map_to_sphere( &uv[3][0], &uv[3][1], orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
                        }
                
                        mf_vi[0]= mf->v1;
@@ -3117,7 +3117,7 @@ static void dm_debug_info_layers(DynStr *dynstr, DerivedMesh *dm, void *(*getEle
                        CustomData_file_write_info(type, &structname, &structnum);
                        BLI_dynstr_appendf(dynstr,
                                           "        dict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, length=%d),\n",
-                                                          name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size));
+                                          name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size));
                }
        }
 }
index 38c73ba..7afcd82 100644 (file)
@@ -863,9 +863,9 @@ static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
                        vec[0]= -no_s[0]; vec[1]= -no_s[1]; vec[2]= -no_s[2];
                }
                
-               vec_to_quat( q2,vec, vdd->ob->trackflag, vdd->ob->upflag);
+               vec_to_quat(q2, vec, vdd->ob->trackflag, vdd->ob->upflag);
                
-               quat_to_mat3( mat,q2);
+               quat_to_mat3(mat, q2);
                copy_m4_m4(tmat, obmat);
                mul_m4_m4m3(obmat, tmat, mat);
        }
@@ -1142,8 +1142,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
                                                copy_v3_v3(obmat[3], cent);
                                                
                                                /* rotation */
-                                               tri_to_quat( quat,v1, v2, v3);
-                                               quat_to_mat3( mat,quat);
+                                               tri_to_quat(quat, v1, v2, v3);
+                                               quat_to_mat3(mat, quat);
                                                
                                                /* scale */
                                                if (par->transflag & OB_DUPLIFACES_SCALE) {
@@ -1329,7 +1329,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                else
                        a = totpart;
 
-               for (pa=psys->particles,counter=0; a<totpart+totchild; a++,pa++,counter++) {
+               for (pa=psys->particles, counter=0; a<totpart+totchild; a++, pa++, counter++) {
                        if (a<totpart) {
                                /* handle parent particle */
                                if (pa->flag & no_draw_flag)
@@ -1505,7 +1505,7 @@ static Object *find_family_object(Object **obar, char *family, char ch)
        
        ob= G.main->object.first;
        while (ob) {
-               if ( ob->id.name[flen+2]==ch ) {
+               if (ob->id.name[flen + 2] == ch) {
                        if ( strncmp(ob->id.name+2, family, flen)==0 ) break;
                }
                ob= ob->id.next;
index 0827cb5..48ba9ca 100644 (file)
@@ -471,7 +471,7 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
        next = pchan->child;
 
        /* find the handle points, since this is inside bone space, the
-        * first point = (0,0,0)
+        * first point = (0, 0, 0)
         * last point =  (0, length, 0) */
        if (rest) {
                invert_m4_m4(imat, pchan->bone->arm_mat);
@@ -1028,13 +1028,13 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
 
                                if (armature_weight != 1.0f) {
                                        copy_v3_v3(dco, co);
-                                       mul_v3m3_dq( dco, (defMats) ? summat : NULL,dq);
+                                       mul_v3m3_dq(dco, (defMats) ? summat : NULL, dq);
                                        sub_v3_v3(dco, co);
                                        mul_v3_fl(dco, armature_weight);
                                        add_v3_v3(co, dco);
                                }
                                else
-                                       mul_v3m3_dq( co, (defMats) ? summat : NULL,dq);
+                                       mul_v3m3_dq(co, (defMats) ? summat : NULL, dq);
 
                                smat = summat;
                        }
@@ -1366,12 +1366,12 @@ void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], floa
        if (newMode > 0) { /* to euler */
                if (oldMode == ROT_MODE_AXISANGLE) {
                        /* axis-angle to euler */
-                       axis_angle_to_eulO( eul, newMode,axis, *angle);
+                       axis_angle_to_eulO( eul, newMode, axis, *angle);
                }
                else if (oldMode == ROT_MODE_QUAT) {
                        /* quat to euler */
                        normalize_qt(quat);
-                       quat_to_eulO(eul, newMode,quat);
+                       quat_to_eulO(eul, newMode, quat);
                }
                /* else { no conversion needed } */
        }
@@ -1464,7 +1464,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
         * was 0.000001, causes bug [#30438] (which is same as [#27675, imho).
         * Reseting it to org value seems to cause no more [#23954]...
         */
-       if (dot_v3v3(axis,axis) > 1.0e-13f) {
+       if (dot_v3v3(axis, axis) > 1.0e-13f) {
                /* if nor is *not* a multiple of target ... */
                normalize_v3(axis);
 
@@ -1478,7 +1478,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
                float updown;
 
                /* point same direction, or opposite? */
-               updown = (dot_v3v3(target,nor) > 0) ? 1.0f : -1.0f;
+               updown = (dot_v3v3(target, nor) > 0) ? 1.0f : -1.0f;
 
                /* I think this should work... */
                bMatrix[0][0] = updown; bMatrix[0][1] = 0.0;    bMatrix[0][2] = 0.0;
@@ -2309,8 +2309,8 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
 
                                                /* make a copy of starting conditions */
                                                copy_v3_v3(loc, pchan->pose_mat[3]);
-                                               mat4_to_eul( eul,pchan->pose_mat);
-                                               mat4_to_size( size,pchan->pose_mat);
+                                               mat4_to_eul(eul, pchan->pose_mat);
+                                               mat4_to_size(size, pchan->pose_mat);
                                                copy_v3_v3(eulo, eul);
                                                copy_v3_v3(sizeo, size);
 
index 9c9b207..471f09a 100644 (file)
@@ -722,7 +722,7 @@ void BKE_undo_save_quit(void)
                
        BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend");
 
-       file = BLI_open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
+       file = BLI_open(str, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666);
        if (file == -1) {
                //XXX error("Unable to save %s, check you have permissions", str);
                return;
index fbcabcc..014b3f5 100644 (file)
@@ -230,8 +230,8 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
 
                        /* avoid head-on collision */
                        if (dot_v3v3(col.pce.nor, pa->prev_state.ave) < -0.99f) {
-                               /* don't know why, but uneven range [0.0,1.0] */
-                               /* works much better than even [-1.0,1.0] */
+                               /* don't know why, but uneven range [0.0, 1.0] */
+                               /* works much better than even [-1.0, 1.0] */
                                bbd->wanted_co[0] = BLI_frand();
                                bbd->wanted_co[1] = BLI_frand();
                                bbd->wanted_co[2] = BLI_frand();
@@ -262,7 +262,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
 
                        sub_v3_v3v3(vec, vel1, vel2);
                        
-                       inp = dot_v3v3(vec,vec);
+                       inp = dot_v3v3(vec, vec);
 
                        /* velocities not parallel */
                        if (inp != 0.0f) {
@@ -308,7 +308,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
 
                                sub_v3_v3v3(vec, vel1, vel2);
                                
-                               inp = dot_v3v3(vec,vec);
+                               inp = dot_v3v3(vec, vec);
 
                                /* velocities not parallel */
                                if (inp != 0.0f) {
@@ -583,7 +583,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
                copy_v3_v3(bbd->wanted_co, pa->prev_state.ave);
 
                /* may happen at birth */
-               if (dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) {
+               if (dot_v2v2(bbd->wanted_co, bbd->wanted_co)==0.0f) {
                        bbd->wanted_co[0] = 2.0f*(0.5f - BLI_frand());
                        bbd->wanted_co[1] = 2.0f*(0.5f - BLI_frand());
                        bbd->wanted_co[2] = 2.0f*(0.5f - BLI_frand());
@@ -610,7 +610,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
        ParticleData *enemy_pa = NULL;
        BoidParticle *bpa;
        /* friends & enemies */
-       float closest_enemy[3] = {0.0f,0.0f,0.0f};
+       float closest_enemy[3] = {0.0f, 0.0f, 0.0f};
        float closest_dist = fbr->distance + 1.0f;
        float f_strength = 0.0f, e_strength = 0.0f;
        float health = 0.0f;
@@ -748,7 +748,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float grou
                SurfaceModifierData *surmd = NULL;
                float x[3], v[3];
                
-               surmd = (SurfaceModifierData *)modifiers_findByType ( bpa->ground, eModifierType_Surface );
+               surmd = (SurfaceModifierData *)modifiers_findByType(bpa->ground, eModifierType_Surface );
 
                /* take surface velocity into account */
                closest_point_on_surface(surmd, pa->state.co, x, NULL, v);
@@ -1096,7 +1096,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        set_boid_values(&val, boids, pa);
 
        /* make sure there's something in new velocity, location & rotation */
-       copy_particle_key(&pa->state,&pa->prev_state,0);
+       copy_particle_key(&pa->state, &pa->prev_state, 0);
 
        if (bbd->part->flag & PART_SIZEMASS)
                pa_mass*=pa->size;
@@ -1170,13 +1170,13 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                        angle = MIN2(angle, val.max_ave);
 
                        cross_v3_v3v3(nor, old_dir, wanted_dir);
-                       axis_angle_to_quat( q,nor, angle);
+                       axis_angle_to_quat(q, nor, angle);
                        copy_v3_v3(new_dir, old_dir);
                        mul_qt_v3(q, new_dir);
                        normalize_v3(new_dir);
 
                        /* save direction in case resulting velocity too small */
-                       axis_angle_to_quat( q,nor, angle*dtime);
+                       axis_angle_to_quat(q, nor, angle*dtime);
                        copy_v3_v3(pa->state.ave, old_dir);
                        mul_qt_v3(q, pa->state.ave);
                        normalize_v3(pa->state.ave);
@@ -1196,7 +1196,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
                /* maintain minimum flying velocity if not landing */
                if (level >= landing_level) {
-                       float len2 = dot_v2v2(new_vel,new_vel);
+                       float len2 = dot_v2v2(new_vel, new_vel);
                        float root;
 
                        len2 = MAX2(len2, val.min_speed*val.min_speed);
@@ -1427,7 +1427,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        cross_v3_v3v3(mat[1], mat[2], mat[0]);
        
        /* apply rotation */
-       mat3_to_quat_is_ok( q,mat);
+       mat3_to_quat_is_ok(q, mat);
        copy_qt_qt(pa->state.rot, q);
 }
 
index df80ce6..d66dcd8 100644 (file)
@@ -383,7 +383,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float co[3
                        nearest->index = index;
                        nearest->dist = dist;
                        copy_v3_v3(nearest->co, nearest_tmp);
-                       normal_tri_v3( nearest->no,t0, t1, t2);
+                       normal_tri_v3(nearest->no, t0, t1, t2);
                }
 
                t1 = t2;
@@ -402,10 +402,10 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
        MFace *face = data->face + index;
 
        float *t0, *t1, *t2, *t3;
-       t0 = vert[ face->v1 ].co;
-       t1 = vert[ face->v2 ].co;
-       t2 = vert[ face->v3 ].co;
-       t3 = face->v4 ? vert[ face->v4].co : NULL;
+       t0 = vert[face->v1].co;
+       t1 = vert[face->v2].co;
+       t2 = vert[face->v3].co;
+       t3 = face->v4 ? vert[face->v4].co : NULL;
 
        
        do
@@ -421,7 +421,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
                        hit->dist = dist;
                        madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist);
 
-                       normal_tri_v3( hit->no,t0, t1, t2);
+                       normal_tri_v3(hit->no, t0, t1, t2);
                }
 
                t1 = t2;
@@ -706,7 +706,7 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
                if (!data->cached)
                        BLI_bvhtree_free(data->tree);
 
-               memset( data, 0, sizeof(*data) );
+               memset(data, 0, sizeof(*data));
        }
 }
 
@@ -743,11 +743,11 @@ void bvhcache_insert(BVHCache *cache, BVHTree *tree, int type)
 {
        BVHCacheItem *item = NULL;
 
-       assert( tree != NULL );
-       assert( bvhcache_find(cache, type) == NULL );
+       assert(tree != NULL);
+       assert(bvhcache_find(cache, type) == NULL);
 
        item = MEM_mallocN(sizeof(BVHCacheItem), "BVHCacheItem");
-       assert( item != NULL );
+       assert(item != NULL);
 
        item->type = type;
        item->tree = tree;
index 1280122..2be22e0 100644 (file)
@@ -472,7 +472,7 @@ int camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *cam
        float shift[2];
        float plane_tx[4][3];
        float rot_obmat[3][3];
-       const float zero[3]= {0,0,0};
+       const float zero[3]= {0, 0, 0};
        CameraViewFrameData data_cb;
 
        unsigned int i;
index 4de7df0..2a6dbf8 100644 (file)
@@ -322,9 +322,9 @@ static void cdDM_drawVerts(DerivedMesh *dm)
                GPU_vertex_setup(dm);
                if ( !GPU_buffer_legacy(dm) ) {
                        if (dm->drawObject->tot_triangle_point)
-                               glDrawArrays(GL_POINTS,0, dm->drawObject->tot_triangle_point);
+                               glDrawArrays(GL_POINTS, 0, dm->drawObject->tot_triangle_point);
                        else
-                               glDrawArrays(GL_POINTS,0, dm->drawObject->tot_loose_point);
+                               glDrawArrays(GL_POINTS, 0, dm->drawObject->tot_loose_point);
                }
                GPU_buffer_unbind();
        }
@@ -380,7 +380,7 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
                                        }
                                        if ( prevdraw != draw ) {
                                                if ( prevdraw > 0 && (curpos-prevstart) > 0) {
-                                                       glDrawArrays(GL_LINES,prevstart,curpos-prevstart);
+                                                       glDrawArrays(GL_LINES, prevstart, curpos-prevstart);
                                                }
                                                prevstart = curpos;
                                        }
@@ -393,7 +393,7 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
                                        prevdraw = draw;
                                }
                                if ( prevdraw > 0 && (curpos-prevstart) > 0 ) {
-                                       glDrawArrays(GL_LINES,prevstart,curpos-prevstart);
+                                       glDrawArrays(GL_LINES, prevstart, curpos-prevstart);
                                }
                        }
                        GPU_buffer_unbind();
@@ -558,10 +558,10 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
                                                /* TODO make this better (cache facenormals as layer?) */
                                                float nor[3];
                                                if (mface->v4) {
-                                                       normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
+                                                       normal_quad_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
                                                }
                                                else {
-                                                       normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
+                                                       normal_tri_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
                                                }
                                                glNormal3fv(nor);
                                        }
@@ -651,10 +651,10 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
                                        else {
                                                float nor[3];
                                                if (mf->v4) {
-                                                       normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
+                                                       normal_quad_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
                                                }
                                                else {
-                                                       normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
+                                                       normal_tri_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
                                                }
                                                glNormal3fv(nor);
                                        }
@@ -721,7 +721,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
                                                colors[i*12+j*3+2] = col[i*4+j].r;
                                        }
                                }
-                               GPU_color3_upload(dm,colors);
+                               GPU_color3_upload(dm, colors);
                                MEM_freeN(colors);
                                if (realcol)
                                        dm->drawObject->colType = CD_TEXTURE_MCOL;
@@ -856,10 +856,10 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
                                        else {
                                                float nor[3];
                                                if (mf->v4) {
-                                                       normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
+                                                       normal_quad_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
                                                }
                                                else {
-                                                       normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
+                                                       normal_tri_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
                                                }
                                                glNormal3fv(nor);
                                        }
@@ -1088,10 +1088,10 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
                                        /* TODO ideally a normal layer should always be available */
                                        float nor[3];
                                        if (mface->v4) {
-                                               normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
+                                               normal_quad_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
                                        }
                                        else {
-                                               normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
+                                               normal_tri_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
                                        }
                                        glNormal3fv(nor);
                                }
@@ -1140,10 +1140,10 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
 
                                                                GPU_buffer_unlock(buffer);
 
-                                                               GPU_interleaved_attrib_setup(buffer,datatypes,numdata);
+                                                               GPU_interleaved_attrib_setup(buffer, datatypes, numdata);
                                                        }
 
-                                                       glDrawArrays(GL_TRIANGLES,start*3,numfaces*3);
+                                                       glDrawArrays(GL_TRIANGLES, start*3, numfaces*3);
 
                                                        if ( numdata != 0 ) {
 
@@ -1213,17 +1213,17 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
                                if (dodraw && numdata != 0 ) {
                                        offset = 0;
                                        if (attribs.totorco) {
-                                               copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
-                                               copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
-                                               copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
+                                               copy_v3_v3((float *)&varray[elementsize*curface*3], (float *)attribs.orco.array[mface->v1]);
+                                               copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize], (float *)attribs.orco.array[mface->v2]);
+                                               copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2], (float *)attribs.orco.array[mface->v3]);
                                                offset += sizeof(float)*3;
                                        }
                                        for (b = 0; b < attribs.tottface; b++) {
                                                MTFace *tf = &attribs.tface[b].array[a];
-                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
-                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
+                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset], tf->uv[0]);
+                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize], tf->uv[1]);
 
-                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
+                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2], tf->uv[2]);
                                                offset += sizeof(float)*2;
                                        }
                                        for (b = 0; b < attribs.totmcol; b++) {
@@ -1255,16 +1255,16 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
                                        if (dodraw && numdata != 0 ) {
                                                offset = 0;
                                                if (attribs.totorco) {
-                                                       copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
-                                                       copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
-                                                       copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
+                                                       copy_v3_v3((float *)&varray[elementsize*curface*3], (float *)attribs.orco.array[mface->v3]);
+                                                       copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize], (float *)attribs.orco.array[mface->v4]);
+                                                       copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2], (float *)attribs.orco.array[mface->v1]);
                                                        offset += sizeof(float)*3;
                                                }
                                                for (b = 0; b < attribs.tottface; b++) {
                                                        MTFace *tf = &attribs.tface[b].array[a];
-                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
-                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
-                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
+                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset], tf->uv[2]);
+                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize], tf->uv[3]);
+                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2], tf->uv[0]);
                                                        offset += sizeof(float)*2;
                                                }
                                                for (b = 0; b < attribs.totmcol; b++) {
@@ -1300,9 +1300,9 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
                                if ( dodraw ) {
                                        if ( numdata != 0 ) {
                                                GPU_buffer_unlock(buffer);
-                                               GPU_interleaved_attrib_setup(buffer,datatypes,numdata);
+                                               GPU_interleaved_attrib_setup(buffer, datatypes, numdata);
                                        }
-                                       glDrawArrays(GL_TRIANGLES,start*3,(curface-start)*3);
+                                       glDrawArrays(GL_TRIANGLES, start*3, (curface-start)*3);
                                }
                        }
                        GPU_buffer_unbind();
@@ -1374,9 +1374,9 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
                                float nor[3];
 
                                if (mf->v4)
-                                       normal_quad_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co);
+                                       normal_quad_v3(nor, mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co);
                                else
-                                       normal_tri_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co);
+                                       normal_tri_v3(nor, mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co);
 
                                glNormal3fv(nor);
                        }
index 97baaad..d262dff 100644 (file)
@@ -66,11 +66,11 @@ static struct timeval _tstart, _tend;
 static struct timezone tz;
 void tstart ( void )
 {
-       gettimeofday ( &_tstart, &tz );
+       gettimeofday(&_tstart, &tz);
 }
-void tend ( void )
+void tend (void)
 {
-       gettimeofday ( &_tend,&tz );
+       gettimeofday(&_tend, &tz);
 }
 double tval(void)
 {
@@ -746,7 +746,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
                                                // ABS ( clmd->sim_parms->maxgoal - clmd->sim_parms->mingoal );
                                                */
                                                
-                                               verts->goal  = ( float ) pow ( verts->goal , 4.0f );
+                                               verts->goal  = powf(verts->goal, 4.0f);
                                                if ( verts->goal >=SOFTGOALSNAP ) {
                                                         verts->flags |= CLOTH_VERT_FLAG_PINNED;
                                                }
@@ -781,7 +781,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
        MVert *mvert = NULL;
        ClothVertex *verts = NULL;
        float (*shapekey_rest)[3]= NULL;
-       float tnull[3] = {0,0,0};
+       float tnull[3] = {0, 0, 0};
        Cloth *cloth = NULL;
        float maxdist = 0;
 
@@ -984,7 +984,7 @@ static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *UNUSED(edgehash), Li
        
        if (edgelist) {
                for ( i = 0; i < cloth->numverts; i++ ) {
-                       BLI_linklist_free ( edgelist[i],NULL );
+                       BLI_linklist_free ( edgelist[i], NULL );
                }
 
                MEM_freeN ( edgelist );
@@ -1141,7 +1141,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
                                        spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
                                        spring->type = CLOTH_SPRING_TYPE_BENDING;
                                        spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0f;
-                                       BLI_edgehash_insert ( edgehash, spring->ij, spring->kl, NULL );
+                                       BLI_edgehash_insert(edgehash, spring->ij, spring->kl, NULL);
                                        bend_springs++;
 
                                        BLI_linklist_prepend ( &cloth->springs, spring );
@@ -1190,14 +1190,14 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
        
        /* insert other near springs in edgehash AFTER bending springs are calculated (for selfcolls) */
        for (i = 0; i < numedges; i++) { /* struct springs */
-               BLI_edgehash_insert ( edgehash, MIN2(medge[i].v1, medge[i].v2), MAX2(medge[i].v2, medge[i].v1), NULL );
+               BLI_edgehash_insert(edgehash, MIN2(medge[i].v1, medge[i].v2), MAX2(medge[i].v2, medge[i].v1), NULL);
        }
 
        for (i = 0; i < numfaces; i++) { /* edge springs */
                if (mface[i].v4) {
-                       BLI_edgehash_insert ( edgehash, MIN2(mface[i].v1, mface[i].v3), MAX2(mface[i].v3, mface[i].v1), NULL );
+                       BLI_edgehash_insert(edgehash, MIN2(mface[i].v1, mface[i].v3), MAX2(mface[i].v3, mface[i].v1), NULL);
                        
-                       BLI_edgehash_insert ( edgehash, MIN2(mface[i].v2, mface[i].v4), MAX2(mface[i].v2, mface[i].v4), NULL );
+                       BLI_edgehash_insert(edgehash, MIN2(mface[i].v2, mface[i].v4), MAX2(mface[i].v2, mface[i].v4), NULL);
                }
        }
        
@@ -1206,7 +1206,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
        
        if ( edgelist ) {
                for ( i = 0; i < numverts; i++ ) {
-                       BLI_linklist_free ( edgelist[i],NULL );
+                       BLI_linklist_free ( edgelist[i], NULL );
                }
        
                MEM_freeN ( edgelist );
@@ -1214,8 +1214,8 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
        
        cloth->edgehash = edgehash;
        
-       if (G.rt>0)
-               printf("avg_len: %f\n",clmd->sim_parms->avg_spring_len);
+       if (G.rt > 0)
+               printf("avg_len: %f\n", clmd->sim_parms->avg_spring_len);
 
        return 1;
 
index 264a251..530fa1d 100644 (file)
@@ -168,7 +168,7 @@ Collision modifier code end
 * copied from SOLVE_CUBIC.C --> GSL
 */
 
-#define mySWAP(a,b) do { double tmp = b ; b = a ; a = tmp ; } while (0)
+#define mySWAP(a, b) do { double tmp = b ; b = a ; a = tmp ; } while (0)
 #if 0 /* UNUSED */
 static int 
 gsl_poly_solve_cubic (double a, double b, double c, 
@@ -445,7 +445,7 @@ static int cloth_get_collision_time ( double a[3], double b[3], double c[3], dou
 static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3 )
 {
        double  tempV1[3], tempV2[3], tempV4[3];
-       double  a,b,c,d,e,f;
+       double  a, b, c, d, e, f;
 
        VECSUB ( tempV1, p1, p3 );
        VECSUB ( tempV2, p2, p3 );
@@ -546,7 +546,7 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
 
                        // Decrease in magnitude of relative tangential velocity due to coulomb friction
                        // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( dot_v3v3( vrel_t_pre,vrel_t_pre ) ) );
+                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( dot_v3v3( vrel_t_pre, vrel_t_pre ) ) );
 
                        // Apply friction impulse.
                        if ( magtangent > ALMOST_ZERO ) {
@@ -573,7 +573,7 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
                        cloth1->verts[collpair->ap3].impulse_count++;
 
                        // Apply repulse impulse if distance too short
-                       // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+                       // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
                        spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
 
                        d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance;
@@ -861,7 +861,7 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
 
                        // Decrease in magnitude of relative tangential velocity due to coulomb friction
                        // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
 
                        // Apply friction impulse.
                        if ( magtangent > ALMOST_ZERO ) {
@@ -880,7 +880,7 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
                        VECADDMUL ( pimpulse, collpair->normal, impulse);
 
                        // Apply repulse impulse if distance too short
-                       // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+                       // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
                        spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
 
                        d = collpair->distance;
@@ -957,7 +957,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
        
                                // Decrease in magnitude of relative tangential velocity due to coulomb friction
                                // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
        
                                // Apply friction impulse.
                                if ( magtangent > ALMOST_ZERO ) {
@@ -976,7 +976,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                                cloth1->verts[collpair->collp].impulse_count++;
        
                                // Apply repulse impulse if distance too short
-                               // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+                               // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
                                spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
        
                                d = -collpair->distance;
@@ -1021,7 +1021,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
        
                                // Decrease in magnitude of relative tangential velocity due to coulomb friction
                                // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
        
                                // Apply friction impulse.
                                if ( magtangent > ALMOST_ZERO ) {
@@ -1039,7 +1039,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                                VECADDMUL ( pimpulse, collpair->normal, impulse);
        
                                // Apply repulse impulse if distance too short
-                               // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+                               // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
                                spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
        
                                d = -collpair->distance;
@@ -1461,7 +1461,7 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2,
 #ifdef USE_BULLET
                // calc distance + normal
                distance = plNearestPoints (
-                       verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa,collpair->pb,collpair->vector );
+                       verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa, collpair->pb, collpair->vector );
 #else
                // just be sure that we don't add anything
                distance = 2.0 * (double)( epsilon1 + epsilon2 + ALMOST_ZERO );
@@ -1573,7 +1573,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
 
                        // Decrease in magnitude of relative tangential velocity due to coulomb friction
                        // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
 
                        // Apply friction impulse.
                        if ( magtangent > ALMOST_ZERO )
@@ -1601,7 +1601,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
                        cloth1->verts[collpair->ap3].impulse_count++;
 
                        // Apply repulse impulse if distance too short
-                       // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+                       // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
                        /*
                        d = clmd->coll_parms->epsilon*8.0/9.0 + epsilon2*8.0/9.0 - collpair->distance;
                        if ( ( magrelVel < 0.1*d*clmd->sim_parms->stepsPerFrame ) && ( d > ALMOST_ZERO ) )
@@ -1635,7 +1635,7 @@ static float projectPointOntoLine(float *p, float *a, float *b)
        return dot_v3v3(pa, ba) / dot_v3v3(ba, ba);
 }
 
-static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,float *out_normal) 
+static void calculateEENormal(float *np1, float *np2, float *np3, float *np4, float *out_normal)
 {
        float line1[3], line2[3];
        float length;
@@ -1987,7 +1987,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
                                // printf("sol %d: %lf\n", k, solution[k]);
                                if ( ( solution[k] >= ALMOST_ZERO ) && ( solution[k] <= 1.0 ) && ( solution[k] >  ALMOST_ZERO))
                                {
-                                       float a,b;
+                                       float a, b;
                                        float out_normal[3];
                                        float distance;
                                        float impulse = 0;
@@ -2260,11 +2260,11 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
 static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index)
 {
        Cloth *cloth = clmd->clothObject;
-       int i=0, j = 0, /*numfaces = 0,*/ numverts = 0;
+       int i=0, j = 0, /*numfaces = 0, */ numverts = 0;
        ClothVertex *verts = NULL;
        int ret = 0;
        int result = 0;
-       float tnull[3] = {0,0,0};
+       float tnull[3] = {0, 0, 0};
        
        /*numfaces = clmd->clothObject->numfaces;*/ /*UNUSED*/
        numverts = clmd->clothObject->numverts;
@@ -2343,8 +2343,8 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
                
                ret2 = 0;
 
-               collisions = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
-               collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
+               collisions = MEM_callocN(sizeof(CollPair *) *numcollobj, "CollPair");
+               collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj, "CollPair");
                
                // check all collision objects
                for (i = 0; i < numcollobj; i++) {
index 6dc1b2a..2955e20 100644 (file)
@@ -318,8 +318,8 @@ void curvemap_sethandle(CurveMap *cuma, int type)
 /* reduced copy of garbled calchandleNurb() code in curve.c */
 static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int UNUSED(mode))
 {
-       float *p1,*p2,*p3,pt[3];
-       float len,len_a, len_b;
+       float *p1, *p2, *p3, pt[3];
+       float len, len_a, len_b;
        float dvec_a[2], dvec_b[2];
 
        if (bezt->h1==0 && bezt->h2==0) {
@@ -1014,7 +1014,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
                                }
                        }
                        else {
-                               rgb_to_ycc(rgb[0],rgb[1],rgb[2],&ycc[0],&ycc[1],&ycc[2], ycc_mode);
+                               rgb_to_ycc(rgb[0], rgb[1], rgb[2], &ycc[0], &ycc[1], &ycc[2], ycc_mode);
                                for (c=0; c<3; c++) {
                                        ycc[c] *=INV_255;
                                        if (ycc[c] < scopes->minmax[c][0]) scopes->minmax[c][0] = ycc[c];
index 82a908e..04c10de 100644 (file)
@@ -1333,7 +1333,7 @@ static void followpath_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
                if ((data->followflag & FOLLOWPATH_RADIUS)==0) { /* XXX - assume that scale correction means that radius will have some scale error in it - Campbell */
                        float obsize[3];
                        
-                       mat4_to_size( obsize,cob->matrix);
+                       mat4_to_size(obsize, cob->matrix);
                        if (obsize[0])
                                mul_v3_fl(cob->matrix[0], size[0] / obsize[0]);
                        if (obsize[1])
@@ -1475,8 +1475,8 @@ static void sizelimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
        bSizeLimitConstraint *data = con->data;
        float obsize[3], size[3];
        
-       mat4_to_size( size,cob->matrix);
-       mat4_to_size( obsize,cob->matrix);
+       mat4_to_size(size, cob->matrix);
+       mat4_to_size(obsize, cob->matrix);
        
        if (data->flag & LIMIT_XMIN) {
                if (size[0] < data->xmin) 
@@ -2308,7 +2308,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
        bConstraintTarget *ct= targets->first;
        
        if (VALID_CONS_TARGET(ct)) {
-               float vec[3],vec2[3];
+               float vec[3], vec2[3];
                float totmat[3][3];
                float tmpmat[3][3];
                float invmat[3][3];
@@ -2542,9 +2542,9 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                
                copy_m4_m4(tmat, cob->matrix);
                
-               mdet = determinant_m3(  totmat[0][0],totmat[0][1],totmat[0][2],
-                                               totmat[1][0],totmat[1][1],totmat[1][2],
-                                               totmat[2][0],totmat[2][1],totmat[2][2]);
+               mdet = determinant_m3(totmat[0][0], totmat[0][1], totmat[0][2],
+                                     totmat[1][0], totmat[1][1], totmat[1][2],
+                                     totmat[2][0], totmat[2][1], totmat[2][2]);
                if (mdet==0) {
                        unit_m3(totmat);
                }
@@ -3311,7 +3311,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                /* obtain target effect */
                switch (data->from) {
                        case 2: /* scale */
-                               mat4_to_size( dvec,ct->matrix);
+                               mat4_to_size(dvec, ct->matrix);
                                break;
                        case 1: /* rotation (convert to degrees first) */
                                mat4_to_eulO(dvec, cob->rotOrder, ct->matrix);
@@ -3602,8 +3602,8 @@ static void damptrack_flush_tars (bConstraint *con, ListBase *list, short nocopy
 
 /* array of direction vectors for the tracking flags */
 static const float track_dir_vecs[6][3] = {
-       {+1,0,0}, {0,+1,0}, {0,0,+1},           /* TRACK_X,  TRACK_Y,  TRACK_Z */
-       {-1,0,0}, {0,-1,0}, {0,0,-1}            /* TRACK_NX, TRACK_NY, TRACK_NZ */
+       {+1, 0, 0}, {0, +1, 0}, {0, 0, +1},             /* TRACK_X,  TRACK_Y,  TRACK_Z */
+       {-1, 0, 0}, {0, -1, 0}, {0, 0, -1}              /* TRACK_NX, TRACK_NY, TRACK_NZ */
 };
 
 static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
index e0cadac..1349a19 100644 (file)
@@ -480,19 +480,19 @@ Nurb *BKE_nurb_duplicate(Nurb *nu)
        Nurb *newnu;
        int len;
 
-       newnu= (Nurb*)MEM_mallocN(sizeof(Nurb),"duplicateNurb");
+       newnu= (Nurb*)MEM_mallocN(sizeof(Nurb), "duplicateNurb");
        if (newnu==NULL) return NULL;
        memcpy(newnu, nu, sizeof(Nurb));
 
        if (nu->bezt) {
                newnu->bezt=
-                       (BezTriple*)MEM_mallocN((nu->pntsu)* sizeof(BezTriple),"duplicateNurb2");
+                       (BezTriple*)MEM_mallocN((nu->pntsu)* sizeof(BezTriple), "duplicateNurb2");
                memcpy(newnu->bezt, nu->bezt, nu->pntsu*sizeof(BezTriple));
        }
        else {
                len= nu->pntsu*nu->pntsv;
                newnu->bp=
-                       (BPoint*)MEM_mallocN((len)* sizeof(BPoint),"duplicateNurb3");
+                       (BPoint*)MEM_mallocN((len)* sizeof(BPoint), "duplicateNurb3");
                memcpy(newnu->bp, nu->bp, len*sizeof(BPoint));
                
                newnu->knotsu= newnu->knotsv= NULL;
@@ -749,7 +749,7 @@ void BKE_nurb_knot_calc_v(Nurb *nu)
 static void basisNurb(float t, short order, short pnts, float *knots, float *basis, int *start, int *end)
 {
        float d, e;
-       int i, i1 = 0, i2 = 0 ,j, orderpluspnts, opp2, o2;
+       int i, i1 = 0, i2 = 0j, orderpluspnts, opp2, o2;
 
        orderpluspnts= order+pnts;
                opp2 = orderpluspnts-1;
@@ -777,7 +777,7 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
        }
        basis[i]= 0.0;
        
-       /* this is order 2,3,... */
+       /* this is order 2, 3, ... */
        for (j=2; j<=order; j++) {
 
                if (i2+j>= orderpluspnts) i2= opp2-j;
@@ -870,7 +870,7 @@ void BKE_nurb_makeFaces(Nurb *nu, float *coord_array, int rowstride, int resolu,
        jstart= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces4");
        jend= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces5");
 
-       /* precalculation of basisv and jstart,jend */
+       /* precalculation of basisv and jstart, jend */
        if (nu->flagv & CU_NURB_CYCLIC) cycl= nu->orderv-1; 
        else cycl= 0;
        v= vstart;
@@ -1076,7 +1076,7 @@ void BKE_nurb_makeCurve(Nurb *nu, float *coord_array, float *tilt_array, float *
 /* forward differencing method for bezier curve */
 void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
 {
-       float rt0,rt1,rt2,rt3,f;
+       float rt0, rt1, rt2, rt3, f;
        int a;
 
        f= (float)it;
@@ -1281,7 +1281,7 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
                        }
                        
                        for (u=0; u<sizev; u++) {
-                               for (v=0; v<sizeu; v++,fp+=3) {
+                               for (v=0; v<sizeu; v++, fp+=3) {
                                        if (cu->flag & CU_UV_ORCO) {
                                                fp[0]= 2.0f*u/(sizev - 1) - 1.0f;
                                                fp[1]= 2.0f*v/(sizeu - 1) - 1.0f;
@@ -1544,13 +1544,13 @@ static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], c
 }
 
 
-static short bevelinside(BevList *bl1,BevList *bl2)
+static short bevelinside(BevList *bl1, BevList *bl2)
 {
        /* is bl2 INSIDE bl1 ? with left-right method and "labda's" */
        /* returns '1' if correct hole  */
        BevPoint *bevp, *prevbevp;
-       float min,max,vec[3],hvec1[3],hvec2[3],lab,mu;
-       int nr, links=0,rechts=0,mode;
+       float min, max, vec[3], hvec1[3], hvec2[3], lab, mu;
+       int nr, links=0, rechts=0, mode;
 
        /* take first vertex of possible hole */
 
@@ -1558,7 +1558,7 @@ static short bevelinside(BevList *bl1,BevList *bl2)
        hvec1[0]= bevp->vec[0]; 
        hvec1[1]= bevp->vec[1]; 
        hvec1[2]= 0.0;
-       copy_v3_v3(hvec2,hvec1);
+       copy_v3_v3(hvec2, hvec1);
        hvec2[0]+=1000;
 
        /* test it with all edges of potential surounding poly */
@@ -1605,7 +1605,7 @@ struct bevelsort {
 
 static int vergxcobev(const void *a1, const void *a2)
 {
-       const struct bevelsort *x1=a1,*x2=a2;
+       const struct bevelsort *x1=a1, *x2=a2;
 
        if ( x1->left > x2->left ) return 1;
        else if ( x1->left < x2->left) return -1;
@@ -1837,7 +1837,7 @@ static void bevel_list_smooth(BevList *bl, int smooth_iter)
 
                while (nr--) {
                        /* interpolate quats */
-                       float zaxis[3] = {0,0,1}, cross[3], q2[4];
+                       float zaxis[3] = {0, 0, 1}, cross[3], q2[4];
                        interp_qt_qtqt(q, bevp0_quat, bevp2->quat, 0.5);
                        normalize_qt(q);
 
@@ -1872,7 +1872,7 @@ static void make_bevel_list_3D_zup(BevList *bl)
        while (nr--) {
                /* totally simple */
                bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
-               vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+               vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
 
                bevp0= bevp1;
                bevp1= bevp2;
@@ -1896,7 +1896,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
        while (nr--) {
 
                if (nr+4 > bl->nr) { /* first time and second time, otherwise first point adjusts last */
-                       vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+                       vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
                }
                else {
                        float angle= angle_normalized_v3v3(bevp0->dir, bevp1->dir);
@@ -1930,7 +1930,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
                 *
                 * this is why we compare last with second last
                 * */
-               float vec_1[3]= {0,1,0}, vec_2[3]= {0,1,0}, angle, ang_fac, cross_tmp[3];
+               float vec_1[3]= {0, 1, 0}, vec_2[3]= {0, 1, 0}, angle, ang_fac, cross_tmp[3];
 
                BevPoint *bevp_first;
                BevPoint *bevp_last;
@@ -2024,11 +2024,11 @@ static void make_bevel_list_3D_tangent(BevList *bl)
 
                /* make perpendicular, modify tan in place, is ok */
                float cross_tmp[3];
-               float zero[3] = {0,0,0};
+               float zero[3] = {0, 0, 0};
 
                cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
                normalize_v3(cross_tmp);
-               tri_to_quat( bevp1->quat,zero, cross_tmp, bevp1->tan); /* XXX - could be faster */
+               tri_to_quat(bevp1->quat, zero, cross_tmp, bevp1->tan); /* XXX - could be faster */
 
                /* bevp0= bevp1; */ /* UNUSED */
                bevp1= bevp2;
@@ -2072,7 +2072,7 @@ static void make_bevel_list_segment_3D(BevList *bl)
        sub_v3_v3v3(bevp1->dir, bevp1->vec, bevp2->vec);
        normalize_v3(bevp1->dir);
 
-       vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+       vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
 
        axis_angle_to_quat(q, bevp1->dir, bevp1->alfa);
        mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
@@ -2299,7 +2299,7 @@ void BKE_curve_bevelList_make(Object *ob)
                        memcpy(blnew, bl, sizeof(BevList));
                        blnew->nr= 0;
                        BLI_remlink(&(cu->bev), bl);
-                       BLI_insertlinkbefore(&(cu->bev),blnext,blnew);  /* to make sure bevlijst is tuned with nurblist */
+                       BLI_insertlinkbefore(&(cu->bev), blnext, blnew);        /* to make sure bevlijst is tuned with nurblist */
                        bevp0= (BevPoint *)(bl+1);
                        bevp1= (BevPoint *)(blnew+1);
                        nr= bl->nr;
@@ -2367,7 +2367,7 @@ void BKE_curve_bevelList_make(Object *ob)
 
                        bl= bl->next;
                }
-               qsort(sortdata,poly,sizeof(struct bevelsort), vergxcobev);
+               qsort(sortdata, poly, sizeof(struct bevelsort), vergxcobev);
 
                sd= sortdata+1;
                for (a=1; a<poly; a++, sd++) {
@@ -2442,7 +2442,7 @@ void BKE_curve_bevelList_make(Object *ob)
                                        /* from: make_bevel_list_3D_zup, could call but avoid a second loop.
                                         * no need for tricky tilt calculation as with 3D curves */
                                        bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
-                                       vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+                                       vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
                                        /* done with inline make_bevel_list_3D_zup */
 
                                        bevp0= bevp1;
@@ -2497,7 +2497,7 @@ void BKE_curve_bevelList_make(Object *ob)
 /* mode: is not zero when FCurve, is 2 when forced horizontal for autohandles */
 static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode, int skip_align)
 {
-       float *p1,*p2,*p3, pt[3];
+       float *p1, *p2, *p3, pt[3];
        float dvec_a[3], dvec_b[3];
        float len, len_a, len_b;
        const float eps= 1e-5;
@@ -2545,7 +2545,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
        if (len_b==0.0f) len_b=1.0f;
 
 
-       if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {    /* auto */
+       if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) || ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {    /* auto */
                float tvec[3];
                tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a;
                tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a;
@@ -2558,7 +2558,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
                        if (len_a>5.0f*len_b) len_a= 5.0f*len_b;
                        if (len_b>5.0f*len_a) len_b= 5.0f*len_a;
                        
-                       if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) {
+                       if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) {
                                len_a/=len;
                                madd_v3_v3v3fl(p2-3, p2, tvec, -len_a);
                                
@@ -2584,7 +2584,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
                                        }
                                }
                        }
-                       if (ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
+                       if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {
                                len_b/=len;
                                madd_v3_v3v3fl(p2+3, p2, tvec,  len_b);
                                
@@ -3075,7 +3075,7 @@ float (*BKE_curve_vertexCos_get(Curve *UNUSED(cu), ListBase *lb, int *numVerts_r
                if (nu->type == CU_BEZIER) {
                        BezTriple *bezt = nu->bezt;
 
-                       for (i=0; i<nu->pntsu; i++,bezt++) {
+                       for (i=0; i<nu->pntsu; i++, bezt++) {
                                copy_v3_v3(co, bezt->vec[0]); co+=3;
                                copy_v3_v3(co, bezt->vec[1]); co+=3;
                                copy_v3_v3(co, bezt->vec[2]); co+=3;
@@ -3084,7 +3084,7 @@ float (*BKE_curve_vertexCos_get(Curve *UNUSED(cu), ListBase *lb, int *numVerts_r
                else {
                        BPoint *bp = nu->bp;
 
-                       for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+                       for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
                                copy_v3_v3(co, bp->vec); co+=3;
                        }
                }
@@ -3103,7 +3103,7 @@ void BK_curve_vertexCos_apply(Curve *UNUSED(cu), ListBase *lb, float (*vertexCos
                if (nu->type == CU_BEZIER) {
                        BezTriple *bezt = nu->bezt;
 
-                       for (i=0; i<nu->pntsu; i++,bezt++) {
+                       for (i=0; i<nu->pntsu; i++, bezt++) {
                                copy_v3_v3(bezt->vec[0], co); co+=3;
                                copy_v3_v3(bezt->vec[1], co); co+=3;
                                copy_v3_v3(bezt->vec[2], co); co+=3;
@@ -3112,7 +3112,7 @@ void BK_curve_vertexCos_apply(Curve *UNUSED(cu), ListBase *lb, float (*vertexCos
                else {
                        BPoint *bp = nu->bp;
 
-                       for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+                       for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
                                copy_v3_v3(bp->vec, co); co+=3;
                        }
                }
@@ -3132,7 +3132,7 @@ float (*BKE_curve_keyVertexCos_get(Curve *UNUSED(cu), ListBase *lb, float *key))
                if (nu->type == CU_BEZIER) {
                        BezTriple *bezt = nu->bezt;
 
-                       for (i=0; i<nu->pntsu; i++,bezt++) {
+                       for (i=0; i<nu->pntsu; i++, bezt++) {
                                copy_v3_v3(co, key); co+=3; key+=3;
                                copy_v3_v3(co, key); co+=3; key+=3;
                                copy_v3_v3(co, key); co+=3; key+=3;
@@ -3142,7 +3142,7 @@ float (*BKE_curve_keyVertexCos_get(Curve *UNUSED(cu), ListBase *lb, float *key))
                else {
                        BPoint *bp = nu->bp;
 
-                       for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+                       for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
                                copy_v3_v3(co, key); co+=3; key+=3;
                                key++; /* skip tilt */
                        }
@@ -3161,7 +3161,7 @@ void BKE_curve_keyVertexTilts_apply(Curve *UNUSED(cu), ListBase *lb, float *key)
                if (nu->type == CU_BEZIER) {
                        BezTriple *bezt = nu->bezt;
 
-                       for (i=0; i<nu->pntsu; i++,bezt++) {
+                       for (i=0; i<nu->pntsu; i++, bezt++) {
                                key+=3*3;
                                bezt->alfa= *key;
                                key+=3;
@@ -3170,7 +3170,7 @@ void BKE_curve_keyVertexTilts_apply(Curve *UNUSED(cu), ListBase *lb, float *key)
                else {
                        BPoint *bp = nu->bp;
 
-                       for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+                       for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
                                key+=3;
                                bp->alfa= *key;
                                key++;
@@ -3179,7 +3179,7 @@ void BKE_curve_keyVertexTilts_apply(Curve *UNUSED(cu), ListBase *lb, float *key)
        }
 }
 
-int BKE_nurb_check_valid_u( struct Nurb *nu )
+int BKE_nurb_check_valid_u(struct Nurb *nu)
 {
        if (nu==NULL)                                           return 0;
        if (nu->pntsu <= 1)                                     return 0;
@@ -3194,7 +3194,7 @@ int BKE_nurb_check_valid_u( struct Nurb *nu )
        }
        return 1;
 }
-int BKE_nurb_check_valid_v( struct Nurb *nu)
+int BKE_nurb_check_valid_v(struct Nurb *nu)
 {
        if (nu==NULL)                                           return 0;
        if (nu->pntsv <= 1)                                     return 0;
@@ -3210,7 +3210,7 @@ int BKE_nurb_check_valid_v( struct Nurb *nu)
        return 1;
 }
 
-int BKE_nurb_order_clamp_u( struct Nurb *nu )
+int BKE_nurb_order_clamp_u(struct Nurb *nu)
 {
        int change = 0;
        if (nu->pntsu<nu->orderu) {
@@ -3218,13 +3218,13 @@ int BKE_nurb_order_clamp_u( struct Nurb *nu )
                change= 1;
        }
        if (((nu->flagu & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) {
-               CLAMP(nu->orderu, 3,4);
+               CLAMP(nu->orderu, 3, 4);
                change= 1;
        }
        return change;
 }
 
-int BKE_nurb_order_clamp_v( struct Nurb *nu)
+int BKE_nurb_order_clamp_v(struct Nurb *nu)
 {
        int change = 0;
        if (nu->pntsv<nu->orderv) {
@@ -3232,7 +3232,7 @@ int BKE_nurb_order_clamp_v( struct Nurb *nu)
                change= 1;
        }
        if (((nu->flagv & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) {
-               CLAMP(nu->orderv, 3,4);
+               CLAMP(nu->orderv, 3, 4);
                change= 1;
        }
        return change;
index ee8e57d..4666aa6 100644 (file)
@@ -638,7 +638,7 @@ static void layerInitMinMax_mloopcol(void *vmin, void *vmax)
 
 static void layerDefault_mloopcol(void *data, int count)
 {
-       MLoopCol default_mloopcol = {255,255,255,255};
+       MLoopCol default_mloopcol = {255, 255, 255, 255};
        MLoopCol *mlcol = (MLoopCol*)data;
        int i;
        for (i = 0; i < count; i++)
@@ -986,11 +986,11 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        /* 9: CD_POLYINDEX */
        {sizeof(int), "MIntProperty", 1, NULL, NULL, NULL, NULL, NULL, NULL},
        /* 10: CD_PROP_FLT */
-       {sizeof(MFloatProperty), "MFloatProperty",1,"Float", layerCopy_propFloat,NULL,NULL,NULL},
+       {sizeof(MFloatProperty), "MFloatProperty", 1, "Float", layerCopy_propFloat, NULL, NULL, NULL},
        /* 11: CD_PROP_INT */
-       {sizeof(MIntProperty), "MIntProperty",1,"Int",layerCopy_propInt,NULL,NULL,NULL},
+       {sizeof(MIntProperty), "MIntProperty", 1, "Int", layerCopy_propInt, NULL, NULL, NULL},
        /* 12: CD_PROP_STR */
-       {sizeof(MStringProperty), "MStringProperty",1,"String",layerCopy_propString,NULL,NULL,NULL},
+       {sizeof(MStringProperty), "MStringProperty", 1, "String", layerCopy_propString, NULL, NULL, NULL},
        /* 13: CD_ORIGSPACE */
        {sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVMap", layerCopy_origspace_face, NULL,
         layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face},
@@ -1026,7 +1026,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        /* 23: CD_CLOTH_ORCO */
        {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
        /* 24: CD_RECAST */
-       {sizeof(MRecast), "MRecast", 1,"Recast",NULL,NULL,NULL,NULL}
+       {sizeof(MRecast), "MRecast", 1, "Recast", NULL, NULL, NULL, NULL}
 
 /* BMESH ONLY */
        ,
@@ -1064,7 +1064,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
 static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
        /*   0-4 */ "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace",
        /*   5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
-       /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",
+       /* 10-14 */ "CDMFloatProperty", "CDMIntProperty", "CDMStringProperty", "CDOrigSpace", "CDOrco",
        /* 15-19 */ "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent", "CDMDisps",
        /* 20-24 */"CDPreviewMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDMRecast"
 
index 045d852..e5ef987 100644 (file)
@@ -87,18 +87,18 @@ DagNodeQueue * queue_create (int slots)
        DagNodeQueueElem * elem;
        int i;
        
-       queue = MEM_mallocN(sizeof(DagNodeQueue),"DAG queue");
-       queue->freenodes = MEM_mallocN(sizeof(DagNodeQueue),"DAG queue");
+       queue = MEM_mallocN(sizeof(DagNodeQueue), "DAG queue");
+       queue->freenodes = MEM_mallocN(sizeof(DagNodeQueue), "DAG queue");
        queue->count = 0;
        queue->maxlevel = 0;
        queue->first = queue->last = NULL;
-       elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem3");
+       elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem3");
        elem->node = NULL;
        elem->next = NULL;
        queue->freenodes->first = queue->freenodes->last = elem;
        
        for (i = 1; i <slots;i++) {
-               elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem4");
+               elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem4");
                elem->node = NULL;
                elem->next = NULL;
                queue->freenodes->last->next = elem;
@@ -159,10 +159,10 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
        int i;
 
        if (node == NULL) {
-               fprintf(stderr,"pushing null node\n");
+               fprintf(stderr, "pushing null node\n");
                return;
        }
-       /*fprintf(stderr,"BFS push : %s %d\n",((ID *) node->ob)->name, queue->count);*/
+       /*fprintf(stderr, "BFS push : %s %d\n", ((ID *) node->ob)->name, queue->count);*/
 
        elem = queue->freenodes->first;
        if (elem != NULL) {
@@ -174,13 +174,13 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
                queue->freenodes->count--;
        }
        else { /* alllocating more */
-               elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
+               elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem1");
                elem->node = NULL;
                elem->next = NULL;
                queue->freenodes->first = queue->freenodes->last = elem;
 
                for (i = 1; i <DAGQUEUEALLOC;i++) {
-                       elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem2");
+                       elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem2");
                        elem->node = NULL;
                        elem->next = NULL;
                        queue->freenodes->last->next = elem;
@@ -219,13 +219,13 @@ void push_stack(DagNodeQueue *queue, DagNode *node)
                queue->freenodes->count--;
        }
        else { /* alllocating more */
-               elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
+               elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem1");
                elem->node = NULL;
                elem->next = NULL;
                queue->freenodes->first = queue->freenodes->last = elem;
 
                for (i = 1; i <DAGQUEUEALLOC;i++) {
-                       elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem2");
+                       elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem2");
                        elem->node = NULL;
                        elem->next = NULL;
                        queue->freenodes->last->next = elem;
@@ -270,7 +270,7 @@ DagNode * pop_queue(DagNodeQueue *queue)
                return node;
        }
        else {
-               fprintf(stderr,"return null\n");
+               fprintf(stderr, "return null\n");
                return NULL;
        }
 }
@@ -295,7 +295,7 @@ DagForest *dag_init(void)
 {
        DagForest *forest;
        /* use callocN to init all zero */
-       forest = MEM_callocN(sizeof(DagForest),"DAG root");
+       forest = MEM_callocN(sizeof(DagForest), "DAG root");
        return forest;
 }
 
@@ -376,8 +376,8 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
        node = dag_get_node(dag, ob);
        
        if ((ob->data) && (mask&DAG_RL_DATA)) {
-               node2 = dag_get_node(dag,ob->data);
-               dag_add_relation(dag,node,node2,DAG_RL_DATA, "Object-Data Relation");
+               node2 = dag_get_node(dag, ob->data);
+               dag_add_relation(dag, node, node2, DAG_RL_DATA, "Object-Data Relation");
                node2->first_ancestor = ob;
                node2->ancestor_count += 1;
        }
@@ -401,18 +401,18 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                                                
                                                for (ct= targets.first; ct; ct= ct->next) {
                                                        if (ct->tar && ct->tar != ob) {
-                                                               // fprintf(stderr,"armature %s target :%s\n", ob->id.name, target->id.name);
+                                                               // fprintf(stderr, "armature %s target :%s\n", ob->id.name, target->id.name);
                                                                node3 = dag_get_node(dag, ct->tar);
                                                                
                                                                if (ct->subtarget[0]) {
-                                                                       dag_add_relation(dag,node3,node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
+                                                                       dag_add_relation(dag, node3, node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
                                                                        if (ct->tar->type == OB_MESH)
                                                                                node3->customdata_mask |= CD_MASK_MDEFORMVERT;
                                                                }
                                                                else if (ELEM3(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))       
-                                                                       dag_add_relation(dag,node3,node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
+                                                                       dag_add_relation(dag, node3, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
                                                                else
-                                                                       dag_add_relation(dag,node3,node, DAG_RL_OB_DATA, cti->name);
+                                                                       dag_add_relation(dag, node3, node, DAG_RL_OB_DATA, cti->name);
                                                        }
                                                }
                                                
@@ -460,31 +460,31 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                }
        }
        if (ob->parent) {
-               node2 = dag_get_node(dag,ob->parent);
+               node2 = dag_get_node(dag, ob->parent);
                
                switch (ob->partype) {
                        case PARSKEL:
-                               dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Parent");
+                               dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Parent");
                                break;
                        case PARVERT1: case PARVERT3:
-                               dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Vertex Parent");
+                               dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, "Vertex Parent");
                                node2->customdata_mask |= CD_MASK_ORIGINDEX;
                                break;
                        case PARBONE:
-                               dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Bone Parent");
+                               dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, "Bone Parent");
                                break;
                        default:
                                if (ob->parent->type==OB_LATTICE) 
-                                       dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Lattice Parent");
+                                       dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Lattice Parent");
                                else if (ob->parent->type==OB_CURVE) {
                                        Curve *cu= ob->parent->data;
                                        if (cu->flag & CU_PATH) 
-                                               dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Curve Parent");
+                                               dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, "Curve Parent");
                                        else
-                                               dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Curve Parent");
+                                               dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Curve Parent");
                                }
                                else
-                                       dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Parent");
+                                       dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Parent");
                }
                /* exception case: parent is duplivert */
                if (ob->type==OB_MBALL && (ob->parent->transflag & OB_DUPLIVERTS)) {
@@ -533,7 +533,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        
                        if (cam->dof_ob) {
                                node2 = dag_get_node(dag, cam->dof_ob);
-                               dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Camera DoF");
+                               dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Camera DoF");
                        }
                }
                        break;
@@ -543,7 +543,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        
                        if (mom!=ob) {
                                node2 = dag_get_node(dag, mom);
-                               dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball");  // mom depends on children!
+                               dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball");  // mom depends on children!
                        }
                }
                        break;
@@ -554,16 +554,16 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        
                        if (cu->bevobj) {
                                node2 = dag_get_node(dag, cu->bevobj);
-                               dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
+                               dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
                        }
                        if (cu->taperobj) {
                                node2 = dag_get_node(dag, cu->taperobj);
-                               dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
+                               dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
                        }
                        if (ob->type == OB_FONT) {
                                if (cu->textoncurve) {
                                        node2 = dag_get_node(dag, cu->textoncurve);
-                                       dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
+                                       dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
                                }
                        }
                }
@@ -587,7 +587,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        if (!psys_check_enabled(ob, psys))
                                continue;
 
-                       if (ELEM(part->phystype,PART_PHYS_KEYED,PART_PHYS_BOIDS)) {
+                       if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) {
                                ParticleTarget *pt = psys->targets.first;
 
                                for (; pt; pt=pt->next) {
@@ -677,7 +677,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                                dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
                        }
 
-                       dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation");
+                       dag_add_relation(dag, scenenode, node, DAG_RL_SCENE, "Scene Relation");
                        addtoroot = 0;
                }
                else if (cti->get_constraint_targets) {
@@ -712,7 +712,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
        }
 
        if (addtoroot == 1 )
-               dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation");
+               dag_add_relation(dag, scenenode, node, DAG_RL_SCENE, "Scene Relation");
 }
 
 struct DagForest *build_dag(Main *bmain, Scene *sce, short mask) 
@@ -729,7 +729,7 @@ struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
        dag = sce->theDag;
        sce->dagisvalid=1;
        if ( dag)
-               free_forest( dag ); 
+               free_forest(dag);
        else {
                dag = dag_init();
                sce->theDag = dag;
@@ -831,7 +831,7 @@ void free_forest(DagForest *Dag)
 
 }
 
-DagNode * dag_find_node (DagForest *forest,void * fob)
+DagNode * dag_find_node (DagForest *forest, void * fob)
 {
        if (forest->nodeHash)
                return BLI_ghash_lookup(forest->nodeHash, fob);
@@ -847,7 +847,7 @@ DagNode * dag_add_node (DagForest *forest, void * fob)
 {
        DagNode *node;
                
-       node = MEM_callocN(sizeof(DagNode),"DAG node");
+       node = MEM_callocN(sizeof(DagNode), "DAG node");
        if (node) {
                node->ob = fob;
                node->color = DAG_WHITE;
@@ -872,7 +872,7 @@ DagNode * dag_add_node (DagForest *forest, void * fob)
        return node;
 }
 
-DagNode * dag_get_node (DagForest *forest,void * fob)
+DagNode * dag_get_node (DagForest *forest, void * fob)
 {
        DagNode *node;
        
@@ -884,7 +884,7 @@ DagNode * dag_get_node (DagForest *forest,void * fob)
 
 
 
-DagNode * dag_get_sub_node (DagForest *forest,void * fob)
+DagNode * dag_get_sub_node (DagForest *forest, void * fob)
 {
        DagNode *node;
        DagAdjList *mainchild, *prev=NULL;
@@ -926,7 +926,7 @@ static void dag_add_parent_relation(DagForest *UNUSED(forest), DagNode *fob1, Da
                itA = itA->next;
        }
        /* create new relation and insert at head. MALLOC alert! */
-       itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
+       itA = MEM_mallocN(sizeof(DagAdjList), "DAG adj list");
        itA->node = fob1;
        itA->type = rel;
        itA->count = 1;
@@ -951,7 +951,7 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
                itA = itA->next;
        }
        /* create new relation and insert at head. MALLOC alert! */
-       itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
+       itA = MEM_mallocN(sizeof(DagAdjList), "DAG adj list");
        itA->node = fob2;
        itA->type = rel;
        itA->count = 1;
@@ -1118,7 +1118,7 @@ void graph_bfs(void)
        DagAdjList *itA;
        int minheight;
        
-       /* fprintf(stderr,"starting BFS\n ------------\n"); */
+       /* fprintf(stderr, "starting BFS\n ------------\n"); */
        nqueue = queue_create(DAGQUEUEALLOC);
        for ( i=0; i<50; i++)
                pos[i] = 0;
@@ -1138,7 +1138,7 @@ void graph_bfs(void)
        if (node->color == DAG_WHITE) {
                node->color = DAG_GRAY;
                node->BFS_dist = 1;
-               push_queue(nqueue,node);  
+               push_queue(nqueue, node);
                while (nqueue->count) {
                        node = pop_queue(nqueue);
                        
@@ -1149,11 +1149,11 @@ void graph_bfs(void)
                                        itA->node->color = DAG_GRAY;
                                        itA->node->BFS_dist = node->BFS_dist + 1;
                                        itA->node->k = (float) minheight;
-                                       push_queue(nqueue,itA->node);
+                                       push_queue(nqueue, itA->node);
                                }
                                
                                else {
-                                       fprintf(stderr,"bfs not dag tree edge color :%i\n",itA->node->color);
+                                       fprintf(stderr, "bfs not dag tree edge color :%i\n", itA->node->color);
                                }
 
                                
@@ -1169,7 +1169,7 @@ void graph_bfs(void)
                        set_node_xy(node, node->BFS_dist*DEPSX*2, pos[node->BFS_dist]*DEPSY*2);
                        node->color = DAG_BLACK;
 
-                       // fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
+                       // fprintf(stderr, "BFS node : %20s %i %5.0f %5.0f\n", ((ID *) node->ob)->name, node->BFS_dist, node->x, node->y);
                }
        }
        queue_delete(nqueue);
@@ -1190,7 +1190,7 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
        DagNodeQueue *nqueue;
        DagAdjList *itA;
        int     retval = 0;
-       /* fprintf(stderr,"starting BFS\n ------------\n"); */
+       /* fprintf(stderr, "starting BFS\n ------------\n"); */
        
        /* Init
         * dagnode.first is always the root (scene)
@@ -1207,7 +1207,7 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
        if (node->color == DAG_WHITE) {
                node->color = DAG_GRAY;
                node->BFS_dist = 1;
-               pre_func(node->ob,data);
+               pre_func(node->ob, data);
                
                while (nqueue->count) {
                        node = pop_queue(nqueue);
@@ -1217,8 +1217,8 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
                                if ((itA->node->color == DAG_WHITE) && (itA->type & mask)) {
                                        itA->node->color = DAG_GRAY;
                                        itA->node->BFS_dist = node->BFS_dist + 1;
-                                       push_queue(nqueue,itA->node);
-                                       pre_func(node->ob,data);
+                                       push_queue(nqueue, itA->node);
+                                       pre_func(node->ob, data);
                                }
                                
                                else { // back or cross edge
@@ -1226,10 +1226,10 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
                                }
                                itA = itA->next;
                        }
-                       post_func(node->ob,data);
+                       post_func(node->ob, data);
                        node->color = DAG_BLACK;
 
-                       // fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
+                       // fprintf(stderr, "BFS node : %20s %i %5.0f %5.0f\n", ((ID *) node->ob)->name, node->BFS_dist, node->x, node->y);
                }
        }
        queue_delete(nqueue);
@@ -1251,7 +1251,7 @@ DagNodeQueue * graph_dfs(void)
        int maxpos=0;
        /* int  is_cycle = 0; */ /* UNUSED */
        /*
-        *fprintf(stderr,"starting DFS\n ------------\n");
+        *fprintf(stderr, "starting DFS\n ------------\n");
         */     
        nqueue = queue_create(DAGQUEUEALLOC);
        retqueue = queue_create(MainDag->numNodes);
@@ -1280,7 +1280,7 @@ DagNodeQueue * graph_dfs(void)
                node->DFS_dist = 1;
                node->DFS_dvtm = time;
                time++;
-               push_stack(nqueue,node);  
+               push_stack(nqueue, node);
                        
                while (nqueue->count) {
                        //graph_print_queue(nqueue);
@@ -1299,13 +1299,13 @@ DagNodeQueue * graph_dfs(void)
                                        time++;
                                        itA->node->DFS_dist = node->DFS_dist + 1;
                                        itA->node->k = (float) minheight;
-                                       push_stack(nqueue,itA->node);
+                                       push_stack(nqueue, itA->node);
                                        skip = 1;
                                        break;
                                }
                                else {
                                        if (itA->node->color == DAG_GRAY) { // back edge
-                                               fprintf(stderr,"dfs back edge :%15s %15s\n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
+                                               fprintf(stderr, "dfs back edge :%15s %15s\n", ((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
                                                /* is_cycle = 1; */ /* UNUSED */
                                        }
                                        else if (itA->node->color == DAG_BLACK) {
@@ -1316,7 +1316,7 @@ DagNodeQueue * graph_dfs(void)
                                                if (node->DFS_dist >= itA->node->DFS_dist)
                                                        itA->node->DFS_dist = node->DFS_dist + 1;
 
-                                                       fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i\n",
+                                                       fprintf(stderr, "dfs forward or cross edge :%15s %i-%i %15s %i-%i\n",
                                                                ((ID *) node->ob)->name,
                                                                node->DFS_dvtm, 
                                                                node->DFS_fntm, 
@@ -1326,7 +1326,7 @@ DagNodeQueue * graph_dfs(void)
 #endif
                                        }
                                        else
-                                               fprintf(stderr,"dfs unknown edge\n");
+                                               fprintf(stderr, "dfs unknown edge\n");
                                }
                                itA = itA->next;
                        }                       
@@ -1348,16 +1348,16 @@ DagNodeQueue * graph_dfs(void)
                                }
                                set_node_xy(node, node->DFS_dist*DEPSX*2, pos[node->DFS_dist]*DEPSY*2);
                                
-                               // fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
+                               // fprintf(stderr, "DFS node : %20s %i %i %i %i\n", ((ID *) node->ob)->name, node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
 
-                               push_stack(retqueue,node);
+                               push_stack(retqueue, node);
                                
                        }
                }
        }
                node = node->next;
        } while (node);
-//     fprintf(stderr,"i size : %i\n", maxpos);
+//     fprintf(stderr, "i size : %i\n", maxpos);
 
        queue_delete(nqueue);
        return(retqueue);
@@ -1381,7 +1381,7 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
        int skip = 0;
        int retval = 0;
        /*
-        *fprintf(stderr,"starting DFS\n ------------\n");
+        *fprintf(stderr, "starting DFS\n ------------\n");
         */     
        nqueue = queue_create(DAGQUEUEALLOC);
        
@@ -1406,8 +1406,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
                        node->DFS_dist = 1;
                        node->DFS_dvtm = time;
                        time++;
-                       push_stack(nqueue,node);  
-                       pre_func(node->ob,data);
+                       push_stack(nqueue, node);
+                       pre_func(node->ob, data);
 
                        while (nqueue->count) {
                                skip = 0;
@@ -1421,8 +1421,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
                                                
                                                time++;
                                                itA->node->DFS_dist = node->DFS_dist + 1;
-                                               push_stack(nqueue,itA->node);
-                                               pre_func(node->ob,data);
+                                               push_stack(nqueue, itA->node);
+                                               pre_func(node->ob, data);
 
                                                skip = 1;
                                                break;
@@ -1444,7 +1444,7 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
                                        
                                        node->DFS_fntm = time;
                                        time++;
-                                       post_func(node->ob,data);
+                                       post_func(node->ob, data);
                                }
                        }
                }
@@ -1462,13 +1462,13 @@ struct DagNodeQueue *get_obparents(struct DagForest     *dag, void *ob)
        DagNodeQueue *nqueue;
        DagAdjList *itA;
 
-       node = dag_find_node(dag,ob);
+       node = dag_find_node(dag, ob);
        if (node==NULL) {
                return NULL;
        }
        else if (node->ancestor_count == 1) { // simple case
                nqueue = queue_create(1);
-               push_queue(nqueue,node);
+               push_queue(nqueue, node);
        }
        else { /* need to go over the whole dag for adj list */
                nqueue = queue_create(node->ancestor_count);
@@ -1479,7 +1479,7 @@ struct DagNodeQueue *get_obparents(struct DagForest       *dag, void *ob)
                                itA = node->child;
                                while (itA != NULL) {
                                        if ((itA->node == node) && (itA->type == DAG_RL_DATA)) {
-                                               push_queue(nqueue,node);
+                                               push_queue(nqueue, node);
                                        }
                                        itA = itA->next;
                                }
@@ -1496,7 +1496,7 @@ struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob)
        DagNodeQueue *nqueue;
        DagAdjList *itA;
        
-       node = dag_find_node(dag,ob);
+       node = dag_find_node(dag, ob);
        
        // need to go over the whole dag for adj list
        nqueue = queue_create(node->ancestor_count);
@@ -1507,7 +1507,7 @@ struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob)
                        itA = node->child;
                        while (itA != NULL) {
                                if (itA->node == node) {
-                                       push_queue(nqueue,node);
+                                       push_queue(nqueue, node);
                                }
                                itA = itA->next;
                        }
@@ -1544,7 +1544,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest      *dag, void *ob)
                
                node->color = DAG_GRAY;
                time++;
-               push_stack(nqueue,node);  
+               push_stack(nqueue, node);
                
                while (nqueue->count) {
                        
@@ -1558,7 +1558,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest      *dag, void *ob)
                                        itA->node->color = DAG_GRAY;
                                        
                                        time++;
-                                       push_stack(nqueue,itA->node);
+                                       push_stack(nqueue, itA->node);
                                        skip = 1;
                                        break;
                                } 
@@ -1570,7 +1570,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest      *dag, void *ob)
                                node->color = DAG_BLACK;
                                
                                time++;
-                               push_stack(retqueue,node);                      
+                               push_stack(retqueue, node);
                        }
                }
        }
@@ -1618,10 +1618,10 @@ void graph_print_queue(DagNodeQueue *nqueue)
        
        queueElem = nqueue->first;
        while (queueElem) {
-               fprintf(stderr,"** %s %i %i-%i ",((ID *) queueElem->node->ob)->name,queueElem->node->color,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
+               fprintf(stderr, "** %s %i %i-%i ", ((ID *) queueElem->node->ob)->name, queueElem->node->color, queueElem->node->DFS_dvtm, queueElem->node->DFS_fntm);
                queueElem = queueElem->next;            
        }
-       fprintf(stderr,"\n");
+       fprintf(stderr, "\n");
 }
 
 void graph_print_queue_dist(DagNodeQueue *nqueue)
@@ -1632,16 +1632,16 @@ void graph_print_queue_dist(DagNodeQueue *nqueue)
        queueElem = nqueue->first;
        count = 0;
        while (queueElem) {
-               fprintf(stderr,"** %25s %2.2i-%2.2i ",((ID *) queueElem->node->ob)->name,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
-               while (count < queueElem->node->DFS_dvtm-1) { fputc(' ',stderr); count++;}
-               fputc('|',stderr); 
-               while (count < queueElem->node->DFS_fntm-2) { fputc('-',stderr); count++;}
-               fputc('|',stderr);
-               fputc('\n',stderr);
+               fprintf(stderr, "** %25s %2.2i-%2.2i ", ((ID *) queueElem->node->ob)->name, queueElem->node->DFS_dvtm, queueElem->node->DFS_fntm);
+               while (count < queueElem->node->DFS_dvtm-1) { fputc(' ', stderr); count++;}
+               fputc('|', stderr);
+               while (count < queueElem->node->DFS_fntm-2) { fputc('-', stderr); count++;}
+               fputc('|', stderr);
+               fputc('\n', stderr);
                count = 0;
                queueElem = queueElem->next;            
        }
-       fprintf(stderr,"\n");
+       fprintf(stderr, "\n");
 }
 
 void graph_print_adj_list(void)
@@ -1651,14 +1651,14 @@ void graph_print_adj_list(void)
        
        node = (getMainDag())->DagNode.first;
        while (node) {
-               fprintf(stderr,"node : %s col: %i",((ID *) node->ob)->name, node->color);               
+               fprintf(stderr, "node : %s col: %i", ((ID *) node->ob)->name, node->color);
                itA = node->child;
                while (itA) {
-                       fprintf(stderr,"-- %s ",((ID *) itA->node->ob)->name);
+                       fprintf(stderr, "-- %s ", ((ID *) itA->node->ob)->name);
                        
                        itA = itA->next;
                }
-               fprintf(stderr,"\n");
+               fprintf(stderr, "\n");
                node = node->next;
        }
 }
@@ -1760,7 +1760,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
        rootnode = sce->theDag->DagNode.first;
        rootnode->color = DAG_GRAY;
        time++;
-       push_stack(nqueue,rootnode);  
+       push_stack(nqueue, rootnode);
        
        while (nqueue->count) {
                
@@ -1774,7 +1774,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
                                itA->node->color = DAG_GRAY;
                                
                                time++;
-                               push_stack(nqueue,itA->node);
+                               push_stack(nqueue, itA->node);
                                skip = 1;
                                break;
                        } 
@@ -1793,8 +1793,8 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
                                while (base && base->object != node->ob)
                                        base = base->next;
                                if (base) {
-                                       BLI_remlink(&sce->base,base);
-                                       BLI_addhead(&tempbase,base);
+                                       BLI_remlink(&sce->base, base);
+                                       BLI_addhead(&tempbase, base);
                                }
                        }       
                }
@@ -1803,8 +1803,8 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
        /* temporal correction for circular dependencies */
        base = sce->base.first;
        while (base) {
-               BLI_remlink(&sce->base,base);
-               BLI_addhead(&tempbase,base);
+               BLI_remlink(&sce->base, base);
+               BLI_addhead(&tempbase, base);
                //if (G.debug & G_DEBUG)
                        printf("cyclic %s\n", base->object->id.name);
                base = sce->base.first;
@@ -1930,7 +1930,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
        
 }
 
-/* node was checked to have lasttime != curtime , and is of type ID_OB */
+/* node was checked to have lasttime != curtime, and is of type ID_OB */
 static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
 {
        DagAdjList *itA;
@@ -1952,7 +1952,7 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
        return node->lay;
 }
 
-/* node was checked to have lasttime != curtime , and is of type ID_OB */
+/* node was checked to have lasttime != curtime, and is of type ID_OB */
 static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int reset)
 {
        Main *bmain= G.main;
@@ -2897,7 +2897,7 @@ void DAG_pose_sort(Object *ob)
                while (itA != NULL) {
                        if (itA->node->color == DAG_WHITE) {
                                itA->node->color = DAG_GRAY;
-                               push_stack(nqueue,itA->node);
+                               push_stack(nqueue, itA->node);
                                skip = 1;
                                break;
                        } 
@@ -2935,8 +2935,8 @@ void DAG_pose_sort(Object *ob)
 //             printf(" %s\n", pchan->name);
 //     }
        
-       free_forest( dag );
-       MEM_freeN( dag );
+       free_forest(dag);
+       MEM_freeN(dag);
        
        ugly_hack_sorry= 1;
 }
index 3d79386..4e90079 100644 (file)
@@ -197,7 +197,7 @@ void addnormalsDispList(ListBase *lb)
                                        
                                        for (; b<dl->nr; b++) {
        
-                                               normal_quad_v3( nor,v1, v3, v4, v2);
+                                               normal_quad_v3(nor, v1, v3, v4, v2);
        
                                                add_v3_v3(n1, nor);
                                                add_v3_v3(n2, nor);
@@ -1197,7 +1197,7 @@ static void rotateBevelPiece(Curve *cu, BevPoint *bevp, DispList *dlb, float wid
        int b;
 
        fp = dlb->verts;
-       for (b = 0; b<dlb->nr; b++,fp += 3,data += 3) {
+       for (b = 0; b<dlb->nr; b++, fp += 3, data += 3) {
                if (cu->flag & CU_3D) {
                        float vec[3];
 
@@ -1288,7 +1288,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                        BevList *bl= cu->bev.first;
                        Nurb *nu= nubase->first;
 
-                       for (; bl && nu; bl=bl->next,nu=nu->next) {
+                       for (; bl && nu; bl=bl->next, nu=nu->next) {
                                DispList *dl;
                                float *data;
                                BevPoint *bevp;
@@ -1357,7 +1357,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
        
                                                        /* for each point of poly make a bevel piece */
                                                        bevp= (BevPoint *)(bl+1);
-                                                       for (a=0; a<bl->nr; a++,bevp++) {
+                                                       for (a=0; a<bl->nr; a++, bevp++) {
                                                                float fac=1.0;
                                                                if (cu->taperobj==NULL) {
                                                                        if ( (cu->bevobj!=NULL) || !((cu->flag & CU_FRONT) || (cu->flag & CU_BACK)) )
index e6f38a3..636788e 100644 (file)
 
 /* precalculated gaussian factors for 5x super sampling        */
 static float gaussianFactors[5] = {    0.996849f,
-                                                               0.596145f,
-                                                               0.596145f,
-                                                               0.596145f,
-                                                               0.524141f};
+                                    0.596145f,
+                                    0.596145f,
+                                    0.596145f,
+                                    0.524141f};
 static float gaussianTotal = 3.309425f;
 
 /* UV Image neighboring pixel table x and y list */
-static int neighX[8] = {1,1,0,-1,-1,-1, 0, 1};
-static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
+static int neighX[8] = {1, 1, 0, -1, -1, -1, 0, 1};
+static int neighY[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
 /* subframe_updateObject() flags */
 #define UPDATE_PARENTS (1<<0)
@@ -110,7 +110,7 @@ static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
 #define MIN_WETNESS 0.001f
 #define MAX_WETNESS 5.0f
 /* dissolve macro */
-#define VALUE_DISSOLVE(VALUE, TIME, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * (pow(MIN_WETNESS,1.0f/(1.2f*((float)(TIME))/(SCALE)))) : (VALUE) - 1.0f/(TIME)*(SCALE)
+#define VALUE_DISSOLVE(VALUE, TIME, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * (pow(MIN_WETNESS, 1.0f/(1.2f*((float)(TIME))/(SCALE)))) : (VALUE) - 1.0f/(TIME)*(SCALE)
 
 /***************************** Internal Structs ***************************/
 
@@ -376,18 +376,18 @@ void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
        }
 
        if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
-               strcat(surface->output_name,"paintmap");
-               strcat(surface->output_name2,"wetmap");
+               strcat(surface->output_name, "paintmap");
+               strcat(surface->output_name2, "wetmap");
                surface_setUniqueOutputName(surface, surface->output_name2, 1);
        }
        else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
-               strcat(surface->output_name,"displace");
+               strcat(surface->output_name, "displace");
        }
        else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
-               strcat(surface->output_name,"weight");
+               strcat(surface->output_name, "weight");
        }
        else if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
-               strcat(surface->output_name,"wave");
+               strcat(surface->output_name, "wave");
        }
 
        surface_setUniqueOutputName(surface, surface->output_name, 0);
@@ -720,14 +720,14 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
                /* get dimensions */
                sub_v3_v3v3(dim, grid->grid_bounds.max, grid->grid_bounds.min);
                copy_v3_v3(td, dim);
-               min_dim = MAX3(td[0],td[1],td[2]) / 1000.f;
+               min_dim = MAX3(td[0], td[1], td[2]) / 1000.f;
 
                /* deactivate zero axises */
                for (i=0; i<3; i++) {
                        if (td[i]<min_dim) {td[i]=1.0f; axis-=1;}
                }
 
-               if (axis == 0 || MAX3(td[0],td[1],td[2]) < 0.0001f) {
+               if (axis == 0 || MAX3(td[0], td[1], td[2]) < 0.0001f) {
                        MEM_freeN(grid_bounds);
                        MEM_freeN(bData->grid);
                        bData->grid = NULL;
@@ -1469,7 +1469,7 @@ void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
                        #pragma omp parallel for schedule(static)
                        for (i=0; i<sData->total_points; i++) {
                                int face_ind = f_data->uv_p[i].face_index;
-                               float colors[3][4] = {{0.0f,0.0f,0.0f,0.0f}};
+                               float colors[3][4] = {{0.0f, 0.0f, 0.0f, 0.0f}};
                                float final_color[4];
                                int j;
                                /* collect color values */
@@ -1914,8 +1914,8 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen
 *      Tries to find the neighboring pixel in given (uv space) direction.
 *      Result is used by effect system to move paint on the surface.
 *
-*   px,py : origin pixel x and y
-*      n_index : lookup direction index (use neighX,neighY to get final index)
+*   px, py : origin pixel x and y
+*      n_index : lookup direction index (use neighX, neighY to get final index)
 */
 static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh *dm,
                                            const char *uvname, int w, int h, int px, int py, int n_index)
@@ -1925,7 +1925,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
        *  and faster/simplier than including possible face tip point links)
        */
 
-       int x,y;
+       int x, y;
        PaintUVPoint *tPoint = NULL;
        PaintUVPoint *cPoint = NULL;
 
@@ -2121,7 +2121,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
                                                        0.4f, -0.2f,
                                                        -0.4f, 0.3f};
        int ty;
-       int w,h;
+       int w, h;
        int numOfFaces;
        char uvname[MAX_CUSTOMDATA_LAYER_NAME];
        int active_points = 0;
@@ -2217,7 +2217,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
                                short isInside = 0;     /* if point is inside a uv face */
 
                                float d1[2], d2[2], d3[2], point[5][2];
-                               float dot00,dot01,dot02,dot11,dot12, invDenom, u,v;
+                               float dot00, dot01, dot02, dot11, dot12, invDenom, u, v;
 
                                /* Init per pixel settings */
                                tPoint->face_index = -1;
@@ -2258,7 +2258,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
                                                if (faceBB[i].max[1] < (point[sample][1])) continue;
 
                                                /*  Calculate point inside a triangle check
-                                               *       for uv0,1,2 */
+                                               *       for uv0, 1, 2 */
                                                sub_v2_v2v2(d1,  tface[i].uv[2], tface[i].uv[0]);       // uv2 - uv0
                                                sub_v2_v2v2(d2,  tface[i].uv[1], tface[i].uv[0]);       // uv1 - uv0
                                                sub_v2_v2v2(d3,  point[sample], tface[i].uv[0]);        // point - uv0
@@ -2358,7 +2358,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
                                /* If point isn't't on canvas mesh      */
                                if (tPoint->face_index == -1) {
                                        int u_min, u_max, v_min, v_max;
-                                       int u,v, ind;
+                                       int u, v, ind;
                                        float point[2];
 
                                        /* get loop area        */
@@ -2696,7 +2696,7 @@ static void dynamicPaint_updateBrushMaterials(Object *brushOb, Material *ui_mat,
                if (tot) {
                        bMats->ob_mats = MEM_callocN(sizeof(Material*)*(tot), "BrushMaterials");
                        for (i=0; i<tot; i++) {
-                               bMats->ob_mats[i] = RE_init_sample_material(give_current_material(brushOb,(i+1)), scene);
+                               bMats->ob_mats[i] = RE_init_sample_material(give_current_material(brushOb, (i+1)), scene);
                        }
                }
                bMats->tot = tot;
@@ -3189,7 +3189,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
                if (brush->flags & MOD_DPAINT_PROX_PROJECT && brush->collision != MOD_DPAINT_COL_VOLUME) {
                        mul_v3_fl(avg_brushNor, 1.0f/(float)numOfVerts);
                        /* instead of null vector use positive z */
-                       if (!(MIN3(avg_brushNor[0],avg_brushNor[1],avg_brushNor[2])))
+                       if (!(MIN3(avg_brushNor[0], avg_brushNor[1], avg_brushNor[2])))
                                avg_brushNor[2] = 1.0f;
                        else
                                normalize_v3(avg_brushNor);
@@ -3278,7 +3278,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
                                                        float dot;
 
                                                        if (quad) {v2=mface[hit.index].v3; v3=mface[hit.index].v4;}
-                                                       normal_tri_v3( hit.no, mvert[v1].co, mvert[v2].co, mvert[v3].co);
+                                                       normal_tri_v3(hit.no, mvert[v1].co, mvert[v2].co, mvert[v3].co);
                                                        dot = ray_dir[0]*hit.no[0] + ray_dir[1]*hit.no[1] + ray_dir[2]*hit.no[2];
 
                                                        /*  If ray and hit face normal are facing same direction
@@ -3402,7 +3402,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
 
                                                /* velocity brush, only do on main sample */
                                                if (brush->flags & MOD_DPAINT_USES_VELOCITY && ss==0 && brushVelocity) {
-                                                       int v1,v2,v3;
+                                                       int v1, v2, v3;
                                                        float weights[4];
                                                        float brushPointVelocity[3];
                                                        float velocity[3];
@@ -3888,7 +3888,7 @@ static void dynamicPaint_prepareAdjacencyData(DynamicPaintSurface *surface, int
        if ((!surface_usesAdjDistance(surface) && !force_init) || !sData->adj_data) return;
 
        if (bData->bNeighs) MEM_freeN(bData->bNeighs);
-       bNeighs = bData->bNeighs = MEM_mallocN(sData->adj_data->total_targets*sizeof(struct BakeAdjPoint),"PaintEffectBake");
+       bNeighs = bData->bNeighs = MEM_mallocN(sData->adj_data->total_targets*sizeof(struct BakeAdjPoint), "PaintEffectBake");
        if (!bNeighs) return;
 
        #pragma omp parallel for schedule(static)
index 263f89a..884e4e1 100644 (file)
@@ -387,14 +387,14 @@ static void emDM_foreachMappedEdge(
                BM_mesh_elem_index_ensure(bmdm->tc->bm, BM_VERT);
 
                eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
-               for (i=0; eed; i++,eed=BM_iter_step(&iter))
+               for (i=0; eed; i++, eed=BM_iter_step(&iter))
                        func(userData, i,
                                 bmdm->vertexCos[BM_elem_index_get(eed->v1)],
                                 bmdm->vertexCos[BM_elem_index_get(eed->v2)]);
        }
        else {
                eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
-               for (i=0; eed; i++,eed=BM_iter_step(&iter))
+               for (i=0; eed; i++, eed=BM_iter_step(&iter))
                        func(userData, i, eed->v1->co, eed->v2->co);
        }
 }
@@ -415,7 +415,7 @@ static void emDM_drawMappedEdges(
 
                glBegin(GL_LINES);
                eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
-               for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+               for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
                        if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
                                glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v1)]);
                                glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v2)]);
@@ -426,7 +426,7 @@ static void emDM_drawMappedEdges(
        else {
                glBegin(GL_LINES);
                eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
-               for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+               for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
                        if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
                                glVertex3fv(eed->v1->co);
                                glVertex3fv(eed->v2->co);
@@ -460,7 +460,7 @@ static void emDM_drawMappedEdgesInterp(
 
                glBegin(GL_LINES);
                eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
-               for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+               for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
                        if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
                                setDrawInterpOptions(userData, i, 0.0);
                                glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v1)]);
@@ -473,7 +473,7 @@ static void emDM_drawMappedEdgesInterp(
        else {
                glBegin(GL_LINES);
                eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
-               for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+               for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
                        if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
                                setDrawInterpOptions(userData, i, 0.0);
                                glVertex3fv(eed->v1->co);
index c275d4e..7fb0cf9 100644 (file)
@@ -756,7 +756,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
 
        strength= eff->pd->f_strength * efd->falloff;
 
-       copy_v3_v3(tex_co,point->loc);
+       copy_v3_v3(tex_co, point->loc);
 
        if (eff->pd->flag & PFIELD_TEX_2D) {
                float fac=-dot_v3v3(tex_co, efd->nor);
@@ -767,7 +767,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
                mul_m4_v3(eff->ob->imat, tex_co);
        }
 
-       hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL,NULL, 0, result);
+       hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result);
 
        if (hasrgb && mode==PFIELD_TEX_RGB) {
                force[0] = (0.5f - result->tr) * strength;
@@ -820,7 +820,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
 {
        PartDeflect *pd = eff->pd;
        RNG *rng = pd->rng;
-       float force[3]={0,0,0};
+       float force[3]={0, 0, 0};
        float temp[3];
        float fac;
        float strength = pd->f_strength;
@@ -905,9 +905,9 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
                        else {
                                add_v3_v3v3(temp, efd->vec_to_point2, efd->nor2);
                        }
-                       force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2,0,2);
-                       force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2,0,2);
-                       force[2] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[2], temp[0], temp[1], 2,0,2);
+                       force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2, 0, 2);
+                       force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2, 0, 2);
+                       force[2] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[2], temp[0], temp[1], 2, 0, 2);
                        mul_v3_fl(force, strength * efd->falloff);
                        break;
                case PFIELD_DRAG:
@@ -993,7 +993,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
                                else if (eff->pd->forcefield == PFIELD_TEXTURE)
                                        do_texture_effector(eff, &efd, point, force);
                                else {
-                                       float temp1[3]={0,0,0}, temp2[3];
+                                       float temp1[3]={0, 0, 0}, temp2[3];
                                        copy_v3_v3(temp1, force);
 
                                        do_physical_effector(eff, &efd, point, force);
index e854325..7451324 100644 (file)
@@ -803,7 +803,7 @@ void calchandles_fcurve (FCurve *fcu)
                BKE_nurb_handle_calc(bezt, prev, next, 1);      /* 1==special autohandle */
                
                /* for automatic ease in and out */
-               if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) && ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
+               if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {
                        /* only do this on first or last beztriple */
                        if ((a == 0) || (a == fcu->totvert-1)) {
                                /* set both handles to have same horizontal value as keyframe */
@@ -1144,8 +1144,8 @@ static float dvar_eval_rotDiff (ChannelDriver *driver, DriverVar *dvar)
 // TODO: this needs to take into account space conversions...
 static float dvar_eval_locDiff (ChannelDriver *driver, DriverVar *dvar)
 {
-       float loc1[3] = {0.0f,0.0f,0.0f};
-       float loc2[3] = {0.0f,0.0f,0.0f};
+       float loc1[3] = {0.0f, 0.0f, 0.0f};
+       float loc2[3] = {0.0f, 0.0f, 0.0f};
        
        /* get two location values */
        // NOTE: for now, these are all just worldspace
@@ -1240,7 +1240,7 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar)
        Object *ob= (Object *)dtar_id_ensure_proxy_from(dtar->id);
        bPoseChannel *pchan;
        float mat[4][4];
-       float oldEul[3] = {0.0f,0.0f,0.0f};
+       float oldEul[3] = {0.0f, 0.0f, 0.0f};
        short useEulers=0, rotOrder=ROT_MODE_EUL;
        
        /* check if this target has valid data */
@@ -1656,7 +1656,7 @@ static float evaluate_driver (ChannelDriver *driver, const float evaltime)
                                driver->curval= 0.0f;
                        }
                        else {
-                               /* this evaluates the expression using Python,and returns its result:
+                               /* this evaluates the expression using Python, and returns its result:
                                 *      - on errors it reports, then returns 0.0f
                                 */
                                driver->curval= BPY_driver_exec(driver, evaltime);
index 5d7960a..a7f0139 100644 (file)
@@ -317,7 +317,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
        Nurb *nu2;
        BPoint *bp;
        
-       nu2 =(Nurb*) MEM_callocN(sizeof(Nurb),"underline_nurb");
+       nu2 =(Nurb*) MEM_callocN(sizeof(Nurb), "underline_nurb");
        if (nu2 == NULL) return;
        nu2->resolu= cu->resolu;
        nu2->bezt = NULL;
@@ -331,7 +331,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
        nu2->orderv = 1;
        nu2->flagu = CU_NURB_CYCLIC;
 
-       bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp"); 
+       bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint), "underline_bp");
        if (bp == NULL) {
                MEM_freeN(nu2);
                return;
@@ -382,7 +382,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
        }
 #endif
 
-       /* make a copy at distance ofsx,ofsy with shear*/
+       /* make a copy at distance ofsx, ofsy with shear*/
        fsize= cu->fsize;
        shear= cu->shear;
        si= (float)sin(rot);
@@ -398,7 +398,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
        while (nu1) {
                bezt1 = nu1->bezt;
                if (bezt1) {
-                       nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb),"duplichar_nurb");
+                       nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb), "duplichar_nurb");
                        if (nu2 == NULL) break;
                        memcpy(nu2, nu1, sizeof(struct Nurb));
                        nu2->resolu= cu->resolu;
@@ -416,7 +416,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
                        /* nu2->trim.last = 0; */
                        i = nu2->pntsu;
 
-                       bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple),"duplichar_bezt2"); 
+                       bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple), "duplichar_bezt2");
                        if (bezt2 == NULL) {
                                MEM_freeN(nu2);
                                break;
@@ -583,14 +583,14 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
 
        /* calc offset and rotation of each char */
        ct = chartransdata =
-               (struct chartrans*)MEM_callocN((slen+1)* sizeof(struct chartrans),"buildtext");
+               (struct chartrans*)MEM_callocN((slen+1)* sizeof(struct chartrans), "buildtext");
 
        /* We assume the worst case: 1 character per line (is freed at end anyway) */
 
-       linedata= MEM_mallocN(sizeof(float)*(slen*2 + 1),"buildtext2");
-       linedata2= MEM_mallocN(sizeof(float)*(slen*2 + 1),"buildtext3");
-       linedata3= MEM_callocN(sizeof(float)*(slen*2 + 1),"buildtext4");        
-       linedata4= MEM_callocN(sizeof(float)*(slen*2 + 1),"buildtext5");                
+       linedata  = MEM_mallocN(sizeof(float) * (slen * 2 + 1), "buildtext2");
+       linedata2 = MEM_mallocN(sizeof(float) * (slen * 2 + 1), "buildtext3");
+       linedata3 = MEM_callocN(sizeof(float) * (slen * 2 + 1), "buildtext4");
+       linedata4 = MEM_callocN(sizeof(float) * (slen * 2 + 1), "buildtext5");
        
        linedist= cu->linedist;
        
index b52576e..cd24668 100644 (file)
@@ -53,7 +53,7 @@ static IDType idtypes[]= {
        { ID_BR,                "Brush",        "brushes",              IDTYPE_FLAGS_ISLINKABLE}, 
        { ID_CA,                "Camera",       "cameras",              IDTYPE_FLAGS_ISLINKABLE}, 
        { ID_CU,                "Curve",        "curves",               IDTYPE_FLAGS_ISLINKABLE}, 
-       { ID_GD,                "GPencil",      "grease_pencil",IDTYPE_FLAGS_ISLINKABLE},  /* rename gpencil */
+       { ID_GD,                "GPencil",      "grease_pencil", IDTYPE_FLAGS_ISLINKABLE},  /* rename gpencil */
        { ID_GR,                "Group",        "groups",               IDTYPE_FLAGS_ISLINKABLE}, 
        { ID_ID,                "ID",           "ids",                  0}, /* plural is fake */
        { ID_IM,                "Image",        "images",               IDTYPE_FLAGS_ISLINKABLE}, 
index 5c9c942..9c5c995 100644 (file)
@@ -1036,38 +1036,38 @@ char BKE_imtype_valid_depths(const char imtype)
  * creator.c help info */
 char BKE_imtype_from_arg(const char *imtype_arg)
 {
-       if      (!strcmp(imtype_arg,"TGA")) return R_IMF_IMTYPE_TARGA;
-       else if (!strcmp(imtype_arg,"IRIS")) return R_IMF_IMTYPE_IRIS;
+       if      (!strcmp(imtype_arg, "TGA")) return R_IMF_IMTYPE_TARGA;
+       else if (!strcmp(imtype_arg, "IRIS")) return R_IMF_IMTYPE_IRIS;
 #ifdef WITH_DDS
-       else if (!strcmp(imtype_arg,"DDS")) return R_IMF_IMTYPE_DDS;
+       else if (!strcmp(imtype_arg, "DDS")) return R_IMF_IMTYPE_DDS;
 #endif
-       else if (!strcmp(imtype_arg,"JPEG")) return R_IMF_IMTYPE_JPEG90;
-       else if (!strcmp(imtype_arg,"IRIZ")) return R_IMF_IMTYPE_IRIZ;
-       else if (!strcmp(imtype_arg,"RAWTGA")) return R_IMF_IMTYPE_RAWTGA;
-       else if (!strcmp(imtype_arg,"AVIRAW")) return R_IMF_IMTYPE_AVIRAW;
-       else if (!strcmp(imtype_arg,"AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG;
-       else if (!strcmp(imtype_arg,"PNG")) return R_IMF_IMTYPE_PNG;
-       else if (!strcmp(imtype_arg,"AVICODEC")) return R_IMF_IMTYPE_AVICODEC;
-       else if (!strcmp(imtype_arg,"QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME;
-       else if (!strcmp(imtype_arg,"BMP")) return R_IMF_IMTYPE_BMP;
+       else if (!strcmp(imtype_arg, "JPEG")) return R_IMF_IMTYPE_JPEG90;
+       else if (!strcmp(imtype_arg, "IRIZ")) return R_IMF_IMTYPE_IRIZ;
+       else if (!strcmp(imtype_arg, "RAWTGA")) return R_IMF_IMTYPE_RAWTGA;
+       else if (!strcmp(imtype_arg, "AVIRAW")) return R_IMF_IMTYPE_AVIRAW;
+       else if (!strcmp(imtype_arg, "AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG;
+       else if (!strcmp(imtype_arg, "PNG")) return R_IMF_IMTYPE_PNG;
+       else if (!strcmp(imtype_arg, "AVICODEC")) return R_IMF_IMTYPE_AVICODEC;
+       else if (!strcmp(imtype_arg, "QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME;
+       else if (!strcmp(imtype_arg, "BMP")) return R_IMF_IMTYPE_BMP;
 #ifdef WITH_HDR
-       else if (!strcmp(imtype_arg,"HDR")) return R_IMF_IMTYPE_RADHDR;
+       else if (!strcmp(imtype_arg, "HDR")) return R_IMF_IMTYPE_RADHDR;
 #endif
 #ifdef WITH_TIFF
-       else if (!strcmp(imtype_arg,"TIFF")) return R_IMF_IMTYPE_TIFF;
+       else if (!strcmp(imtype_arg, "TIFF")) return R_IMF_IMTYPE_TIFF;
 #endif
 #ifdef WITH_OPENEXR
-       else if (!strcmp(imtype_arg,"EXR")) return R_IMF_IMTYPE_OPENEXR;
-       else if (!strcmp(imtype_arg,"MULTILAYER")) return R_IMF_IMTYPE_MULTILAYER;
+       else if (!strcmp(imtype_arg, "EXR")) return R_IMF_IMTYPE_OPENEXR;
+       else if (!strcmp(imtype_arg, "MULTILAYER")) return R_IMF_IMTYPE_MULTILAYER;
 #endif
-       else if (!strcmp(imtype_arg,"MPEG")) return R_IMF_IMTYPE_FFMPEG;
-       else if (!strcmp(imtype_arg,"FRAMESERVER")) return R_IMF_IMTYPE_FRAMESERVER;
+       else if (!strcmp(imtype_arg, "MPEG")) return R_IMF_IMTYPE_FFMPEG;
+       else if (!strcmp(imtype_arg, "FRAMESERVER")) return R_IMF_IMTYPE_FRAMESERVER;
 #ifdef WITH_CINEON
-       else if (!strcmp(imtype_arg,"CINEON")) return R_IMF_IMTYPE_CINEON;
-       else if (!strcmp(imtype_arg,"DPX")) return R_IMF_IMTYPE_DPX;
+       else if (!strcmp(imtype_arg, "CINEON")) return R_IMF_IMTYPE_CINEON;
+       else if (!strcmp(imtype_arg, "DPX")) return R_IMF_IMTYPE_DPX;
 #endif
 #ifdef WITH_OPENJPEG
-       else if (!strcmp(imtype_arg,"JP2")) return R_IMF_IMTYPE_JP2;
+       else if (!strcmp(imtype_arg, "JP2")) return R_IMF_IMTYPE_JP2;
 #endif
        else return R_IMF_IMTYPE_INVALID;
 }
@@ -1118,7 +1118,7 @@ int BKE_add_image_extension(char *string, const char imtype)
        }
 #endif
 #ifdef WITH_OPENEXR
-       else if ( ELEM(imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
+       else if (ELEM(imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
                if (!BLI_testextensie(string, ".exr"))
                        extension= ".exr";
        }
@@ -1144,7 +1144,7 @@ int BKE_add_image_extension(char *string, const char imtype)
        }
 #endif
        else { //   R_IMF_IMTYPE_AVICODEC, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_QUICKTIME etc
-               if (!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
+               if (!(BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
                        extension= ".jpg";
        }
 
@@ -2603,7 +2603,7 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
 
                /* cyclic */
                if (iuser->cycl) {
-                       cfra= ( (cfra) % len );
+                       cfra= ((cfra) % len);
                        if (cfra < 0) cfra+= len;
                        if (cfra==0) cfra= len;
                }
@@ -2621,7 +2621,7 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
                framenr+= iuser->offset;
 
                if (iuser->cycl) {
-                       framenr= ( (framenr) % len );
+                       framenr= ((framenr) % len);
                        while (framenr < 0) framenr+= len;
                        if (framenr==0) framenr= len;
                }
index b593419..cd6ac32 100644 (file)
@@ -87,7 +87,7 @@ void itstart(void)
 }
 static void itend(void)
 {
-       gettimeofday(&_itend,&itz);
+       gettimeofday(&_itend, &itz);
 }
 double itval(void)
 {
@@ -98,8 +98,8 @@ double itval(void)
 }
 #endif
 
-static float I[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
-static float ZERO[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
+static float I[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
+static float ZERO[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
 
 /*
 #define C99
@@ -119,9 +119,9 @@ struct Cloth;
 typedef float lfVector[3];
 typedef struct fmatrix3x3 {
        float m[3][3]; /* 3x3 matrix */
-       unsigned int c,r; /* column and row number */
+       unsigned int c, r; /* column and row number */
        int pinned; /* is this vertex allowed to move? */
-       float n1,n2,n3; /* three normal vectors for collision constrains */
+       float n1, n2, n3; /* three normal vectors for collision constrains */
        unsigned int vcount; /* vertex count */
        unsigned int scount; /* spring count */ 
 } fmatrix3x3;
@@ -168,7 +168,7 @@ DO_INLINE void mul_fvectorT_fvectorS(float to[3][3], float vectorA[3], float vec
 /* printf vector[3] on console: for debug output */
 static void print_fvector(float m3[3])
 {
-       printf("%f\n%f\n%f\n\n",m3[0],m3[1],m3[2]);
+       printf("%f\n%f\n%f\n\n", m3[0], m3[1], m3[2]);
 }
 
 ///////////////////////////
@@ -303,9 +303,9 @@ DO_INLINE void sub_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
 /* printf 3x3 matrix on console: for debug output */
 static void print_fmatrix(float m3[3][3])
 {
-       printf("%f\t%f\t%f\n",m3[0][0],m3[0][1],m3[0][2]);
-       printf("%f\t%f\t%f\n",m3[1][0],m3[1][1],m3[1][2]);
-       printf("%f\t%f\t%f\n\n",m3[2][0],m3[2][1],m3[2][2]);
+       printf("%f\t%f\t%f\n", m3[0][0], m3[0][1], m3[0][2]);
+       printf("%f\t%f\t%f\n", m3[1][0], m3[1][1], m3[1][2]);
+       printf("%f\t%f\t%f\n\n", m3[2][0], m3[2][1], m3[2][2]);
 }
 #endif
 
@@ -367,9 +367,9 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
 /* STATUS: verified */
 DO_INLINE void mul_fmatrix_S(float matrix[3][3], float scalar)
 {
-       mul_fvector_S(matrix[0], matrix[0],scalar);
-       mul_fvector_S(matrix[1], matrix[1],scalar);
-       mul_fvector_S(matrix[2], matrix[2],scalar);
+       mul_fvector_S(matrix[0], matrix[0], scalar);
+       mul_fvector_S(matrix[1], matrix[1], scalar);
+       mul_fvector_S(matrix[2], matrix[2], scalar);
 }
 
 /* a vector multiplied by a 3x3 matrix */
@@ -385,17 +385,17 @@ DO_INLINE void mul_fvector_fmatrix(float *to, float *from, float matrix[3][3])
 /* STATUS: verified */
 DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float from[3])
 {
-       to[0] = dot_v3v3(matrix[0],from);
-       to[1] = dot_v3v3(matrix[1],from);
-       to[2] = dot_v3v3(matrix[2],from);
+       to[0] = dot_v3v3(matrix[0], from);
+       to[1] = dot_v3v3(matrix[1], from);
+       to[2] = dot_v3v3(matrix[2], from);
 }
 /* 3x3 matrix multiplied by a 3x3 matrix */
 /* STATUS: verified */
 DO_INLINE void mul_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
 {
-       mul_fvector_fmatrix(to[0], matrixA[0],matrixB);
-       mul_fvector_fmatrix(to[1], matrixA[1],matrixB);
-       mul_fvector_fmatrix(to[2], matrixA[2],matrixB);
+       mul_fvector_fmatrix(to[0], matrixA[0], matrixB);
+       mul_fvector_fmatrix(to[1], matrixA[1], matrixB);
+       mul_fvector_fmatrix(to[2], matrixA[2], matrixB);
 }
 /* 3x3 matrix addition with 3x3 matrix */
 DO_INLINE void add_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
@@ -459,9 +459,9 @@ DO_INLINE void muladd_fvector_fmatrix(float to[3], float from[3], float matrix[3
 /* 3x3 matrix multiplied and added  to/by a 3x3 matrix  and added to another 3x3 matrix */
 DO_INLINE void muladd_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
 {
-       muladd_fvector_fmatrix(to[0], matrixA[0],matrixB);
-       muladd_fvector_fmatrix(to[1], matrixA[1],matrixB);
-       muladd_fvector_fmatrix(to[2], matrixA[2],matrixB);
+       muladd_fvector_fmatrix(to[0], matrixA[0], matrixB);
+       muladd_fvector_fmatrix(to[1], matrixA[1], matrixB);
+       muladd_fvector_fmatrix(to[2], matrixA[2], matrixB);
 }
 /* a vector multiplied and sub'd to/by a 3x3 matrix */
 DO_INLINE void mulsub_fvector_fmatrix(float to[3], float from[3], float matrix[3][3])
@@ -473,9 +473,9 @@ DO_INLINE void mulsub_fvector_fmatrix(float to[3], float from[3], float matrix[3
 /* 3x3 matrix multiplied and sub'd  to/by a 3x3 matrix  and added to another 3x3 matrix */
 DO_INLINE void mulsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
 {
-       mulsub_fvector_fmatrix(to[0], matrixA[0],matrixB);
-       mulsub_fvector_fmatrix(to[1], matrixA[1],matrixB);
-       mulsub_fvector_fmatrix(to[2], matrixA[2],matrixB);
+       mulsub_fvector_fmatrix(to[0], matrixA[0], matrixB);
+       mulsub_fvector_fmatrix(to[1], matrixA[1], matrixB);
+       mulsub_fvector_fmatrix(to[2], matrixA[2], matrixB);
 }
 /* 3x3 matrix multiplied+added by a vector */
 /* STATUS: verified */
@@ -549,8 +549,8 @@ DO_INLINE void init_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
 // slow in parallel
 DO_INLINE void initdiag_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
 {
-       unsigned int i,j;
-       float tmatrix[3][3] = {{0,0,0},{0,0,0},{0,0,0}};
+       unsigned int i, j;
+       float tmatrix[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
 
        for (i = 0; i < matrix[0].vcount; i++) {
                cp_fmatrix(matrix[i].m, m3); 
@@ -824,14 +824,14 @@ int       implicit_free (ClothModifierData *clmd)
 DO_INLINE float fb(float length, float L)
 {
        float x = length/L;
-       return (-11.541f*pow(x,4)+34.193f*pow(x,3)-39.083f*pow(x,2)+23.116f*x-9.713f);
+       return (-11.541f*pow(x, 4)+34.193f*pow(x, 3)-39.083f*pow(x, 2)+23.116f*x-9.713f);
 }
 
 DO_INLINE float fbderiv(float length, float L)
 {
        float x = length/L;
 
-       return (-46.164f*pow(x,3)+102.579f*pow(x,2)-78.166f*x+23.116f);
+       return (-46.164f*pow(x, 3)+102.579f*pow(x, 2)-78.166f*x+23.116f);
 }
 
 DO_INLINE float fbstar(float length, float L, float kb, float cb)
@@ -887,12 +887,12 @@ static int  cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
 
        add_lfvector_lfvector(ldV, ldV, z, numverts);
 
-       // r = B - Mul(tmp,A,X);    // just use B if X known to be zero
+       // r = B - Mul(tmp, A, X);    // just use B if X known to be zero
        cp_lfvector(r, lB, numverts);
        mul_bfmatrix_lfvector(tmp, lA, ldV);
        sub_lfvector_lfvector(r, r, tmp, numverts);
 
-       filter(r,S);
+       filter(r, S);
 
        cp_lfvector(d, r, numverts);
 
@@ -900,10 +900,10 @@ static int  cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
        starget = s * sqrt(conjgrad_epsilon);
 
        while (s>starget && conjgrad_loopcount < conjgrad_looplimit) {
-               // Mul(q,A,d); // q = A*d;
+               // Mul(q, A, d); // q = A*d;
                mul_bfmatrix_lfvector(q, lA, d);
 
-               filter(q,S);
+               filter(q, S);
 
                a = s/dot_lfvector(d, q, numverts);
 
@@ -919,7 +919,7 @@ static int  cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
                //d = r+d*(s/s_prev);
                add_lfvector_lfvectorS(d, r, d, (s/s_prev), numverts);
 
-               filter(d,S);
+               filter(d, S);
 
                conjgrad_loopcount++;
        }
@@ -1126,7 +1126,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
 DO_INLINE void dfdx_spring_type1(float to[3][3], float extent[3], float length, float L, float dot, float k)
 {
        // dir is unit length direction, rest is spring's restlength, k is spring constant.
-       // return  (outerprod(dir,dir)*k + (I - outerprod(dir,dir))*(k - ((k*L)/length)));
+       // return  (outerprod(dir, dir)*k + (I - outerprod(dir, dir))*(k - ((k*L)/length)));
        float temp[3][3];
        float temp1 = k*(1.0 - (L/length));     
        
@@ -1148,7 +1148,7 @@ DO_INLINE void dfdx_spring_type1(float to[3][3], float extent[3], float length,
 
 DO_INLINE void dfdx_spring_type2(float to[3][3], float dir[3], float length, float L, float k, float cb)
 {
-       // return  outerprod(dir,dir)*fbstar_jacobi(length, L, k, cb);
+       // return  outerprod(dir, dir)*fbstar_jacobi(length, L, k, cb);
        mul_fvectorT_fvectorS(to, dir, dir, fbstar_jacobi(length, L, k, cb));
 }
 
@@ -1159,10 +1159,10 @@ DO_INLINE void dfdv_damp(float to[3][3], float dir[3], float damping)
        
 }
 
-DO_INLINE void dfdx_spring(float to[3][3],  float dir[3],float length,float L,float k)
+DO_INLINE void dfdx_spring(float to[3][3],  float dir[3], float length, float L, float k)
 {
        // dir is unit length direction, rest is spring's restlength, k is spring constant.
-       //return  ( (I-outerprod(dir,dir))*Min(1.0f,rest/length) - I) * -k;
+       //return  ( (I-outerprod(dir, dir))*Min(1.0f, rest/length) - I) * -k;
        mul_fvectorT_fvector(to, dir, dir);
        sub_fmatrix_fmatrix(to, I, to);
 
@@ -1172,13 +1172,13 @@ DO_INLINE void dfdx_spring(float to[3][3],  float dir[3],float length,float L,fl
 }
 
 // unused atm
-DO_INLINE void dfdx_damp(float to[3][3],  float dir[3],float length,const float vel[3],float rest,float damping)
+DO_INLINE void dfdx_damp(float to[3][3],  float dir[3], float length, const float vel[3], float rest, float damping)
 {
        // inner spring damping   vel is the relative velocity  of the endpoints.  
-       //      return (I-outerprod(dir,dir)) * (-damping * -(dot(dir,vel)/Max(length,rest)));
+       //      return (I-outerprod(dir, dir)) * (-damping * -(dot(dir, vel)/Max(length, rest)));
        mul_fvectorT_fvector(to, dir, dir);
        sub_fmatrix_fmatrix(to, I, to);
-       mul_fmatrix_S(to,  (-damping * -(dot_v3v3(dir,vel)/MAX2(length,rest))));
+       mul_fmatrix_S(to,  (-damping * -(dot_v3v3(dir, vel)/MAX2(length, rest))));
 
 }
 
@@ -1188,17 +1188,17 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
        ClothVertex *verts = cloth->verts;
        float extent[3];
        float length = 0, dot = 0;
-       float dir[3] = {0,0,0};
+       float dir[3] = {0, 0, 0};
        float vel[3];
        float k = 0.0f;
        float L = s->restlen;
        float cb; /* = clmd->sim_parms->structural; */ /*UNUSED*/
 
-       float nullf[3] = {0,0,0};
-       float stretch_force[3] = {0,0,0};
-       float bending_force[3] = {0,0,0};
-       float damping_force[3] = {0,0,0};
-       float nulldfdx[3][3]={ {0,0,0}, {0,0,0}, {0,0,0}};
+       float nullf[3] = {0, 0, 0};
+       float stretch_force[3] = {0, 0, 0};
+       float bending_force[3] = {0, 0, 0};
+       float damping_force[3] = {0, 0, 0};
+       float nulldfdx[3][3]={ {0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
        
        float scaling = 0.0;
 
@@ -1306,7 +1306,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
                        mul_fvector_S(bending_force, dir, fbstar(length, L, k, cb));
                        VECADD(s->f, s->f, bending_force);
 
-                       dfdx_spring_type2(s->dfdx, dir, length,L, k, cb);
+                       dfdx_spring_type2(s->dfdx, dir, length, L, k, cb);
                }
        }
 }
@@ -1334,7 +1334,7 @@ DO_INLINE void cloth_apply_spring_force(ClothModifierData *UNUSED(clmd), ClothSp
 
 static void CalcFloat( float *v1, float *v2, float *v3, float *n)
 {
-       float n1[3],n2[3];
+       float n1[3], n2[3];
 
        n1[0]= v1[0]-v2[0];
        n2[0]= v2[0]-v3[0];
@@ -1350,7 +1350,7 @@ static void CalcFloat( float *v1, float *v2, float *v3, float *n)
 static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
 {
        /* real cross! */
-       float n1[3],n2[3];
+       float n1[3], n2[3];
 
        n1[0]= v1[0]-v3[0];
        n1[1]= v1[1]-v3[1];
@@ -1512,7 +1512,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
 
 static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M)
 {
-       /* Collect forces and derivatives:  F,dFdX,dFdV */
+       /* Collect forces and derivatives:  F, dFdX, dFdV */
        Cloth           *cloth          = clmd->clothObject;
        unsigned int i  = 0;
        float           spring_air      = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */
@@ -1568,17 +1568,17 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
                }
                
                for (i = 0; i < cloth->numfaces; i++) {
-                       float trinormal[3]={0,0,0}; // normalized triangle normal
-                       float triunnormal[3]={0,0,0}; // not-normalized-triangle normal
-                       float tmp[3]={0,0,0};
+                       float trinormal[3]={0, 0, 0}; // normalized triangle normal
+                       float triunnormal[3]={0, 0, 0}; // not-normalized-triangle normal
+                       float tmp[3]={0, 0, 0};
                        float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0;
                        factor *= 0.02;
                        
                        // calculate face normal
                        if (mfaces[i].v4)
-                               CalcFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],triunnormal);
+                               CalcFloat4(lX[mfaces[i].v1], lX[mfaces[i].v2], lX[mfaces[i].v3], lX[mfaces[i].v4], triunnormal);
                        else
-                               CalcFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],triunnormal);
+                               CalcFloat(lX[mfaces[i].v1], lX[mfaces[i].v2], lX[mfaces[i].v3], triunnormal);
 
                        normalize_v3_v3(trinormal, triunnormal);
                        
@@ -1608,9 +1608,9 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
                /* Hair has only edges */
                if (cloth->numfaces == 0) {
                        ClothSpring *spring;
-                       float edgevec[3]={0,0,0}; //edge vector
-                       float edgeunnormal[3]={0,0,0}; // not-normalized-edge normal
-                       float tmp[3]={0,0,0};
+                       float edgevec[3]={0, 0, 0}; //edge vector
+                       float edgeunnormal[3]={0, 0, 0}; // not-normalized-edge normal
+                       float tmp[3]={0, 0, 0};
                        float factor = 0.01;
 
                        search = cloth->springs;
index 12f11a9..e78da48 100644 (file)
@@ -131,9 +131,9 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
        }
 
        co = vertexCos[0];
-       for (w=0,wc=fw; w<wNew; w++,wc+=dw) {
-               for (v=0,vc=fv; v<vNew; v++,vc+=dv) {
-                       for (u=0,uc=fu; u<uNew; u++,co+=3,uc+=du) {
+       for (w=0, wc=fw; w<wNew; w++, wc+=dw) {
+               for (v=0, vc=fv; v<vNew; v++, vc+=dv) {
+                       for (u=0, uc=fu; u<uNew; u++, co+=3, uc+=du) {
                                co[0] = uc;
                                co[1] = vc;
                                co[2] = wc;
@@ -177,7 +177,7 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
        
        bp= lt->def;
        
-       for (i=0; i<lt->pntsu*lt->pntsv*lt->pntsw; i++,bp++) {
+       for (i=0; i<lt->pntsu*lt->pntsv*lt->pntsw; i++, bp++) {
                copy_v3_v3(bp->vec, vertexCos[i]);
        }
 
@@ -322,9 +322,9 @@ void init_latt_deform(Object *oblatt, Object *ob)
                invert_m4_m4(imat, lt->latmat);
        }
        
-       for (w=0,fw=lt->fw; w<lt->pntsw; w++,fw+=lt->dw) {
-               for (v=0,fv=lt->fv; v<lt->pntsv; v++, fv+=lt->dv) {
-                       for (u=0,fu=lt->fu; u<lt->pntsu; u++, bp++, co+=3, fp+=3, fu+=lt->du) {
+       for (w=0, fw=lt->fw; w<lt->pntsw; w++, fw+=lt->dw) {
+               for (v=0, fv=lt->fv; v<lt->pntsv; v++, fv+=lt->dv) {
+                       for (u=0, fu=lt->fu; u<lt->pntsu; u++, bp++, co+=3, fp+=3, fu+=lt->du) {
                                if (dl) {
                                        fp[0] = co[0] - fu;
                                        fp[1] = co[1] - fv;
@@ -568,7 +568,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float co[3],
 
                        /* this is not exactly the same as 2.4x, since the axis is having rotation removed rather than
                         * changing the axis before calculating the tilt but serves much the same purpose */
-                       float dir_flat[3]={0,0,0}, q[4];
+                       float dir_flat[3]={0, 0, 0}, q[4];
                        copy_v3_v3(dir_flat, dir);
                        dir_flat[cd->no_rot_axis-1]= 0.0f;
 
@@ -774,7 +774,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target,
        if (calc_curve_deform(scene, cuOb, vec, target->trackflag, &cd, quat)) {
                float qmat[3][3];
                
-               quat_to_mat3( qmat,quat);
+               quat_to_mat3(qmat, quat);
                mul_m3_m3m3(mat, qmat, cd.objectspace3);
        }
        else
@@ -937,7 +937,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
        if (lt->editlatt) lt= lt->editlatt->latt;
        numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
        
-       vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
+       vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts, "lt_vcos");
        
        for (i=0; i<numVerts; i++) {
                copy_v3_v3(vertexCos[i], lt->def[i].vec);
index 7126627..4576df7 100644 (file)
@@ -1217,7 +1217,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
                        continue;
                }
                /* this format specifier is from hell... */
-               BLI_snprintf(name, sizeof(id->name) - 2,"%s.%.3d", left, nr);
+               BLI_snprintf(name, sizeof(id->name) - 2, "%s.%.3d", left, nr);
 
                return 1;
        }
index 2dfd41f..95ec14e 100644 (file)
@@ -1054,31 +1054,31 @@ int material_in_material(Material *parmat, Material *mat)
 /* ****************** */
 #if 0 /* UNUSED */
 static char colname_array[125][20]= {
-"Black","DarkRed","HalfRed","Red","Red",
-"DarkGreen","DarkOlive","Brown","Chocolate","OrangeRed",
-"HalfGreen","GreenOlive","DryOlive","Goldenrod","DarkOrange",
-"LightGreen","Chartreuse","YellowGreen","Yellow","Gold",
-"Green","LawnGreen","GreenYellow","LightOlive","Yellow",
-"DarkBlue","DarkPurple","HotPink","VioletPink","RedPink",
-"SlateGray","DarkGrey","PalePurple","IndianRed","Tomato",
-"SeaGreen","PaleGreen","GreenKhaki","LightBrown","LightSalmon",
-"SpringGreen","PaleGreen","MediumOlive","YellowBrown","LightGold",
-"LightGreen","LightGreen","LightGreen","GreenYellow","PaleYellow",
-"HalfBlue","DarkSky","HalfMagenta","VioletRed","DeepPink",
-"SteelBlue","SkyBlue","Orchid","LightHotPink","HotPink",
-"SeaGreen","SlateGray","MediumGrey","Burlywood","LightPink",
-"SpringGreen","Aquamarine","PaleGreen","Khaki","PaleOrange",
-"SpringGreen","SeaGreen","PaleGreen","PaleWhite","YellowWhite",
-"LightBlue","Purple","MediumOrchid","Magenta","Magenta",
-"RoyalBlue","SlateBlue","MediumOrchid","Orchid","Magenta",
-"DeepSkyBlue","LightSteelBlue","LightSkyBlue","Violet","LightPink",
-"Cyan","DarkTurquoise","SkyBlue","Grey","Snow",
-"Mint","Mint","Aquamarine","MintCream","Ivory",
-"Blue","Blue","DarkMagenta","DarkOrchid","Magenta",
-"SkyBlue","RoyalBlue","LightSlateBlue","MediumOrchid","Magenta",
-"DodgerBlue","SteelBlue","MediumPurple","PalePurple","Plum",
-"DeepSkyBlue","PaleBlue","LightSkyBlue","PalePurple","Thistle",
-"Cyan","ColdBlue","PaleTurquoise","GhostWhite","White"
+"Black", "DarkRed", "HalfRed", "Red", "Red",
+"DarkGreen", "DarkOlive", "Brown", "Chocolate", "OrangeRed",
+"HalfGreen", "GreenOlive", "DryOlive", "Goldenrod", "DarkOrange",
+"LightGreen", "Chartreuse", "YellowGreen", "Yellow", "Gold",
+"Green", "LawnGreen", "GreenYellow", "LightOlive", "Yellow",
+"DarkBlue", "DarkPurple", "HotPink", "VioletPink", "RedPink",
+"SlateGray", "DarkGrey", "PalePurple", "IndianRed", "Tomato",
+"SeaGreen", "PaleGreen", "GreenKhaki", "LightBrown", "LightSalmon",
+"SpringGreen", "PaleGreen", "MediumOlive", "YellowBrown", "LightGold",
+"LightGreen", "LightGreen", "LightGreen", "GreenYellow", "PaleYellow",
+"HalfBlue", "DarkSky", "HalfMagenta", "VioletRed", "DeepPink",
+"SteelBlue", "SkyBlue", "Orchid", "LightHotPink", "HotPink",
+"SeaGreen", "SlateGray", "MediumGrey", "Burlywood", "LightPink",
+"SpringGreen", "Aquamarine", "PaleGreen", "Khaki", "PaleOrange",
+"SpringGreen", "SeaGreen", "PaleGreen", "PaleWhite", "YellowWhite",
+"LightBlue", "Purple", "MediumOrchid", "Magenta", "Magenta",
+"RoyalBlue", "SlateBlue", "MediumOrchid", "Orchid", "Magenta",
+"DeepSkyBlue", "LightSteelBlue", "LightSkyBlue", "Violet", "LightPink",
+"Cyan", "DarkTurquoise", "SkyBlue", "Grey", "Snow",
+"Mint", "Mint", "Aquamarine", "MintCream", "Ivory",
+"Blue", "Blue", "DarkMagenta", "DarkOrchid", "Magenta",
+"SkyBlue", "RoyalBlue", "LightSlateBlue", "MediumOrchid", "Magenta",
+"DodgerBlue", "SteelBlue", "MediumPurple", "PalePurple", "Plum",
+"DeepSkyBlue", "PaleBlue", "LightSkyBlue", "PalePurple", "Thistle",
+"Cyan", "ColdBlue", "PaleTurquoise", "GhostWhite", "White"
 };
 
 void automatname(Material *ma)
@@ -1316,13 +1316,13 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                        break;
                case MA_RAMP_HUE:
                        {
-                               float rH,rS,rV;
-                               float colH,colS,colV;
-                               float tmpr,tmpg,tmpb;
-                               rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
+                               float rH, rS, rV;
+                               float colH, colS, colV;
+                               float tmpr, tmpg, tmpb;
+                               rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
                                if (colS != 0) {
-                                       rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
-                                       hsv_to_rgb( colH , rS, rV, &tmpr, &tmpg, &tmpb);
+                                       rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
+                                       hsv_to_rgb(colH, rS, rV, &tmpr, &tmpg, &tmpb);
                                        r_col[0] = facm*(r_col[0]) + fac*tmpr;
                                        r_col[1] = facm*(r_col[1]) + fac*tmpg;
                                        r_col[2] = facm*(r_col[2]) + fac*tmpb;
@@ -1331,33 +1331,33 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                        break;
                case MA_RAMP_SAT:
                        {
-                               float rH,rS,rV;
-                               float colH,colS,colV;
-                               rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
+                               float rH, rS, rV;
+                               float colH, colS, colV;
+                               rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
                                if (rS != 0) {
-                                       rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
-                                       hsv_to_rgb( rH, (facm*rS +fac*colS), rV, r_col+0, r_col+1, r_col+2);
+                                       rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
+                                       hsv_to_rgb(rH, (facm*rS +fac*colS), rV, r_col+0, r_col+1, r_col+2);
                                }
                        }
                        break;
                case MA_RAMP_VAL:
                        {
-                               float rH,rS,rV;
-                               float colH,colS,colV;
-                               rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
-                               rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
-                               hsv_to_rgb( rH, rS, (facm*rV +fac*colV), r_col+0, r_col+1, r_col+2);
+                               float rH, rS, rV;
+                               float colH, colS, colV;
+                               rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
+                               rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
+                               hsv_to_rgb(rH, rS, (facm*rV +fac*colV), r_col+0, r_col+1, r_col+2);
                        }
                        break;
                case MA_RAMP_COLOR:
                        {
-                               float rH,rS,rV;
-                               float colH,colS,colV;
-                               float tmpr,tmpg,tmpb;
-                               rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
+                               float rH, rS, rV;
+                               float colH, colS, colV;
+                               float tmpr, tmpg, tmpb;
+                               rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
                                if (colS != 0) {
-                                       rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
-                                       hsv_to_rgb( colH, colS, rV, &tmpr, &tmpg, &tmpb);
+                                       rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
+                                       hsv_to_rgb(colH, colS, rV, &tmpr, &tmpg, &tmpb);
                                        r_col[0] = facm*(r_col[0]) + fac*tmpr;
                                        r_col[1] = facm*(r_col[1]) + fac*tmpg;
                                        r_col[2] = facm*(r_col[2]) + fac*tmpb;
index 73e3576..0f2ac2d 100644 (file)
@@ -142,7 +142,7 @@ typedef struct octal_node {
        struct ListBase elems;          /* ListBase of MetaElem pointers (ml_pointer) */
        float x_min, y_min, z_min;      /* 1st border point */
        float x_max, y_max, z_max;      /* 7th border point */
-       float x,y,z;                    /* center of node */
+       float x, y, z;                  /* center of node */
        int pos, neg;                   /* number of positive and negative MetaElements in the node */
        int count;                      /* number of MetaElems, which belongs to the node */
 } octal_node;
@@ -520,7 +520,7 @@ Object *BKE_metaball_basis_find(Scene *scene, Object *basis)
 {
        Scene *sce_iter= scene;
        Base *base;
-       Object *ob,*bob= basis;
+       Object *ob, *bob= basis;
        MetaElem *ml=NULL;
        int basisnr, obnr;
        char basisname[MAX_ID_NAME], obname[MAX_ID_NAME];
@@ -614,10 +614,10 @@ Object *BKE_metaball_basis_find(Scene *scene, Object *basis)
 #define HASHBIT            (5)
 #define HASHSIZE    (size_t)(1<<(3*HASHBIT))   /*! < hash table size (32768) */
 
-#define HASH(i,j,k) ((((( (i) & 31)<<5) | ( (j) & 31))<<5 ) | ( (k) & 31) )
+#define HASH(i, j, k) ((((( (i) & 31)<<5) | ( (j) & 31))<<5 ) | ( (k) & 31) )
 
 #define MB_BIT(i, bit) (((i)>>(bit))&1)
-#define FLIP(i,bit) ((i)^1<<(bit)) /* flip the given bit of i */
+#define FLIP(i, bit) ((i)^1<<(bit)) /* flip the given bit of i */
 
 
 /* **************** POLYGONIZATION ************************ */
@@ -713,13 +713,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
                if (y < node->y) {
                        if (x < node->x) {
                                if (node->nodes[0])
-                                       return find_metaball_octal_node(node->nodes[0],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[0], x, y, z, depth--);
                                else
                                        return node;
                        }
                        else {
                                if (node->nodes[1])
-                                       return find_metaball_octal_node(node->nodes[1],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[1], x, y, z, depth--);
                                else
                                        return node;
                        }
@@ -727,13 +727,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
                else {
                        if (x < node->x) {
                                if (node->nodes[3])
-                                       return find_metaball_octal_node(node->nodes[3],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[3], x, y, z, depth--);
                                else
                                        return node;
                        }
                        else {
                                if (node->nodes[2])
-                                       return find_metaball_octal_node(node->nodes[2],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[2], x, y, z, depth--);
                                else
                                        return node;
                        }               
@@ -743,13 +743,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
                if (y < node->y) {
                        if (x < node->x) {
                                if (node->nodes[4])
-                                       return find_metaball_octal_node(node->nodes[4],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[4], x, y, z, depth--);
                                else
                                        return node;
                        }
                        else {
                                if (node->nodes[5])
-                                       return find_metaball_octal_node(node->nodes[5],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[5], x, y, z, depth--);
                                else
                                        return node;
                        }
@@ -757,13 +757,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
                else {
                        if (x < node->x) {
                                if (node->nodes[7])
-                                       return find_metaball_octal_node(node->nodes[7],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[7], x, y, z, depth--);
                                else
                                        return node;
                        }
                        else {
                                if (node->nodes[6])
-                                       return find_metaball_octal_node(node->nodes[6],x,y,z,depth--);
+                                       return find_metaball_octal_node(node->nodes[6], x, y, z, depth--);
                                else
                                        return node;
                        }               
@@ -919,9 +919,9 @@ static INTLISTS *cubetable[256];
 
 /* edge: LB, LT, LN, LF, RB, RT, RN, RF, BN, BF, TN, TF */
 static int corner1[12]    = {
-       LBN,LTN,LBN,LBF,RBN,RTN,RBN,RBF,LBN,LBF,LTN,LTF};
+       LBN, LTN, LBN, LBF, RBN, RTN, RBN, RBF, LBN, LBF, LTN, LTF};
 static int corner2[12]    = {
-       LBF,LTF,LTN,LTF,RBF,RTF,RTN,RTF,RBN,RBF,RTN,RTF};
+       LBF, LTF, LTN, LTF, RBF, RTF, RTN, RTF, RBN, RBF, RTN, RTF};
 static int leftface[12]           = {
        B,  L,  L,  F,  R,  T,  N,  R,  N,  B,  T,  F};
 /* face on left when going corner1 to corner2 */
@@ -1197,7 +1197,7 @@ void BKE_metaball_cubeTable_free(void)
 
 /**** Storage ****/
 
-/* setcenter: set (i,j,k) entry of table[]
+/* setcenter: set (i, j, k) entry of table[]
  * return 1 if already set; otherwise, set and return 0 */
 
 static int setcenter(CENTERLIST *table[], int i, int j, int k)
@@ -1405,7 +1405,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
        int i = 0;
        MB_POINT pos, neg;
        float positive = 0.0f, negative = 0.0f;
-       float dx = 0.0f ,dy = 0.0f ,dz = 0.0f;
+       float dx = 0.0f, dy = 0.0f, dz = 0.0f;
        
        if (v1 < 0) {
                pos= *p2;
@@ -1453,7 +1453,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
                while (1) {
                        if (i++ == RES) return;
                        p->x = 0.5f*(pos.x + neg.x);
-                       if ((function(p->x,p->y,p->z)) > 0.0f)  pos.x = p->x; else neg.x = p->x;
+                       if ((function(p->x, p->y, p->z)) > 0.0f)        pos.x = p->x; else neg.x = p->x;
                }
        }
 
@@ -1463,7 +1463,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
                while (1) {
                        if (i++ == RES) return;
                        p->y = 0.5f*(pos.y + neg.y);
-                       if ((function(p->x,p->y,p->z)) > 0.0f)  pos.y = p->y; else neg.y = p->y;
+                       if ((function(p->x, p->y, p->z)) > 0.0f)        pos.y = p->y; else neg.y = p->y;
                }
          }
    
@@ -1473,7 +1473,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
                while (1) {
                        if (i++ == RES) return;
                        p->z = 0.5f*(pos.z + neg.z);
-                       if ((function(p->x,p->y,p->z)) > 0.0f)  pos.z = p->z; else neg.z = p->z;
+                       if ((function(p->x, p->y, p->z)) > 0.0f)        pos.z = p->z; else neg.z = p->z;
                }
        }
 
@@ -1523,7 +1523,7 @@ static void add_cube(PROCESS *mbproc, int i, int j, int k, int count)
 
                                        /* set corners of initial cube: */
                                        for (n = 0; n < 8; n++)
-                                       ncube->cube.corners[n] = setcorner(mbproc, a+MB_BIT(n,2), b+MB_BIT(n,1), c+MB_BIT(n,0));
+                                       ncube->cube.corners[n] = setcorner(mbproc, a+MB_BIT(n, 2), b+MB_BIT(n, 1), c+MB_BIT(n, 0));
                                }
                        }
 }
@@ -1534,7 +1534,7 @@ static void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
        MB_POINT IN, in, OUT, out; /*point;*/
        MetaElem *ml;
        int i, j, k, c_i, c_j, c_k;
-       int index[3]={1,0,-1};
+       int index[3]={1, 0, -1};
        float f =0.0f;
        float in_v /*, out_v*/;
        MB_POINT workp;
@@ -1610,7 +1610,7 @@ static void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
                                        ny = abs((out.y - in.y)/mbproc->size);
                                        nz = abs((out.z - in.z)/mbproc->size);
                                        
-                                       MAXN = MAX3(nx,ny,nz);
+                                       MAXN = MAX3(nx, ny, nz);
                                        if (MAXN!=0.0f) {
                                                dx = (out.x - in.x)/MAXN;
                                                dy = (out.y - in.y)/MAXN;
@@ -1774,7 +1774,7 @@ static float init_meta(Scene *scene, Object *ob)  /* return totsize */
                                        if (ml->s > 10.0f) ml->s = 10.0f;
                                        
                                        /* Rotation of MetaElem is stored in quat */
-                                        quat_to_mat4( temp3,ml->quat);
+                                        quat_to_mat4( temp3, ml->quat);
 
                                        /* Translation of MetaElem */
                                        unit_m4(temp2);
@@ -1798,7 +1798,7 @@ static float init_meta(Scene *scene, Object *ob)  /* return totsize */
                                        /* MetaBall transformation */
                                        mult_m4_m4m4(mat, temp2, temp1);
 
-                                       invert_m4_m4(imat,mat);                         
+                                       invert_m4_m4(imat, mat);                                
 
                                        mainb[a]->rad2= ml->rad*ml->rad;
 
@@ -1951,12 +1951,12 @@ static void subdivide_metaball_octal_node(octal_node *node, float size_x, float
 {
        MetaElem *ml;
        ml_pointer *ml_p;
-       float x,y,z;
-       int a,i;
+       float x, y, z;
+       int a, i;
 
        /* create new nodes */
        for (a=0;a<8;a++) {
-               node->nodes[a]= MEM_mallocN(sizeof(octal_node),"octal_node");
+               node->nodes[a]= MEM_mallocN(sizeof(octal_node), "octal_node");
                for (i=0;i<8;i++)
                        node->nodes[a]->nodes[i]= NULL;
                node->nodes[a]->parent= node;
index 12aa623..98cbc95 100644 (file)
@@ -296,7 +296,7 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCag
        }
 
        /* Find the last modifier acting on the cage. */
-       for (i=0; md; i++,md=md->next) {
+       for (i=0; md; i++, md=md->next) {
                ModifierTypeInfo *mti = modifierType_getInfo(md->type);
 
                md->scene= scene;
index d548d75..14db68e 100644 (file)
@@ -462,7 +462,7 @@ MovieClip *BKE_movieclip_file_add(const char *name)
        BLI_path_abs(str, G.main->name);
 
        /* exists? */
-       file = BLI_open(str, O_BINARY|O_RDONLY,0);
+       file = BLI_open(str, O_BINARY | O_RDONLY, 0);
        if (file == -1)
                return NULL;
        close(file);
index d7212e5..f3901ce 100644 (file)
@@ -747,7 +747,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
                copy_v3_v3(origco[i], me->mvert[i].co);
 
        for (i = 0; i < me->totvert; ++i) {
-               float avg_no[3] = {0,0,0}, center[3] = {0,0,0}, push[3];
+               float avg_no[3] = {0, 0, 0}, center[3] = {0, 0, 0}, push[3];
                float dist;
                int tot = 0;
 
@@ -942,7 +942,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm
        MPoly *mpoly = me->mpoly;
        MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
        int *gridOffset;
-       int i, k, /*numGrids,*/ gridSize, dGridSize, dSkip;
+       int i, k, /*numGrids, */ gridSize, dGridSize, dSkip;
        int totloop, totpoly;
        
        /* this happens in the dm made by bmesh_mdisps_space_set */
@@ -1545,9 +1545,9 @@ void multires_free(Multires *mr)
 }
 
 static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const MultiresFace *mface,
-                                        const int totvert, const int totface)
+                                     const int totvert, const int totface)
 {
-       int i,j;
+       int i, j;
        IndexNode *node = NULL;
        
        (*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert face map");
@@ -1566,7 +1566,7 @@ static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const Mult
 static void create_old_vert_edge_map(ListBase **map, IndexNode **mem, const MultiresEdge *medge,
                                         const int totvert, const int totedge)
 {
-       int i,j;
+       int i, j;
        IndexNode *node = NULL;
        
        (*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert edge map");
@@ -2043,7 +2043,7 @@ static void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3])
        /* MLoop *mloop = me->mloop; */ /* UNUSED */
        MDisps *mdisps;
        int *gridOffset;
-       int i, /*numGrids,*/ gridSize, dGridSize, dSkip, totvert;
+       int i, /*numGrids, */ gridSize, dGridSize, dSkip, totvert;
        float (*vertCos)[3] = NULL;
        MultiresModifierData *mmd= get_multires_modifier(scene, ob, 1);
        MultiresModifierData high_mmd;
index 23d2f50..24382b3 100644 (file)
@@ -86,8 +86,8 @@ float distPointToSegmentSq(const float* point, const float* a, const float* b)
        float abx[3], dx[3];
        float d, t;
 
-       sub_v3_v3v3(abx, b,a);
-       sub_v3_v3v3(dx, point,a);
+       sub_v3_v3v3(abx, b, a);
+       sub_v3_v3v3(dx, point, a);
 
        d = abx[0]*abx[0]+abx[2]*abx[2];
        t = abx[0]*dx[0]+abx[2]*dx[2];
@@ -447,7 +447,7 @@ int buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int *vertsPerPoly,
        }
 
        res = buildNavMeshData(*nverts, *verts, ntris, tris, recastData, *trisToFacesMap,
-               ndtris, dtris, npolys, dmeshes,polys, vertsPerPoly, 
+               ndtris, dtris, npolys, dmeshes, polys, vertsPerPoly,
                dtrisToPolysMap, dtrisToTrisMap);
        if (!res) {
                printf("Converting navmesh: Error! Can't get vertices and indices from mesh\n");
index 2fb3f81..b2a85ad 100644 (file)
@@ -141,8 +141,8 @@ void ntreeInitTypes(bNodeTree *ntree)
                        /* needed info if the pynode script fails now: */
                        node->storage= ntree;
                        if (node->id!=NULL) { /* not an empty script node */
-                               node->custom1= 0;
-                               node->custom1= BSET(node->custom1,NODE_DYNAMIC_ADDEXIST);
+                               node->custom1 = 0;
+                               node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ADDEXIST);
                        }
 //                     if (node->typeinfo)
 //                             node->typeinfo->initfunc(node);