style cleanup: also rename bmesh_decimate.c --> bmesh_decimate_collapse.c
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Oct 2012 03:38:26 +0000 (03:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Oct 2012 03:38:26 +0000 (03:38 +0000)
34 files changed:
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/string_utf8.c
source/blender/bmesh/CMakeLists.txt
source/blender/bmesh/intern/bmesh_decimate.h
source/blender/bmesh/intern/bmesh_decimate_collapse.c [moved from source/blender/bmesh/intern/bmesh_decimate.c with 99% similarity]
source/blender/bmesh/intern/bmesh_mods.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/makesrna/intern/rna_access.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/nodes/intern/node_socket.c
source/blender/render/intern/source/rayshade.c

index 9eae8c44776da060f4f5be7270f477fa419c2aa1..84691362a934999318a7dcdabcb018ca4c1b295a 100644 (file)
@@ -2428,7 +2428,7 @@ static int GetNumVertsOfFace(const SMikkTSpaceContext *pContext, const int face_
 
 static void GetPosition(const SMikkTSpaceContext *pContext, float fPos[], const int face_num, const int vert_index)
 {
-       //assert(vert_index>=0 && vert_index<4);
+       //assert(vert_index >= 0 && vert_index < 4);
        SGLSLMeshToTangent *pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
        const float *co = pMesh->mvert[(&pMesh->mface[face_num].v1)[vert_index]].co;
        copy_v3_v3(fPos, co);
@@ -2436,7 +2436,7 @@ static void GetPosition(const SMikkTSpaceContext *pContext, float fPos[], const
 
 static void GetTextureCoordinate(const SMikkTSpaceContext *pContext, float fUV[], const int face_num, const int vert_index)
 {
-       //assert(vert_index>=0 && vert_index<4);
+       //assert(vert_index >= 0 && vert_index < 4);
        SGLSLMeshToTangent *pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
 
        if (pMesh->mtface != NULL) {
@@ -2451,7 +2451,7 @@ static void GetTextureCoordinate(const SMikkTSpaceContext *pContext, float fUV[]
 
 static void GetNormal(const SMikkTSpaceContext *pContext, float fNorm[], const int face_num, const int vert_index)
 {
-       //assert(vert_index>=0 && vert_index<4);
+       //assert(vert_index >= 0 && vert_index < 4);
        SGLSLMeshToTangent *pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
 
        const int smoothnormal = (pMesh->mface[face_num].flag & ME_SMOOTH);
@@ -2481,7 +2481,7 @@ static void GetNormal(const SMikkTSpaceContext *pContext, float fNorm[], const i
 }
 static void SetTSpace(const SMikkTSpaceContext *pContext, const float fvTangent[], const float fSign, const int face_num, const int iVert)
 {
-       //assert(vert_index>=0 && vert_index<4);
+       //assert(vert_index >= 0 && vert_index < 4);
        SGLSLMeshToTangent *pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
        float *pRes = pMesh->tangent[4 * face_num + iVert];
        copy_v3_v3(pRes, fvTangent);
index 9be599ac66c32cd6d429f5cbed15fe2774965b55..efc9869c5ca9689087b1997fed4c4085bb5582d3 100644 (file)
@@ -41,7 +41,7 @@
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_object_fluidsim.h"
-#include "DNA_object_force.h" // for pointcache 
+#include "DNA_object_force.h" // for pointcache
 #include "DNA_object_types.h"
 #include "DNA_particle_types.h"
 #include "DNA_scene_types.h" // N_T
 //-------------------------------------------------------------------------------
 
 void initElbeemMesh(struct Scene *scene, struct Object *ob,
-                       int *numVertices, float **vertices,
-         int *numTriangles, int **triangles,
-         int useGlobalCoords, int modifierIndex)
+                    int *numVertices, float **vertices,
+                    int *numTriangles, int **triangles,
+                    int useGlobalCoords, int modifierIndex)
 {
        DerivedMesh *dm = NULL;
        MVert *mvert;
        MFace *mface;
-       int countTris=0, i, totvert, totface;
+       int countTris = 0, i, totvert, totface;
        float *verts;
        int *tris;
 
@@ -87,35 +87,35 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob,
        totface = dm->getNumTessFaces(dm);
 
        *numVertices = totvert;
-       verts = MEM_callocN(totvert*3*sizeof(float), "elbeemmesh_vertices");
-       for (i=0; i<totvert; i++) {
-               copy_v3_v3(&verts[i*3], mvert[i].co);
-               if (useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i*3]); }
+       verts = MEM_callocN(totvert * 3 * sizeof(float), "elbeemmesh_vertices");
+       for (i = 0; i < totvert; i++) {
+               copy_v3_v3(&verts[i * 3], mvert[i].co);
+               if (useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i * 3]); }
        }
        *vertices = verts;
 
-       for (i=0; i<totface; i++) {
+       for (i = 0; i < totface; i++) {
                countTris++;
                if (mface[i].v4) { countTris++; }
        }
        *numTriangles = countTris;
-       tris = MEM_callocN(countTris*3*sizeof(int), "elbeemmesh_triangles");
+       tris = MEM_callocN(countTris * 3 * sizeof(int), "elbeemmesh_triangles");
        countTris = 0;
-       for (i=0; i<totface; i++) {
+       for (i = 0; i < totface; i++) {
                int face[4];
                face[0] = mface[i].v1;
                face[1] = mface[i].v2;
                face[2] = mface[i].v3;
                face[3] = mface[i].v4;
 
-               tris[countTris*3+0] = face[0];
-               tris[countTris*3+1] = face[1];
-               tris[countTris*3+2] = face[2];
+               tris[countTris * 3 + 0] = face[0];
+               tris[countTris * 3 + 1] = face[1];
+               tris[countTris * 3 + 2] = face[2];
                countTris++;
                if (face[3]) {
-                       tris[countTris*3+0] = face[0];
-                       tris[countTris*3+1] = face[2];
-                       tris[countTris*3+2] = face[3];
+                       tris[countTris * 3 + 0] = face[0];
+                       tris[countTris * 3 + 1] = face[2];
+                       tris[countTris * 3 + 2] = face[3];
                        countTris++;
                }
        }
index 4fff8ddf700452045651f132b5f8cefbf7c08aca..1e3ac5c0e35489d9a5abc481e585d712a0782999 100644 (file)
@@ -713,7 +713,7 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, const short do_id_use
                }
 
                node->new_node = NULL;
-               /* nnode= */ nodeCopyNode(newtree, node);   /* sets node->new */
+               /* nnode = */ nodeCopyNode(newtree, node);   /* sets node->new */
                
                /* make sure we don't copy new nodes again! */
                if (node == last)
index c9b923cde32147d6704acffe4a5975fbced48a96..5fe9bfdd4bcc78b0b4ec6a3896bde5c4e0d2f521 100644 (file)
@@ -2377,7 +2377,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
                                }
                        }
                }
-               if (pid->cache->cached_frames && cfra>=sta && cfra<=end)
+               if (pid->cache->cached_frames && cfra >= sta && cfra <= end)
                        pid->cache->cached_frames[cfra-sta] = 0;
                break;
        }
@@ -3378,7 +3378,7 @@ void BKE_ptcache_update_info(PTCacheID *pid)
        if (cache->flag & PTCACHE_EXTERNAL) {
                int cfra = cache->startframe;
 
-               for (; cfra<=cache->endframe; cfra++) {
+               for (; cfra <= cache->endframe; cfra++) {
                        if (BKE_ptcache_id_exist(pid, cfra))
                                totframes++;
                }
@@ -3405,7 +3405,7 @@ void BKE_ptcache_update_info(PTCacheID *pid)
                else {
                        int cfra = cache->startframe;
 
-                       for (; cfra<=cache->endframe; cfra++) {
+                       for (; cfra <= cache->endframe; cfra++) {
                                if (BKE_ptcache_id_exist(pid, cfra))
                                        totframes++;
                        }
index 1b562415da7ecff96f1692541465fee00e691459..d4428be3faf3ea6276e60c956bd19d8e43949a77 100644 (file)
@@ -175,8 +175,8 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL
 
        avi->interlace = 0;
        avi->odd_fields = 0;
-/*  avi->interlace= rd->mode & R_FIELDS; */
-/*  avi->odd_fields= (rd->mode & R_ODDFIELD)?1:0; */
+/*  avi->interlace = rd->mode & R_FIELDS; */
+/*  avi->odd_fields = (rd->mode & R_ODDFIELD) ? 1 : 0; */
        
        printf("Created avi: %s\n", name);
        return 1;
index 844407f9e06bc54030146687a337de4fc74ea3d6..0cae9bab531089a54344a499bcd5c84812af9285 100644 (file)
@@ -135,7 +135,7 @@ int BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFre
                        BLI_mempool_free(gh->entrypool, e);
 
                        /* correct but 'e' isn't used before return */
-                       /* e= n; *//*UNUSED*/
+                       /* e = n; *//*UNUSED*/
                        if (p) p->next = n;
                        else   gh->buckets[hash] = n;
 
@@ -165,7 +165,7 @@ void *BLI_ghash_pop(GHash *gh, void *key, GHashKeyFreeFP keyfreefp)
                        BLI_mempool_free(gh->entrypool, e);
 
                        /* correct but 'e' isn't used before return */
-                       /* e= n; *//*UNUSED*/
+                       /* e = n; *//*UNUSED*/
                        if (p) p->next = n;
                        else   gh->buckets[hash] = n;
 
index 7ae27b83e67c3fef425d901f355f6f60af6b3189..2c5e05197edeeaab8774571ddb502abd329c7681 100644 (file)
@@ -662,7 +662,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf)
                                if (v1 == v2 || v2 == v3) break;
                                /* printf("test verts %x %x %x\n",v1,v2,v3); */
                                miny = minf(v1->xy[1], v3->xy[1]);
-                               /*  miny= minf(v1->xy[1],v3->xy[1]); */
+                               /*  miny = minf(v1->xy[1],v3->xy[1]); */
                                sc1 = sc + 1;
                                test = 0;
 
index 2543a1637b266b12d6d3929cede5ae7bddbedb82..ac2334e7d8eec9dd4dc1b956067a8605468e3219 100644 (file)
@@ -124,15 +124,15 @@ utf8_error:
 
 int BLI_utf8_invalid_strip(char *str, int length)
 {
-       int bad_char, tot= 0;
+       int bad_char, tot = 0;
 
-       while ((bad_char= BLI_utf8_invalid_byte(str, length)) != -1) {
+       while ((bad_char = BLI_utf8_invalid_byte(str, length)) != -1) {
                str += bad_char;
                length -= bad_char;
 
                if (length == 0) {
                        /* last character bad, strip it */
-                       *str= '\0';
+                       *str = '\0';
                        tot++;
                        break;
                }
@@ -166,9 +166,9 @@ static const size_t utf8_skip_data[256] = {
 #define BLI_STR_UTF8_CPY(dst, src, maxncpy)                                   \
        {                                                                         \
                size_t utf8_size;                                                     \
-               while (*src != '\0' && (utf8_size= utf8_skip_data[*src]) < maxncpy) {  \
+               while (*src != '\0' && (utf8_size = utf8_skip_data[*src]) < maxncpy) {\
                        maxncpy -= utf8_size;                                             \
-                       switch (utf8_size) {                                               \
+                       switch (utf8_size) {                                              \
                                case 6: *dst ++ = *src ++;                                    \
                                case 5: *dst ++ = *src ++;                                    \
                                case 4: *dst ++ = *src ++;                                    \
@@ -177,12 +177,12 @@ static const size_t utf8_skip_data[256] = {
                                case 1: *dst ++ = *src ++;                                    \
                        }                                                                 \
                }                                                                     \
-               *dst= '\0';                                                           \
+               *dst = '\0';                                                          \
        } (void)0
 
 char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy)
 {
-       char *dst_r= dst;
+       char *dst_r = dst;
 
        /* note: currently we don't attempt to deal with invalid utf8 chars */
        BLI_STR_UTF8_CPY(dst, src, maxncpy);
@@ -266,15 +266,15 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size
        }
 
        while (*src_c && len < maxcpy) {
-               size_t step= 0;
-               unsigned int unicode= BLI_str_utf8_as_unicode_and_size(src_c, &step);
+               size_t step = 0;
+               unsigned int unicode = BLI_str_utf8_as_unicode_and_size(src_c, &step);
                if (unicode != BLI_UTF8_ERR) {
-                       *dst_w= (wchar_t)unicode;
+                       *dst_w = (wchar_t)unicode;
                        src_c += step;
                }
                else {
                        *dst_w = '?';
-                       src_c= BLI_str_find_next_char_utf8(src_c, NULL);
+                       src_c = BLI_str_find_next_char_utf8(src_c, NULL);
                }
                dst_w++;
                len++;
@@ -397,13 +397,13 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index)
        unsigned char c;
 
        p += *index;
-       c= (unsigned char) *p;
+       c = (unsigned char) *p;
 
        UTF8_COMPUTE (c, mask, len);
        if (len == -1) {
                /* when called with NULL end, result will never be NULL,
                 * checks for a NULL character */
-               char *p_next= BLI_str_find_next_char_utf8(p, NULL);
+               char *p_next = BLI_str_find_next_char_utf8(p, NULL);
                /* will never return the same pointer unless '\0',
                 * eternal loop is prevented */
                *index += (size_t)(p_next - p);
@@ -420,8 +420,8 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index)
         * characters */
        UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
        if (result == BLI_UTF8_ERR) {
-               len= 1;
-               result= *p;
+               len = 1;
+               result = *p;
        }
        /* end warning! */
 #else
index 1e56314ab6ef887ea27cdb8d7a6261f4fb04b6b8..3e0985471e11fcd55412e864288b0e248756a5f5 100644 (file)
@@ -64,7 +64,7 @@ set(SRC
        intern/bmesh_construct.h
        intern/bmesh_core.c
        intern/bmesh_core.h
-       intern/bmesh_decimate.c
+       intern/bmesh_decimate_collapse.c
        intern/bmesh_decimate.h
        intern/bmesh_inline.h
        intern/bmesh_interp.c
index 1724bbd16bbb728eaec6cfd86088126919ab4350..7fafb752e1ea5636eae174ca5722ba05181361cf 100644 (file)
@@ -27,6 +27,6 @@
  *  \ingroup bmesh
  */
 
-void BM_mesh_decimate(BMesh *bm, const float factor, float *vweights);
+void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights);
 
 #endif /* __BMESH_DECIMATE_H__ */
similarity index 99%
rename from source/blender/bmesh/intern/bmesh_decimate.c
rename to source/blender/bmesh/intern/bmesh_decimate_collapse.c
index a4be3933a8da1b8de2cc8aebbe5f55193b2fa80c..75fe12a418a8b6959c69a6dae3b5b8cf9d97ee2a 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "bmesh.h"
 #include "bmesh_structure.h"
-#include "bmesh_decimate.h"
+#include "bmesh_decimate.h"  /* own include */
 
 /* defines for testing */
 #define USE_CUSTOMDATA
@@ -112,7 +112,7 @@ static void bm_decim_build_quadrics(BMesh *bm, Quadric *vquadrics)
 static void bm_decim_calc_target_co(BMEdge *e, float optimize_co[3],
                                     const Quadric *vquadrics)
 {
-       /* compute an edge contration target for edge ei
+       /* compute an edge contration target for edge 'e'
         * this is computed by summing it's vertices quadrics and
         * optimizing the result. */
        Quadric q;
@@ -855,7 +855,7 @@ static void bm_decim_edge_collapse(BMesh *bm, BMEdge *e,
  * \param vertex_weights Optional array of vertex  aligned weights [0 - 1],
  *        a vertex group is the usual source for this.
  */
-void BM_mesh_decimate(BMesh *bm, const float factor, float *vweights)
+void BM_mesh_decimate_collapse(BMesh *bm, const float factor, float *vweights)
 {
        Heap *eheap;             /* edge heap */
        HeapNode **eheap_table;  /* edge index aligned table pointing to the eheap */
index 91ca7124fc2ebd4200cef5efae6a4c413ab227fd..a5694ecd92074337f2e4b79fa49e005af2799ae2 100644 (file)
@@ -437,7 +437,7 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[
                        /* bmesh_semv returns in newe the edge going from newv to tv */
                        copy_v3_v3(newv->co, cos[i]);
 
-                       /* interpolate the loop data for the loops with v==newv, using orig face */
+                       /* interpolate the loop data for the loops with (v == newv), using orig face */
                        for (j = 0; j < 2; j++) {
                                BMEdge *e_iter = (j == 0) ? e : newe;
                                BMLoop *l_iter = e_iter->l;
index 9e6301c91f5bff83ec84a8e65175c2b5b352019f..e520a95aa95b4ea8634826ba2bf70d9d62d4d215 100644 (file)
@@ -322,7 +322,7 @@ static void nupdate_abk_bezt(void *node, void *data)
        /* just add the BezTriple to the buffer if there's space, or allocate a new one */
        if (abk->numBezts >= MAX_ABK_BUFSIZE) {
                // TODO: need to allocate new array to cater...
-               //bezts_extra= MEM_callocN(...);
+               //bezts_extra = MEM_callocN(...);
                if (G.debug & G_DEBUG)
                        printf("FIXME: nupdate_abk_bezt() missing case for too many overlapping BezTriples\n");
        }
@@ -582,7 +582,7 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
        }
        
        /* tweak size of keyframe shape according to type of keyframe 
-        * - 'proper' keyframes have key_type=0, so get drawn at full size
+        * - 'proper' keyframes have key_type = 0, so get drawn at full size
         */
        hsize -= 0.5f * key_type;
        
index d18c611166f050145b992990dabb8f532bbfb9f0..beb57b442486c613188fa6ee0fec47780334ac96 100644 (file)
@@ -610,28 +610,28 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
                if (ui_but_equals_old(oldbut, but)) {
                        if (oldbut->active) {
 #if 0
-//                             but->flag= oldbut->flag;
+//                             but->flag = oldbut->flag;
 #else
                                /* exception! redalert flag can't be update from old button. 
                                 * perhaps it should only copy specific flags rather than all. */
-//                             but->flag= (oldbut->flag & ~UI_BUT_REDALERT) | (but->flag & UI_BUT_REDALERT);
+//                             but->flag = (oldbut->flag & ~UI_BUT_REDALERT) | (but->flag & UI_BUT_REDALERT);
 #endif
-//                             but->active= oldbut->active;
-//                             but->pos= oldbut->pos;
-//                             but->ofs= oldbut->ofs;
-//                             but->editstr= oldbut->editstr;
-//                             but->editval= oldbut->editval;
-//                             but->editvec= oldbut->editvec;
-//                             but->editcoba= oldbut->editcoba;
-//                             but->editcumap= oldbut->editcumap;
-//                             but->selsta= oldbut->selsta;
-//                             but->selend= oldbut->selend;
-//                             but->softmin= oldbut->softmin;
-//                             but->softmax= oldbut->softmax;
+//                             but->active = oldbut->active;
+//                             but->pos = oldbut->pos;
+//                             but->ofs = oldbut->ofs;
+//                             but->editstr = oldbut->editstr;
+//                             but->editval = oldbut->editval;
+//                             but->editvec = oldbut->editvec;
+//                             but->editcoba = oldbut->editcoba;
+//                             but->editcumap = oldbut->editcumap;
+//                             but->selsta = oldbut->selsta;
+//                             but->selend = oldbut->selend;
+//                             but->softmin = oldbut->softmin;
+//                             but->softmax = oldbut->softmax;
 //                             but->linkto[0] = oldbut->linkto[0];
 //                             but->linkto[1] = oldbut->linkto[1];
                                found = 1;
-//                             oldbut->active= NULL;
+//                             oldbut->active = NULL;
                        
                                /* move button over from oldblock to new block */
                                BLI_remlink(&oldblock->buttons, oldbut);
@@ -1947,8 +1947,8 @@ void ui_set_but_soft_range(uiBut *but, double value)
                        RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, &imin, &imax, &istep);
                        softmin = (imin == INT_MIN) ? -1e4 : imin;
                        softmax = (imin == INT_MAX) ? 1e4 : imax;
-                       /*step= istep;*/ /*UNUSED*/
-                       /*precision= 1;*/ /*UNUSED*/
+                       /*step = istep;*/ /*UNUSED*/
+                       /*precision = 1;*/ /*UNUSED*/
 
                        if (array_len >= 2) {
                                int value_range[2];
@@ -1964,8 +1964,8 @@ void ui_set_but_soft_range(uiBut *but, double value)
                        RNA_property_float_ui_range(&but->rnapoin, but->rnaprop, &fmin, &fmax, &fstep, &fprecision);
                        softmin = (fmin == -FLT_MAX) ? (float)-1e4 : fmin;
                        softmax = (fmax == FLT_MAX) ? (float)1e4 : fmax;
-                       /*step= fstep;*/ /*UNUSED*/
-                       /*precision= fprecision;*/ /*UNUSED*/
+                       /*step = fstep;*/ /*UNUSED*/
+                       /*precision = fprecision;*/ /*UNUSED*/
 
                        if (array_len >= 2) {
                                float value_range[2];
@@ -2256,7 +2256,7 @@ void ui_check_but(uiBut *but)
        
        
        /* safety is 4 to enable small number buttons (like 'users') */
-       // okwidth= -4 + (BLI_rcti_size_x(&but->rect)); // UNUSED
+       // okwidth = -4 + (BLI_rcti_size_x(&but->rect)); // UNUSED
        
        /* name: */
        switch (but->type) {
@@ -2439,7 +2439,7 @@ static void ui_block_do_align_but(uiBut *first, short nr)
                }
        }
 
-       /* rows==0: 1 row, cols==0: 1 column */
+       /* rows == 0: 1 row, cols == 0: 1 column */
        
        /* note;  how it uses 'flag' in loop below (either set it, or OR it) is confusing */
        for (but = first, prev = NULL; but && but->alignnr == nr; prev = but, but = but->next) {
index ed1a2caab05a9fc8bd1c57d1a8c97ac812b08c3b..445182fb325bf4a69219b349bd814abf1b79e5d7 100644 (file)
@@ -2157,7 +2157,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
        }
 
        /* this makes adjacent blocks auto open from now on */
-       //if (but->block->auto_open ==) but->block->auto_open = 1;
+       //if (but->block->auto_open == 0) but->block->auto_open = 1;
 }
 
 static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
@@ -2961,7 +2961,7 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 
 static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
 {
-       int mx, my /*, click= 0 */;
+       int mx, my /*, click = 0 */;
        int retval = WM_UI_HANDLER_CONTINUE;
        int horizontal = (BLI_rctf_size_x(&but->rect) > BLI_rctf_size_y(&but->rect));
        
@@ -3747,8 +3747,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
 
        zoomx = BLI_rctf_size_x(&but->rect) / BLI_rctf_size_x(&cumap->curr);
        zoomy = BLI_rctf_size_y(&but->rect) / BLI_rctf_size_y(&cumap->curr);
-       /* offsx= cumap->curr.xmin; */
-       /* offsy= cumap->curr.ymin; */
+       /* offsx = cumap->curr.xmin; */
+       /* offsy = cumap->curr.ymin; */
 
        if (snap) {
                float d[2];
@@ -4078,7 +4078,7 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx,
        Scopes *scopes = (Scopes *)but->poin;
        /* rcti rect; */
        int changed = 1;
-       float /* dx, */ dy /* , yfac=1.f */; /* UNUSED */
+       float /* dx, */ dy /* , yfac =1.0f */; /* UNUSED */
 
        /* BLI_rcti_rctf_copy(&rect, &but->rect); */
 
@@ -6027,7 +6027,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
        }
        else {
                retval = ui_do_button(C, block, but, event);
-               // retval= WM_UI_HANDLER_BREAK; XXX why ? 
+               // retval = WM_UI_HANDLER_BREAK; XXX why ?
        }
 
        if (data->state == BUTTON_STATE_EXIT) {
index cf5aed16263f55c224833ee6f87b1656f83855e8..9fac19031de6e17d84b1dbec3529b4cbc216d8e6 100644 (file)
@@ -1708,7 +1708,7 @@ static void ui_litem_layout_row(uiLayout *litem)
        int x, y, w, tot, totw, neww, itemw, minw, itemh, offset;
        int fixedw, freew, fixedx, freex, flag = 0, lastw = 0;
 
-       /* x= litem->x; */ /* UNUSED */
+       /* x = litem->x; */ /* UNUSED */
        y = litem->y;
        w = litem->w;
        totw = 0;
index b9018914633fcaf2074433684c7fd4b8e97a8945..8633a7a9b3802aa46ac180108683cce3ffc85466 100644 (file)
@@ -124,7 +124,6 @@ MetaElem *add_metaball_primitive(bContext *UNUSED(C), Object *obedit, float mat[
 /* Select or deselect all MetaElements */
 static int mball_select_all_exec(bContext *C, wmOperator *op)
 {
-       //Scene *scene= CTX_data_scene(C);
        Object *obedit = CTX_data_edit_object(C);
        MetaBall *mb = (MetaBall *)obedit->data;
        MetaElem *ml;
index ac9c4f7adeefbe32f0503fa2d943b8d3ee689ec0..4aa2e8259543acc11fc2db943bc868968bcc6ee3 100644 (file)
@@ -569,7 +569,7 @@ static void findnearestLattvert__doClosest(void *userData, BPoint *bp, const flo
 
 static BPoint *findnearestLattvert(ViewContext *vc, const int mval[2], int sel)
 {
-       /* sel==1: selected gets a disadvantage */
+       /* (sel == 1): selected gets a disadvantage */
        /* in nurb and bezt or bp the nearest is written */
        /* return 0 1 2: handlepunt */
        struct { BPoint *bp; float dist; int select; float mval_fl[2]; } data = {NULL};
index a52f526448f305e8d7ff396108e5e7f9e5bc0c1b..2511389ebcbcec2aa2361ed728eec34fb13e0b79 100644 (file)
@@ -667,7 +667,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                                 * NOTE: the old (2.4x) method was to set ob->partype = PARSKEL, creating the virtual modifiers
                                 */
                                ob->partype = PAROBJECT; /* note, dna define, not operator property */
-                               //ob->partype= PARSKEL; /* note, dna define, not operator property */
+                               //ob->partype = PARSKEL; /* note, dna define, not operator property */
                                
                                /* BUT, to keep the deforms, we need a modifier, and then we need to set the object that it uses 
                                 * - We need to ensure that the modifier we're adding doesn't already exist, so we check this by
@@ -1260,7 +1260,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
                        base->object->lay = lay;
                        base->object->flag &= ~SELECT;
                        base->flag &= ~SELECT;
-                       /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */
+                       /* if (base->object->type == OB_LAMP) is_lamp = TRUE; */
                }
                CTX_DATA_END;
        }
@@ -1710,7 +1710,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                                break;
                                        case OB_MESH:
                                                ob->data = BKE_mesh_copy(ob->data);
-                                               //me= ob->data;
+                                               //me = ob->data;
                                                //if (me && me->key)
                                                //      ipo_idnew(me->key->ipo);        /* drivers */
                                                break;
index 86a55a9b2784da8ade01c4d81d48809e8f952018..2b6d69ca694a6c6aa3b6d57827bd218af2dd48bf 100644 (file)
@@ -211,7 +211,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob)
                        /* currently editmode isn't supported by mesh so
                         * ignore here for now too */
 
-                       /* if (lt->editlatt) lt= lt->editlatt->latt; */
+                       /* if (lt->editlatt) lt = lt->editlatt->latt; */
 
                        for (w = 0; w < lt->pntsw; w++) {
                                for (v = 0; v < lt->pntsv; v++) {
index 457a77528ce4f1ba9977c5d2f713979120fa09e4..58931d3e3410e0d637e2b54bfc7efcc456fa5620 100644 (file)
@@ -867,7 +867,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 
                                        tot_change++;
                                        arm->id.flag |= LIB_DOIT;
-                                       /* do_inverse_offset= TRUE; */ /* docenter_armature() handles this */
+                                       /* do_inverse_offset = TRUE; */ /* docenter_armature() handles this */
 
                                        BKE_object_where_is_calc(scene, ob);
                                        BKE_pose_where_is(scene, ob); /* needed for bone parents */
index a17d84af128b4976fc7ecfa8b6725b80ff4f6ddf..221aad2161c2746d349616dd01a279127489b11b 100644 (file)
@@ -110,11 +110,14 @@ static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
 
        /* possible this isn't the active object
         * object_remove_particle_system() clears the mode on the last psys
-        * */
-       if (mode_orig & OB_MODE_PARTICLE_EDIT)
-               if ((ob->mode & OB_MODE_PARTICLE_EDIT)==0)
-                       if (scene->basact && scene->basact->object==ob)
+        */
+       if (mode_orig & OB_MODE_PARTICLE_EDIT) {
+               if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) {
+                       if (scene->basact && scene->basact->object == ob) {
                                WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
+                       }
+               }
+       }
 
        WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
        WM_event_add_notifier(C, NC_OBJECT|ND_POINTCACHE, ob);
index 9306ec79966b388fc8d9407e2e298ccdc7bf96ae..88bd4e829f1f6ce1476d74b2bd26fb7234d614bc 100644 (file)
@@ -196,10 +196,10 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
        int i, j;
        int channelSize = paramsize; 
 
-       if (entries==3) {
+       if (entries == 3) {
                elbeemSimplifyChannelVec3(channel, &channelSize);
        }
-       else if (entries==1) {
+       else if (entries == 1) {
                elbeemSimplifyChannelFloat(channel, &channelSize);
        }
        else {
@@ -211,7 +211,7 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
                fprintf(file, "        ");
                for (j=0;j <= entries;j++) {  // also print time value
                        fprintf(file, " %f ", channel[i*(entries + 1) + j]);
-                       if (j==entries-1) { fprintf(file, "  "); }
+                       if (j == entries-1) { fprintf(file, "  "); }
                }
                fprintf(file, "\n");
        }
@@ -627,7 +627,7 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom
                return 0;
        }
        
-       if (channelObjCount>=255) {
+       if (channelObjCount >= 255) {
                BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects");
                return 0;
        }
index 38084773e78e7156d9295ae2345c239980e45a89..63cf0fcaa3159498dc1adec76f66b943f203c34f 100644 (file)
@@ -83,7 +83,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
 
        /* if renrect argument, we only refresh scanlines */
        if (renrect) {
-               /* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */
+               /* if (ymax == recty), rendering of layer is ready, we should not draw, other things happen... */
                if (rr->renlay == NULL || renrect->ymax >= rr->recty)
                        return;
 
index ad93859b84d4b39d25234aa6f541191bee371be3..3cc2f3149605e8f2f946e73fad8d7460e62d055d 100644 (file)
@@ -175,7 +175,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
 
                /* render 3d view */
                if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
-                       /*int is_ortho= scene->r.mode & R_ORTHO;*/
+                       /*int is_ortho = scene->r.mode & R_ORTHO;*/
                        camera = v3d->camera;
                        RE_GetCameraWindow(oglrender->re, camera, scene->r.cfra, winmat);
                        
index 7a349e4a581ecd59bdc788d2eac9f41c8eb1b866..ff53a6b9e922ada16cda77b6c7bcbe7eef974450 100644 (file)
@@ -1453,10 +1453,10 @@ void ED_screen_set_scene(bContext *C, bScreen *screen, Scene *scene)
                        
                        if (scene != sc->scene) {
                                /* all areas endlocalview */
-                               // XXX  ScrArea *sa= sc->areabase.first;
+                               // XXX  ScrArea *sa = sc->areabase.first;
                                //      while (sa) {
                                //              endlocalview(sa);
-                               //              sa= sa->next;
+                               //              sa = sa->next;
                                //      }
                                sc->scene = scene;
                        }
index cf3f2ad741bde32f44eb210d9a3161e99dd31eff..058b8bb482737fe1180ad1b219c8a8b9f0ff5fd6 100644 (file)
@@ -783,7 +783,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
        else {
                //xi = (int)((uv[0]*ibuf->x) + 0.5f);
                //yi = (int)((uv[1]*ibuf->y) + 0.5f);
-               //if (xi<0 || xi>=ibuf->x  ||  yi<0 || yi>=ibuf->y) return 0;
+               //if (xi < 0 || xi >= ibuf->x  ||  yi < 0 || yi >= ibuf->y) return 0;
                
                /* wrap */
                xi = ((int)(uv[0] * ibuf->x)) % ibuf->x;
@@ -903,7 +903,7 @@ static int project_bucket_point_occluded(const ProjPaintState *ps, LinkNode *buc
                        else
                                isect_ret = project_paint_occlude_ptv(pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v2], ps->screenCoords[mf->v3], w, ps->is_ortho);
 
-                       /* Note, if isect_ret==-1 then we don't want to test the other side of the quad */
+                       /* Note, if (isect_ret == -1) then we don't want to test the other side of the quad */
                        if (isect_ret == 0 && mf->v4) {
                                if (do_clip)
                                        isect_ret = project_paint_occlude_ptv_clip(ps, mf, pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v3], ps->screenCoords[mf->v4], 1);
@@ -5285,7 +5285,7 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
 #define PX_SIZE_FADE_MIN 4.0f
 
        Scene *scene = CTX_data_scene(C);
-       //Brush *brush= image_paint_brush(C);
+       //Brush *brush = image_paint_brush(C);
        Paint *paint = paint_get_active_from_context(C);
        Brush *brush = paint_brush(paint);
 
index d37306f9bc50b6c87abde23776af9688867aab7a..f6aad6d9e29fa780681ca88a3f357ca28106f22c 100644 (file)
@@ -113,7 +113,7 @@ static int cut_links_exec(bContext *C, wmOperator *op)
                                         (int)loc[0], (int)loc[1],
                                         &mcoords[i][0], &mcoords[i][1]);
                i++;
-               if (i>= 256) break;
+               if (i >= 256) break;
        }
        RNA_END;
 
index 4b151734dc7a7b56d3426258b5014d42463789c0..9ef7359f5de1370bccb5b90831b281926e4b126f 100644 (file)
@@ -687,8 +687,8 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                ob= ob->id.next;
        }
 
-       if (*count==0) return NULL;
-       if (*count>24) *count= 24;              /* temporal */
+       if (*count == 0) return NULL;
+       if (*count > 24) *count = 24;  /* temporal */
        
        idar= MEM_callocN((*count)*sizeof(void *), "idar");
        
@@ -706,7 +706,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                        idar[nr] = (ID *)ob;
                        nr++;
                }
-               if (nr>=24) break;
+               if (nr >= 24) break;
                ob= ob->id.next;
        }
        
index 4ee522952d4936c3bb46d071132b697228699211..c4ec801d6edb1517bdc111c94caa0e82d7347077 100644 (file)
@@ -62,20 +62,20 @@ ARegion *logic_has_buttons_region(ScrArea *sa)
 {
        ARegion *ar, *arnew;
 
-       ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
+       ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
        if (ar) return ar;
        
        /* add subdiv level; after header */
-       ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+       ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
 
        /* is error! */
-       if (ar==NULL) return NULL;
+       if (ar == NULL) return NULL;
        
        arnew= MEM_callocN(sizeof(ARegion), "buttons for image");
        
        BLI_insertlinkafter(&sa->regionbase, ar, arnew);
-       arnew->regiontype= RGN_TYPE_UI;
-       arnew->alignment= RGN_ALIGN_LEFT;
+       arnew->regiontype = RGN_TYPE_UI;
+       arnew->alignment = RGN_ALIGN_LEFT;
        
        arnew->flag = RGN_FLAG_HIDDEN;
        
index 610895002aa337de6e36b1e105dd56046977fcd0..9be54b9855ffa7d76c75db7c2990f1bc1a01de8e 100644 (file)
@@ -5219,7 +5219,7 @@ static int rna_function_format_array_length(const char *format, int ofs, int fle
                        lenbuf[idx] = format[ofs];
 
        if (ofs < flen && format[ofs + 1] == ']') {
-               /* XXX put better error reporting for ofs>=flen or idx over lenbuf capacity */
+               /* XXX put better error reporting for (ofs >= flen) or idx over lenbuf capacity */
                lenbuf[idx] = '\0';
                return atoi(lenbuf);
        }
index a882e4f5854e807ecd89fca8b713f303c6443216..1cb6853447a3f6a5bbfb3fc49422e977823c9044 100644 (file)
@@ -139,7 +139,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        em = DM_to_editbmesh(dm, NULL, FALSE);
        bm = em->bm;
 
-       BM_mesh_decimate(bm, dmd->percent, vweights);
+       BM_mesh_decimate_collapse(bm, dmd->percent, vweights);
 
        if (vweights) {
                MEM_freeN(vweights);
index 8b393dd740aa5c1665362cdd476e6660895afb42..8e49484d1ebfa9488758ad33d1426bd3102dde54 100644 (file)
@@ -490,39 +490,39 @@ static bNodeSocket *verify_socket_template(bNodeTree *ntree, bNode *node, int in
                        break;
        }
        if (sock) {
-               sock->type= stemp->type;                /* in future, read this from tydefs! */
-               if (stemp->limit==0) sock->limit= 0xFFF;
-               else sock->limit= stemp->limit;
+               sock->type = stemp->type;  /* in future, read this from tydefs! */
+               if (stemp->limit == 0) sock->limit= 0xFFF;
+               else sock->limit = stemp->limit;
                sock->flag |= stemp->flag;
                
                /* Copy the property range and subtype parameters in case the template changed.
                 * NOT copying the actual value here, only button behavior changes!
                 */
                switch (sock->type) {
-               case SOCK_FLOAT:
+                       case SOCK_FLOAT:
                        {
                                bNodeSocketValueFloat *dval= sock->default_value;
                                dval->min = stemp->min;
                                dval->max = stemp->max;
                                dval->subtype = stemp->subtype;
+                               break;
                        }
-                       break;
-               case SOCK_INT:
+                       case SOCK_INT:
                        {
                                bNodeSocketValueInt *dval= sock->default_value;
                                dval->min = stemp->min;
                                dval->max = stemp->max;
                                dval->subtype = stemp->subtype;
+                               break;
                        }
-                       break;
-               case SOCK_VECTOR:
+                       case SOCK_VECTOR:
                        {
                                bNodeSocketValueVector *dval= sock->default_value;
                                dval->min = stemp->min;
                                dval->max = stemp->max;
                                dval->subtype = stemp->subtype;
+                               break;
                        }
-                       break;
                }
                
                BLI_remlink(socklist, sock);
@@ -600,7 +600,9 @@ void node_verify_socket_templates(bNodeTree *ntree, bNode *node)
         * This also prevents group node sockets from being removed, without the need to explicitly
         * check the node type here.
         */
-       if (ntype && ((ntype->inputs && ntype->inputs[0].type>=0) || (ntype->outputs && ntype->outputs[0].type>=0))) {
+       if (ntype && ((ntype->inputs && ntype->inputs[0].type >= 0) ||
+                     (ntype->outputs && ntype->outputs[0].type >= 0)))
+       {
                verify_socket_template_list(ntree, node, SOCK_IN, &node->inputs, ntype->inputs);
                verify_socket_template_list(ntree, node, SOCK_OUT, &node->outputs, ntype->outputs);
        }
index 042803c150ec2e3c9d35858cfa719bfe2ba7a3bf..ed08f5a16fbaf55e2915dd42498af1855c7724d3 100644 (file)
@@ -564,12 +564,12 @@ static int refraction(float refract[3], const float n[3], const float view[3], f
        if (dot>0.0f) {
                index = 1.0f/index;
                fac= 1.0f - (1.0f - dot*dot)*index*index;
-               if (fac<= 0.0f) return 0;
+               if (fac <= 0.0f) return 0;
                fac= -dot*index + sqrtf(fac);
        }
        else {
                fac= 1.0f - (1.0f - dot*dot)*index*index;
-               if (fac<= 0.0f) return 0;
+               if (fac <= 0.0f) return 0;
                fac= -dot*index - sqrtf(fac);
        }