diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py index dbc4509be43..f9f951b6e64 100644 --- a/build_files/cmake/cmake_static_check_cppcheck.py +++ b/build_files/cmake/cmake_static_check_cppcheck.py @@ -49,8 +49,8 @@ def main(): check_commands = [] for c, inc_dirs, defs in source_info: - if not 'bevel' in c: continue - if 'MOD' in c: continue + # if not 'bevel' in c: continue + # if 'MOD' in c: continue cmd = ([CHECKER_BIN] + CHECKER_ARGS + [c] + diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h index 5fd7d5fb704..cca9a176908 100644 --- a/source/blender/bmesh/bmesh.h +++ b/source/blender/bmesh/bmesh.h @@ -39,20 +39,20 @@ extern "C" { /* * short introduction: - * + * * the bmesh structure is a boundary representation, supporting non-manifold * locally modifiable topology. the API is designed to allow clean, maintainable * code, that never (or almost never) directly inspects the underlying structure. - * + * * The API includes iterators, including many useful topological iterators; * walkers, which walk over a mesh, without the risk of hitting the recursion * limit; operators, which are logical, reusable mesh modules; topological * modification functions (like split face, join faces, etc), which are used for * topological manipulations; and some (not yet finished) geometric utility * functions. - * + * * some definitions: - * + * * tool flags: private flags for tools. each operator has it's own private * tool flag "layer", which it can use to flag elements. * tool flags are also used by various other parts of the api. @@ -265,7 +265,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source); /* projects a single loop, target, onto source for customdata interpolation. multires is handled. * if do_vertex is true, target's vert data will also get interpolated.*/ -void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source, +void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source, int do_vertex, int do_multires); /* smoothes boundaries between multires grids, including some borders in adjacent faces */ diff --git a/source/blender/bmesh/bmesh_iterators.h b/source/blender/bmesh/bmesh_iterators.h index ba6d0212de5..e7cdcb4fc68 100644 --- a/source/blender/bmesh/bmesh_iterators.h +++ b/source/blender/bmesh/bmesh_iterators.h @@ -22,9 +22,9 @@ /* * BMESH ITERATORS - * - * The functions and structures in this file - * provide a unified method for iterating over + * + * The functions and structures in this file + * provide a unified method for iterating over * the elements of a mesh and answering simple * adjacency queries. Tool authors should use * the iterators provided in this file instead @@ -58,8 +58,8 @@ #define BM_VERTS_OF_FACE 8 #define BM_EDGES_OF_FACE 9 #define BM_LOOPS_OF_FACE 10 -/* returns elements from all boundaries, and returns - * the first element at the end to flag that we're entering +/* returns elements from all boundaries, and returns + * the first element at the end to flag that we're entering * a different face hole boundary*/ #define BM_ALL_LOOPS_OF_FACE 11 diff --git a/source/blender/bmesh/bmesh_operator_api.h b/source/blender/bmesh/bmesh_operator_api.h index 0f1db930bae..153731d0040 100644 --- a/source/blender/bmesh/bmesh_operator_api.h +++ b/source/blender/bmesh/bmesh_operator_api.h @@ -36,36 +36,36 @@ extern "C" { #include /* for memcpy */ /* - * operators represent logical, executable mesh modules. all topological + * operators represent logical, executable mesh modules. all topological * operations involving a bmesh has to go through them. - * - * operators are nested, as are tool flags, which are private to an operator + * + * operators are nested, as are tool flags, which are private to an operator * when it's executed. tool flags are allocated in layers, one per operator * execution, and are used for all internal flagging a tool needs to do. - * + * * each operator has a series of "slots," which can be of the following types: * - simple numerical types * - arrays of elements (e.g. arrays of faces). * - hash mappings. - * - * each slot is identified by a slot code, as are each operator. - * operators, and their slots, are defined in bmesh_opdefines.c (with their + * + * each slot is identified by a slot code, as are each operator. + * operators, and their slots, are defined in bmesh_opdefines.c (with their * execution functions prototyped in bmesh_operators_private.h), with all their * operator code and slot codes defined in bmesh_operators.h. see * bmesh_opdefines.c and the BMOpDefine struct for how to define new operators. - * + * * in general, operators are fed arrays of elements, created using either * BM_HeaderFlag_To_Slot or BM_Flag_To_Slot (or through one of the format * specifyers in BMO_CallOpf or BMO_InitOpf). Note that multiple element * types (e.g. faces and edges) can be fed to the same slot array. Operators * act on this data, and possibly spit out data into output slots. - * + * * some notes: * - operators should never read from header flags (e.g. element->head.flag). for * example, if you want an operator to only operate on selected faces, you * should use BM_HeaderFlag_To_Slot to put the selected elements into a slot. - * - when you read from an element slot array or mapping, you can either tool-flag - * all the elements in it, or read them using an iterator APi (which is + * - when you read from an element slot array or mapping, you can either tool-flag + * all the elements in it, or read them using an iterator APi (which is * semantically similar to the iterator api in bmesh_iterators.h). */ @@ -73,14 +73,14 @@ struct GHashIterator; /* slot type arrays are terminated by the last member * having a slot type of 0.*/ -#define BMOP_OPSLOT_SENTINEL 0 +#define BMOP_OPSLOT_SENTINEL 0 #define BMOP_OPSLOT_INT 1 #define BMOP_OPSLOT_FLT 2 #define BMOP_OPSLOT_PNT 3 #define BMOP_OPSLOT_MAT 4 #define BMOP_OPSLOT_VEC 7 -/* after BMOP_OPSLOT_VEC, everything is +/* after BMOP_OPSLOT_VEC, everything is * dynamically allocated arrays. we * leave a space in the identifiers @@ -88,8 +88,8 @@ struct GHashIterator; */ //it's very important this remain a power of two #define BMOP_OPSLOT_ELEMENT_BUF 8 -#define BMOP_OPSLOT_MAPPING 9 -#define BMOP_OPSLOT_TYPES 10 +#define BMOP_OPSLOT_MAPPING 9 +#define BMOP_OPSLOT_TYPES 10 /* please ignore all these structures, don't touch them in tool code, except * for when your defining an operator with BMOpDefine.*/ @@ -109,7 +109,7 @@ typedef struct BMOpSlot{ } data; } BMOpSlot; -#define BMOP_MAX_SLOTS 16 /* way more than probably needed */ +#define BMOP_MAX_SLOTS 16 /* way more than probably needed */ #ifdef slots #undef slots @@ -136,7 +136,7 @@ typedef struct BMOpDefine { const char *name; BMOSlotType slottypes[BMOP_MAX_SLOTS]; void (*exec)(BMesh *bm, BMOperator *op); - int flag; + int flag; } BMOpDefine; /*BMOpDefine->flag*/ @@ -157,23 +157,23 @@ typedef struct BMOpDefine { void BMO_Init_Op(struct BMesh *bm, struct BMOperator *op, const char *opname); -/* executes an operator, pushing and popping a new tool flag +/* executes an operator, pushing and popping a new tool flag * layer as appropriate.*/ void BMO_Exec_Op(struct BMesh *bm, struct BMOperator *op); -/* finishes an operator (though note the operator's tool flag is removed +/* finishes an operator (though note the operator's tool flag is removed * after it finishes executing in BMO_Exec_Op).*/ void BMO_Finish_Op(struct BMesh *bm, struct BMOperator *op); -/* tool flag API. never, ever ever should tool code put junk in - * header flags (element->head.flag), nor should they use +/* tool flag API. never, ever ever should tool code put junk in + * header flags (element->head.flag), nor should they use * element->head.eflag1/eflag2. instead, use this api to set * flags. - * + * * if you need to store a value per element, use a * ghash or a mapping slot to do it. */ - + /* flags 15 and 16 (1<<14 and 1<<15) are reserved for bmesh api use */ #define BMO_TestFlag(bm, element, flag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f & (flag)) #define BMO_SetFlag(bm, element, flag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f |= (flag)) @@ -199,7 +199,7 @@ int BMO_CountFlag(struct BMesh *bm, int flag, const char htype); * * the basic format for the format string is: * [operatorname] [slotname]=%[code] [slotname]=%[code] - * + * * as in printf, you pass in one additional argument to the function * for every code. * @@ -248,7 +248,7 @@ BMOpSlot *BMO_GetSlot(struct BMOperator *op, const char *slotname); /* copies the data of a slot from one operator to another. src and dst are the * source/destination slot codes, respectively. */ -void BMO_CopySlot(struct BMOperator *source_op, struct BMOperator *dest_op, +void BMO_CopySlot(struct BMOperator *source_op, struct BMOperator *dest_op, const char *src, const char *dst); /*remove tool flagged elements*/ @@ -320,11 +320,11 @@ int BMO_Vert_CountEdgeFlags(BMesh *bm, BMVert *v, int toolflag); /* inserts a key/value mapping into a mapping slot. note that it copies the * value, it doesn't store a reference to it. */ -//BM_INLINE void BMO_Insert_Mapping(BMesh *bm, BMOperator *op, const char *slotname, +//BM_INLINE void BMO_Insert_Mapping(BMesh *bm, BMOperator *op, const char *slotname, //void *element, void *data, int len); /* inserts a key/float mapping pair into a mapping slot. */ -//BM_INLINE void BMO_Insert_MapFloat(BMesh *bm, BMOperator *op, const char *slotname, +//BM_INLINE void BMO_Insert_MapFloat(BMesh *bm, BMOperator *op, const char *slotname, //void *element, float val); //returns 1 if the specified pointer is in the map. @@ -338,15 +338,15 @@ int BMO_Vert_CountEdgeFlags(BMesh *bm, BMVert *v, int toolflag); /* flags all elements in a mapping. note that the mapping must only have * bmesh elements in it.*/ -void BMO_Mapping_To_Flag(struct BMesh *bm, struct BMOperator *op, - const char *slotname, int flag); +void BMO_Mapping_To_Flag(struct BMesh *bm, struct BMOperator *op, + const char *slotname, int flag); /* pointer versoins of BMO_Get_MapFloat and BMO_Insert_MapFloat. * * do NOT use these for non-operator-api-allocated memory! instead * use BMO_Get_MapData and BMO_Insert_Mapping, which copies the data. */ -//BM_INLINE void BMO_Insert_MapPointer(BMesh *bm, BMOperator *op, const char *slotname, +//BM_INLINE void BMO_Insert_MapPointer(BMesh *bm, BMOperator *op, const char *slotname, //void *key, void *val); //BM_INLINE void *BMO_Get_MapPointer(BMesh *bm, BMOperator *op, const char *slotname, //void *key); @@ -397,7 +397,7 @@ void *BMO_FirstElem(BMOperator *op, const char *slotname); /* restrictmask restricts the iteration to certain element types * (e.g. combination of BM_VERT, BM_EDGE, BM_FACE), if iterating * over an element buffer (not a mapping).*/ -void *BMO_IterNew(BMOIter *iter, BMesh *bm, BMOperator *op, +void *BMO_IterNew(BMOIter *iter, BMesh *bm, BMOperator *op, const char *slotname, const char restrictmask); void *BMO_IterStep(BMOIter *iter); @@ -427,14 +427,14 @@ typedef struct BMOElemMapping { extern const int BMOP_OPSLOT_TYPEINFO[]; -BM_INLINE void BMO_Insert_Mapping(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, +BM_INLINE void BMO_Insert_Mapping(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, void *element, void *data, int len) { BMOElemMapping *mapping; BMOpSlot *slot = BMO_GetSlot(op, slotname); /*sanity check*/ if (slot->slottype != BMOP_OPSLOT_MAPPING) return; - + mapping = (BMOElemMapping *) BLI_memarena_alloc(op->arena, sizeof(*mapping) + len); mapping->element = (BMHeader*) element; @@ -445,23 +445,23 @@ BM_INLINE void BMO_Insert_Mapping(BMesh *UNUSED(bm), BMOperator *op, const char slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh op"); } - + BLI_ghash_insert(slot->data.ghash, element, mapping); } -BM_INLINE void BMO_Insert_MapInt(BMesh *bm, BMOperator *op, const char *slotname, +BM_INLINE void BMO_Insert_MapInt(BMesh *bm, BMOperator *op, const char *slotname, void *element, int val) { BMO_Insert_Mapping(bm, op, slotname, element, &val, sizeof(int)); } -BM_INLINE void BMO_Insert_MapFloat(BMesh *bm, BMOperator *op, const char *slotname, +BM_INLINE void BMO_Insert_MapFloat(BMesh *bm, BMOperator *op, const char *slotname, void *element, float val) { BMO_Insert_Mapping(bm, op, slotname, element, &val, sizeof(float)); } -BM_INLINE void BMO_Insert_MapPointer(BMesh *bm, BMOperator *op, const char *slotname, +BM_INLINE void BMO_Insert_MapPointer(BMesh *bm, BMOperator *op, const char *slotname, void *element, void *val) { BMO_Insert_Mapping(bm, op, slotname, element, &val, sizeof(void*)); @@ -489,7 +489,7 @@ BM_INLINE void *BMO_Get_MapData(BMesh *UNUSED(bm), BMOperator *op, const char *s if (!slot->data.ghash) return NULL; mapping = (BMOElemMapping *) BLI_ghash_lookup(slot->data.ghash, element); - + if (!mapping) return NULL; return mapping + 1; diff --git a/source/blender/bmesh/bmesh_operators.h b/source/blender/bmesh/bmesh_operators.h index 492d1a3fca8..c02540b9d8a 100644 --- a/source/blender/bmesh/bmesh_operators.h +++ b/source/blender/bmesh/bmesh_operators.h @@ -103,9 +103,9 @@ struct Object; struct EditMesh; void BMOP_DupeFromFlag(struct BMesh *bm, int etypeflag, const char hflag); -void BM_esubdivideflag(struct Object *obedit, BMesh *bm, int flag, float smooth, - float fractal, int beauty, int numcuts, int seltype, - int cornertype, int singleedge, int gridfill, int seed); +void BM_esubdivideflag(struct Object *obedit, BMesh *bm, int flag, float smooth, + float fractal, int beauty, int numcuts, int seltype, + int cornertype, int singleedge, int gridfill, int seed); void BM_extrudefaceflag(BMesh *bm, int flag); /* this next one return 1 if they did anything, or zero otherwise. diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index cd1f9629d70..f7d4a149534 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -5,7 +5,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * about this. + * about this. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,7 +34,7 @@ #include "MEM_guardedalloc.h" -#include "BKE_customdata.h" +#include "BKE_customdata.h" #include "BKE_utildefines.h" #include "BLI_array.h" diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index f33a1ef571e..5a24d72fa40 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -36,7 +36,7 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "BKE_customdata.h" +#include "BKE_customdata.h" #include "BKE_utildefines.h" #include "BKE_multires.h" @@ -104,7 +104,7 @@ static void UNUSED_FUNCTION(BM_Data_Vert_Average)(BMesh *UNUSED(bm), BMFace *UNU * * Walks around the faces of an edge and interpolates the per-face-edge * data between two sources to a target. - * + * * Returns - * Nothing */ @@ -136,7 +136,7 @@ void BM_Data_Facevert_Edgeinterp(BMesh *bm, BMVert *v1, BMVert *UNUSED(v2), BMVe return; src[0] = v1loop->head.data; - src[1] = v2loop->head.data; + src[1] = v2loop->head.data; CustomData_bmesh_interp(&bm->ldata, src, w, NULL, 2, vloop->head.data); l = l->radial_next; @@ -144,7 +144,7 @@ void BM_Data_Facevert_Edgeinterp(BMesh *bm, BMVert *v1, BMVert *UNUSED(v2), BMVe } void BM_loops_to_corners(BMesh *bm, Mesh *me, int findex, - BMFace *f, int numTex, int numCol) + BMFace *f, int numTex, int numCol) { BMLoop *l; BMIter iter; @@ -197,7 +197,7 @@ void BM_loops_to_corners(BMesh *bm, Mesh *me, int findex, * * projects target onto source, and pulls interpolated customdata from * source. - * + * * Returns - * Nothing */ @@ -636,11 +636,11 @@ void BM_multires_smooth_bounds(BMesh *bm, BMFace *f) /* * mdisps is a grid of displacements, ordered thus: - * + * * v4/next - * | + * | * | v1/cent-----mid2 ---> x - * | | | + * | | | * | | | * v2/prev---mid1-----v3/cur * | @@ -667,11 +667,11 @@ void BM_multires_smooth_bounds(BMesh *bm, BMFace *f) /* * mdisps is a grid of displacements, ordered thus: - * + * * v4/next - * | + * | * | v1/cent-----mid2 ---> x - * | | | + * | | | * | | | * v2/prev---mid1-----v3/cur * | @@ -725,7 +725,7 @@ void BM_loop_interp_multires(BMesh *bm, BMLoop *target, BMFace *source) bmesh_loop_interp_mdisps(bm, target, source); } -void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source, +void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source, int do_vertex, int do_multires) { BMLoop *l_iter; diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 73c57053d99..11f2217c79e 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -46,9 +46,9 @@ /* * BMESH SELECTMODE FLUSH * - * Makes sure to flush selections + * Makes sure to flush selections * 'upwards' (ie: all verts of an edge - * selects the edge and so on). This + * selects the edge and so on). This * should only be called by system and not * tool authors. * @@ -142,7 +142,7 @@ void BM_SelectMode_Flush(BMesh *bm) /* * BMESH SELECT VERT * - * Changes selection state of a single vertex + * Changes selection state of a single vertex * in a mesh * */ diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index e15f1e7e238..b917aa1ad4f 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -98,7 +98,7 @@ BMesh *BM_Make_Mesh(struct Object *ob, int allocsize[4]) return bm; } -/* +/* * BMESH FREE MESH * * Frees a BMesh structure. @@ -198,7 +198,7 @@ void BM_Clear_Mesh(BMesh *bm) bm->totflags = 1; } -/* +/* * BMESH FREE MESH * * Frees a BMesh structure. @@ -214,7 +214,7 @@ void BM_Free_Mesh(BMesh *bm) * BMESH COMPUTE NORMALS * * Updates the normals of a mesh. - * Note that this can only be called + * Note that this can only be called * */ @@ -426,11 +426,11 @@ static void bmesh_set_mdisps_space(BMesh *bm, int from, int to) } } -/* +/* * BMESH BEGIN/END EDIT * - * Functions for setting up a mesh for editing and cleaning up after - * the editing operations are done. These are called by the tools/operator + * Functions for setting up a mesh for editing and cleaning up after + * the editing operations are done. These are called by the tools/operator * API for each time a tool is executed. */ void bmesh_begin_edit(BMesh *bm, int flag) diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 797c2beb336..df1e9714c75 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -49,19 +49,19 @@ /** * bmesh_dissolve_disk * - * Turns the face region surrounding a manifold vertex into + * Turns the face region surrounding a manifold vertex into * A single polygon. * - * + * * Example: - * + * * |=========| |=========| * | \ / | | | * Before: | V | After: | | * | / \ | | | * |=========| |=========| - * - * + * + * */ #if 1 int BM_Dissolve_Vert(BMesh *bm, BMVert *v) @@ -80,7 +80,7 @@ int BM_Dissolve_Vert(BMesh *bm, BMVert *v) } if (len == 1) { - if (v->e) + if (v->e) BM_Kill_Edge(bm, v->e); BM_Kill_Vert(bm, v); return TRUE; @@ -244,7 +244,7 @@ void BM_Dissolve_Disk(BMesh *bm, BMVert *v) * BM_Join_TwoFaces * * Joins two adjacenct faces togather. - * + * * Because this method calls to BM_Join_Faces to do its work, ff a pair * of faces share multiple edges, the pair of faces will be joined at * every edge (not just edge e). This part of the functionality might need @@ -338,7 +338,7 @@ BMEdge *BM_Connect_Verts(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **nf) * v1 & v2 - vertices which define the split edge, must be different * nl - pointer which will receive the BMLoop for the split edge in the new face * - * Notes: the + * Notes: the * Returns - * Pointer to the newly created face representing one side of the split @@ -532,7 +532,7 @@ BMEdge *BM_Collapse_Vert_Edges(BMesh *bm, BMEdge *ke, BMVert *kv) /** * BM_split_edge - * + * * Splits an edge. v should be one of the vertices in e and * defines the direction of the splitting operation for interpolation * purposes. @@ -550,7 +550,7 @@ BMVert *BM_Split_Edge(BMesh *bm, BMVert *v, BMEdge *e, BMEdge **ne, float percen SmallHash hash; /* we need this for handling multire */ - if (!ne) + if (!ne) ne = &dummy; /* do we have a multires layer */ @@ -570,7 +570,7 @@ BMVert *BM_Split_Edge(BMesh *bm, BMVert *v, BMEdge *e, BMEdge **ne, float percen for (i = 0; i < BLI_array_count(oldfaces); i++) { oldfaces[i] = BM_Copy_Face(bm, oldfaces[i], 1, 1); BLI_smallhash_insert(&hash, (intptr_t)oldfaces[i], NULL); - } + } } v2 = bmesh_edge_getothervert(e, v); @@ -588,7 +588,7 @@ BMVert *BM_Split_Edge(BMesh *bm, BMVert *v, BMEdge *e, BMEdge **ne, float percen } /* v->nv->v2 */ - BM_Data_Facevert_Edgeinterp(bm, v2, v, nv, e, percent); + BM_Data_Facevert_Edgeinterp(bm, v2, v, nv, e, percent); BM_Data_Interp_From_Verts(bm, v, v2, nv, percent); if (CustomData_has_layer(&bm->ldata, CD_MDISPS) && e->l && nv) { @@ -638,7 +638,7 @@ BMVert *BM_Split_Edge(BMesh *bm, BMVert *v, BMEdge *e, BMEdge **ne, float percen } do { - BM_multires_smooth_bounds(bm, l->f); + BM_multires_smooth_bounds(bm, l->f); l = l->radial_next; } while (l != e1->l); } @@ -664,7 +664,7 @@ BMVert *BM_Split_Edge_Multi(BMesh *bm, BMEdge *e, int numcuts) return nv; } -int BM_Validate_Face(BMesh *bm, BMFace *face, FILE *err) +int BM_Validate_Face(BMesh *bm, BMFace *face, FILE *err) { BMIter iter; BLI_array_declare(verts); diff --git a/source/blender/bmesh/intern/bmesh_newcore.c b/source/blender/bmesh/intern/bmesh_newcore.c index 1e50fec0adb..ccb534487a7 100644 --- a/source/blender/bmesh/intern/bmesh_newcore.c +++ b/source/blender/bmesh/intern/bmesh_newcore.c @@ -194,7 +194,7 @@ static BMLoop *BM_Add_FaceBoundary(BMesh *bm, BMFace *f, BMVert *startv, BMEdge l->f = f; - return l; + return l; } BMFace *BM_Copy_Face(BMesh *bm, BMFace *f, int copyedges, int copyverts) @@ -580,7 +580,7 @@ void BM_Kill_Edge(BMesh *bm, BMEdge *e) lnext = l->radial_next; if (lnext->f == l->f) { BM_Kill_Face(bm, l->f); - break; + break; } BM_Kill_Face(bm, l->f); @@ -913,7 +913,7 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface) /* create region fac */ newf = BM_Make_Ngon(bm, v1, v2, edges, tote, 0); if (!newf || BMO_HasError(bm)) { - if (!BMO_HasError(bm)) + if (!BMO_HasError(bm)) err = "Invalid boundary region to join faces"; goto error; } @@ -964,7 +964,7 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface) BM_loop_interp_multires(bm, l_iter, faces[i]); } } while ((l_iter = l_iter->next) != l_first); - } + } /* delete old geometr */ for (i = 0; i < BLI_array_count(deledges); i++) { @@ -1334,14 +1334,14 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **re) * JOIN EDGE KILL VERT: * Takes a an edge and pointer to one of its vertices and collapses * the edge on that vertex. - * + * * Before: OE KE * ------- ------- * | || | * OV KV TV * * - * After: OE + * After: OE * --------------- * | | * OV TV @@ -1375,7 +1375,7 @@ int bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv) if (len == 2) { oe = bmesh_disk_nextedge(ke, kv); tv = bmesh_edge_getothervert(ke, kv); - ov = bmesh_edge_getothervert(oe, kv); + ov = bmesh_edge_getothervert(oe, kv); halt = bmesh_verts_in_edge(kv, tv, oe); /* check for double edge */ if (halt) { @@ -1481,21 +1481,21 @@ int bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv) * bmesh_JFKE * * JOIN FACE KILL EDGE: - * + * * Takes two faces joined by a single 2-manifold edge and fuses them togather. * The edge shared by the faces must not be connected to any other edges which have * Both faces in its radial cycle * * Examples: - * + * * A B * ---------- ---------- - * | | | | + * | | | | * | f1 | | f1 | * v1========v2 = Ok! v1==V2==v3 == Wrong! * | f2 | | f2 | * | | | | - * ---------- ---------- + * ---------- ---------- * * In the example A, faces f1 and f2 are joined by a single edge, and the euler can safely be used. * In example B however, f1 and f2 are joined by multiple edges and will produce an error. The caller diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index eae81ab6954..90ea2907dab 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -61,34 +61,34 @@ /* ok, I'm going to write a little docgen script. so all * bmop comments must conform to the following template/rules: - * + * * template (py quotes used because nested comments don't work * on all C compilers): - * + * * """ * Region Extend. - * + * * paragraph1, Extends bleh bleh bleh. * Bleh Bleh bleh. - * + * * Another paragraph. - * + * * Another paragraph. * """ - * + * * so the first line is the "title" of the bmop. * subsequent line blocks seperated by blank lines - * are paragraphs. individual descriptions of slots + * are paragraphs. individual descriptions of slots * would be extracted from comments * next to them, e.g. - * + * * {BMOP_OPSLOT_ELEMENT_BUF, "geomout"}, //output slot, boundary region - * + * * the doc generator would automatically detect the presence of "output slot" * and flag the slot as an output. the same happens for "input slot". also - * note that "edges", "faces", "verts", "loops", and "geometry" are valid - * substitutions for "slot". - * + * note that "edges", "faces", "verts", "loops", and "geometry" are valid + * substitutions for "slot". + * * note that slots default to being input slots. */ @@ -128,12 +128,12 @@ static BMOpDefine def_righthandfaces = { /* * Region Extend - * + * * used to implement the select more/less tools. * this puts some geometry surrounding regions of * geometry in geom into geomout. - * - * if usefaces is 0 then geomout spits out verts and edges, + * + * if usefaces is 0 then geomout spits out verts and edges, * otherwise it spits out faces. */ static BMOpDefine def_regionextend = { @@ -182,7 +182,7 @@ static BMOpDefine def_reversefaces = { /* * Edge Bisect - * + * * Splits input edges (but doesn't do anything else). * This creates a 2-valence vert. */ @@ -253,7 +253,7 @@ static BMOpDefine def_removedoubles = { /* * Auto Merge - * + * * Finds groups of vertices closer then dist and merges them together, * using the weld verts bmop. The merges must go from a vert not in * verts to one in verts. diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 6746fa8db9a..6ff4386ca75 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -94,7 +94,7 @@ void BMO_Clear_OpFlag(BMesh *UNUSED(bm), BMOperator *op, int flag) /* * BMESH OPSTACK PUSH * - * Pushes the opstack down one level + * Pushes the opstack down one level * and allocates a new flag layer if * appropriate. */ @@ -112,7 +112,7 @@ void BMO_push(BMesh *bm, BMOperator *UNUSED(op)) /* * BMESH OPSTACK POP * - * Pops the opstack one level + * Pops the opstack one level * and frees a flag layer if appropriate * BMESH_TODO: investigate NOT freeing flag * layers. @@ -128,7 +128,7 @@ void BMO_pop(BMesh *bm) /* * BMESH OPSTACK INIT OP * - * Initializes an operator structure + * Initializes an operator structure * to a certain type */ void BMO_Init_Op(BMesh *bm, BMOperator *op, const char *opname) @@ -184,7 +184,7 @@ void BMO_Exec_Op(BMesh *bm, BMOperator *op) if (bm->stackdepth == 2) bmesh_end_edit(bm, op->flag); - BMO_pop(bm); + BMO_pop(bm); } /* @@ -201,7 +201,7 @@ void BMO_Finish_Op(BMesh *bm, BMOperator *op) for (i = 0; opdefines[op->type]->slottypes[i].type; i++) { slot = &op->slots[i]; if (slot->slottype == BMOP_OPSLOT_MAPPING) { - if (slot->data.ghash) + if (slot->data.ghash) BLI_ghash_free(slot->data.ghash, NULL, NULL); } } @@ -230,7 +230,7 @@ int BMO_HasSlot(BMOperator *op, const char *slotname) /* * BMESH OPSTACK GET SLOT * - * Returns a pointer to the slot of + * Returns a pointer to the slot of * type 'slotcode' */ BMOpSlot *BMO_GetSlot(BMOperator *op, const char *slotname) @@ -279,24 +279,21 @@ void BMO_CopySlot(BMOperator *source_op, BMOperator *dest_op, const char *src, c if (!source_slot->data.ghash) return; if (!dest_slot->data.ghash) { - dest_slot->data.ghash = - BLI_ghash_new(BLI_ghashutil_ptrhash, - BLI_ghashutil_ptrcmp, "bmesh operator 2"); + dest_slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash, + BLI_ghashutil_ptrcmp, "bmesh operator 2"); } BLI_ghashIterator_init(&it, source_slot->data.ghash); for ( ; (srcmap = BLI_ghashIterator_getValue(&it)); BLI_ghashIterator_step(&it)) { - dstmap = BLI_memarena_alloc(dest_op->arena, - sizeof(*dstmap) + srcmap->len); + dstmap = BLI_memarena_alloc(dest_op->arena, sizeof(*dstmap) + srcmap->len); dstmap->element = srcmap->element; dstmap->len = srcmap->len; memcpy(dstmap + 1, srcmap + 1, srcmap->len); - BLI_ghash_insert(dest_slot->data.ghash, - dstmap->element, dstmap); + BLI_ghash_insert(dest_slot->data.ghash, dstmap->element, dstmap); } } } @@ -461,7 +458,7 @@ int BMO_CountFlag(BMesh *bm, int flag, const char htype) } } - return count; + return count; } void BMO_Clear_Flag_All(BMesh *bm, BMOperator *UNUSED(op), const char htype, int flag) @@ -538,7 +535,7 @@ void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd) } #endif -void BMO_Mapping_To_Flag(struct BMesh *bm, struct BMOperator *op, +void BMO_Mapping_To_Flag(struct BMesh *bm, struct BMOperator *op, const char *slotname, int flag) { GHashIterator it; @@ -616,7 +613,7 @@ static void BMO_All_To_Slot(BMesh *bm, BMOperator *op, const char *slotname, con /* * BMO_HEADERFLAG_TO_SLOT * - * Copies elements of a certain type, which have a certain header flag set + * Copies elements of a certain type, which have a certain header flag set * into a slot for an operator. */ @@ -669,7 +666,7 @@ void BMO_HeaderFlag_To_Slot(BMesh *bm, BMOperator *op, const char *slotname, * * BMO_FLAG_TO_SLOT * - * Copies elements of a certain type, which have a certain flag set + * Copies elements of a certain type, which have a certain flag set * into an output slot for an operator. */ void BMO_Flag_To_Slot(BMesh *bm, BMOperator *op, const char *slotname, @@ -831,7 +828,7 @@ void BMO_Unflag_Buffer(BMesh *bm, BMOperator *op, const char *slotname, * * ALLOC/FREE FLAG LAYER * - * Used by operator stack to free/allocate + * Used by operator stack to free/allocate * private flag data. This is allocated * using a mempool so the allocation/frees * should be quite fast. @@ -1101,7 +1098,7 @@ typedef struct BMOFlag { int flag; } BMOFlag; -#define PAIR(f) {#f, f}, +#define PAIR(f) {#f, f},fv static const char *bmesh_flags = { PAIR(BM_SELECT); PAIR(BM_SEAM); @@ -1309,26 +1306,30 @@ int BMO_VInitOpf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) ret = 0; stop = 0; while (1) { - switch (NEXT_CHAR(fmt)) { - case 'f': ret |= BM_FACE; break; - case 'e': ret |= BM_EDGE; break; - case 'v': ret |= BM_VERT; break; - default: - stop = 1; + switch (NEXT_CHAR(fmt)) { + case 'f': ret |= BM_FACE; break; + case 'e': ret |= BM_EDGE; break; + case 'v': ret |= BM_VERT; break; + default: + stop = 1; + break; + } + if (stop) { break; + } + + fmt++; } - if (stop) break; - fmt++; + + if (type == 'h') { + BMO_HeaderFlag_To_Slot(bm, op, slotname, va_arg(vlist, int), ret); } - - if (type == 'h') - BMO_HeaderFlag_To_Slot(bm, op, - slotname, va_arg(vlist, int), ret); - else if (type == 'a') + else if (type == 'a') { BMO_All_To_Slot(bm, op, slotname, ret); - else - BMO_Flag_To_Slot(bm, op, slotname, - va_arg(vlist, int), ret); + } + else { + BMO_Flag_To_Slot(bm, op, slotname, va_arg(vlist, int), ret); + } } state = 1; diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index fd9abc233c5..b73a352f8f2 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -105,8 +105,8 @@ static int point_in_triangle(const double v1[2], const double v2[2], const doubl /* * COMPUTE POLY NORMAL * - * Computes the normal of a planar - * polygon See Graphics Gems for + * Computes the normal of a planar + * polygon See Graphics Gems for * computing newell normal. * */ @@ -209,7 +209,7 @@ static int compute_poly_center(float center[3], float *r_area, float (*verts)[3] j = 0; while (j < nverts) { - ai = verts[i][0] * verts[j][1] - verts[j][0] * verts[i][1]; + ai = verts[i][0] * verts[j][1] - verts[j][0] * verts[i][1]; atmp += ai; xtmp += (verts[j][0] + verts[i][0]) * ai; ytmp += (verts[j][1] + verts[i][1]) * ai; @@ -290,7 +290,7 @@ void BM_Compute_Face_CenterMean(BMesh *bm, BMFace *f, float r_cent[3]) /* * COMPUTE POLY PLANE * - * Projects a set polygon's vertices to + * Projects a set polygon's vertices to * a plane defined by the average * of its edges cross products * @@ -337,7 +337,7 @@ void compute_poly_plane(float (*verts)[3], int nverts) v1 = verts[i]; mag = dot_v3v3(v1, avgn); madd_v3_v3fl(v1, avgn, -mag); - } + } } /* @@ -607,13 +607,13 @@ void bmesh_update_face_normal_vertex_cos(BMesh *bm, BMFace *f, float no[3], /* * BMESH FLIP NORMAL - * + * * Reverses the winding of a face. - * Note that this updates the calculated + * Note that this updates the calculated * normal. */ void BM_flip_normal(BMesh *bm, BMFace *f) -{ +{ bmesh_loop_reverse(bm, f); negate_v3(f->no); } @@ -837,10 +837,10 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const i /* * BMESH TRIANGULATE FACE * - * Triangulates a face using a + * Triangulates a face using a * simple 'ear clipping' algorithm * that tries to favor non-skinny - * triangles (angles less than + * triangles (angles less than * 90 degrees). If the triangulator * has bits left over (or cannot * triangulate at all) it uses a @@ -850,7 +850,7 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const i * with a length equal to f->len. it will be filled with the new * triangles, and will be NULL-terminated. */ -void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], +void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], int newedgeflag, int newfaceflag, BMFace **newfaces) { int i, done, nvert, nf_i = 0; diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h index dd51897e002..5d45378ea90 100644 --- a/source/blender/bmesh/intern/bmesh_private.h +++ b/source/blender/bmesh/intern/bmesh_private.h @@ -81,7 +81,7 @@ int bmesh_get_filter_argtype(int type); /* Polygon Utilities ? FIXME... where do these each go? */ /* newedgeflag sets a flag layer flag, obviously not the header flag. */ -void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], +void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], int newedgeflag, int newfaceflag, BMFace **newfaces); void bmesh_update_face_normal(struct BMesh *bm, struct BMFace *f, float no[3], float (*projectverts)[3]); diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index a490ca4b921..9018ab8c14a 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -179,7 +179,7 @@ int BM_Edge_In_Face(BMFace *f, BMEdge *e) /* * BMESH VERTS IN EDGE * - * Returns whether or not two vertices are in + * Returns whether or not two vertices are in * a given edge * */ @@ -233,7 +233,7 @@ int BM_Edge_FaceCount(BMEdge *e) } return count; -} +} /* * BMESH VERT FACECOUNT @@ -318,7 +318,7 @@ int BM_Wire_Edge(BMesh *UNUSED(bm), BMEdge *e) * 2: Joins two distinct regions - (two pyramids joined at the tip) * 3: Is part of a non-manifold edge (edge with more than 2 faces) * 4: Is part of a wire edge - * + * * Returns - * 1 for true, 0 for false. */ @@ -429,7 +429,7 @@ int BM_Boundary_Edge(BMEdge *e) * * BMESH_TODO: * Move this to structure, and wrap. - * + * * Returns - * Integer */ @@ -526,7 +526,7 @@ void BM_Edge_OrderedVerts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2) * * Calculates the angle between two faces. Assumes * That face normals are correct. - * + * * Returns - * Float. */ @@ -552,7 +552,7 @@ float BM_Face_Angle(BMesh *UNUSED(bm), BMEdge *e) * Returns: * 0 for no overlap * 1 for overlap - * + * * */ diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c index de7d2c1d5f8..ca2811adff0 100644 --- a/source/blender/bmesh/intern/bmesh_structure.c +++ b/source/blender/bmesh/intern/bmesh_structure.c @@ -5,7 +5,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * about this. + * about this. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -98,29 +98,29 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * circular linked list, each one is considered to have a 'base' or 'head', * and care must be taken by Euler code when modifying the contents of a cycle. * - * The contents of this file are split into two parts. First there are the - * bmesh_cycle family of functions which are generic circular double linked list - * procedures. The second part contains higher level procedures for supporting + * The contents of this file are split into two parts. First there are the + * bmesh_cycle family of functions which are generic circular double linked list + * procedures. The second part contains higher level procedures for supporting * modification of specific cycle types. * * The three cycles explicitly stored in the BM data structure are as follows: * * 1: The Disk Cycle - A circle of edges around a vertex * Base: vertex->edge pointer. - * - * This cycle is the most complicated in terms of its structure. Each bmesh_Edge contains + * + * This cycle is the most complicated in terms of its structure. Each bmesh_Edge contains * two bmesh_CycleNode structures to keep track of that edge's membership in the disk cycle * of each of its vertices. However for any given vertex it may be the first in some edges * in its disk cycle and the second for others. The bmesh_disk_XXX family of functions contain - * some nice utilities for navigating disk cycles in a way that hides this detail from the + * some nice utilities for navigating disk cycles in a way that hides this detail from the * tool writer. * * Note that the disk cycle is completley independant from face data. One advantage of this - * is that wire edges are fully integrated into the topology database. Another is that the + * is that wire edges are fully integrated into the topology database. Another is that the * the disk cycle has no problems dealing with non-manifold conditions involving faces. * * Functions relating to this cycle: - * + * * bmesh_disk_append_edge * bmesh_disk_remove_edge * bmesh_disk_nextedge @@ -130,33 +130,33 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv) * Base: edge->l->radial structure. * * The radial cycle is similar to the radial cycle in the radial edge data structure.* - * Unlike the radial edge however, the radial cycle does not require a large amount of memory + * Unlike the radial edge however, the radial cycle does not require a large amount of memory * to store non-manifold conditions since BM does not keep track of region/shell * information. - * + * * Functions relating to this cycle: - * + * * bmesh_radial_append * bmesh_radial_remove_loop * bmesh_radial_nextloop * bmesh_radial_find_face - * + * * * 3: The Loop Cycle - A circle of face edges around a polygon. * Base: polygon->lbase. * * The loop cycle keeps track of a faces vertices and edges. It should be noted that the - * direction of a loop cycle is either CW or CCW depending on the face normal, and is - * not oriented to the faces editedges. + * direction of a loop cycle is either CW or CCW depending on the face normal, and is + * not oriented to the faces editedges. * * Functions relating to this cycle: - * + * * bmesh_cycle_XXX family of functions. * - * - * Note that the order of elements in all cycles except the loop cycle is undefined. This - * leads to slightly increased seek time for deriving some adjacency relations, however the - * advantage is that no intrinsic properties of the data structures are dependant upon the + * + * Note that the order of elements in all cycles except the loop cycle is undefined. This + * leads to slightly increased seek time for deriving some adjacency relations, however the + * advantage is that no intrinsic properties of the data structures are dependant upon the * cycle order and all non-manifold conditions are represented trivially. * */ @@ -716,7 +716,7 @@ int bmesh_cycle_validate(int len, void *h) */ BMEdge *bmesh_disk_nextedge(BMEdge *e, BMVert *v) -{ +{ if (bmesh_vert_in_edge(e, v)) { if (e->v1 == v) { return e->d1.next->data; @@ -758,7 +758,7 @@ BMNode *bmesh_disk_getpointer(BMEdge *e, BMVert *v) */ int bmesh_disk_append_edge(BMEdge *e, BMVert *v) -{ +{ BMNode *base, *tail; @@ -816,7 +816,7 @@ void bmesh_disk_remove_edge(BMEdge *e, BMVert *v) /** * bmesh_disk_next_edgeflag * - * Searches the disk cycle of v, starting with e, for the + * Searches the disk cycle of v, starting with e, for the * next edge that has either eflag or tflag. * * bmesh_Edge pointer. @@ -854,7 +854,7 @@ BMEdge *bmesh_disk_next_edgeflag(BMEdge *e, BMVert *v, int eflag, int tflag) /** * bmesh_disk_count_edgeflag * - * Counts number of edges in this verts disk cycle which have + * Counts number of edges in this verts disk cycle which have * either eflag or tflag (but not both!) * * Returns - diff --git a/source/blender/bmesh/intern/bmesh_walkers.c b/source/blender/bmesh/intern/bmesh_walkers.c index 280ac1c1913..681e60a49d4 100644 --- a/source/blender/bmesh/intern/bmesh_walkers.c +++ b/source/blender/bmesh/intern/bmesh_walkers.c @@ -47,20 +47,20 @@ /* - joeedh - * design notes: - * + * * original desing: walkers directly emulation recursive functions. * functions save their state onto a worklist, and also add new states * to implement recursive or looping behaviour. generally only one * state push per call with a specific state is desired. - * + * * basic design pattern: the walker step function goes through it's * list of possible choices for recursion, and recurses (by pushing a new state) * using the first non-visited one. this choise is the flagged as visited using * the ghash. each step may push multiple new states onto the worklist at once. - * + * * - walkers use tool flags, not header flags - * - walkers now use ghash for storing visited elements, - * rather then stealing flags. ghash can be rewritten + * - walkers now use ghash for storing visited elements, + * rather then stealing flags. ghash can be rewritten * to be faster if necassary, in the far future :) . * - tools should ALWAYS have necassary error handling * for if walkers fail. @@ -75,8 +75,8 @@ void *BMW_Begin(BMWalker *walker, void *start) /* * BMW_CREATE - * - * Allocates and returns a new mesh walker of + * + * Allocates and returns a new mesh walker of * a given type. The elements visited are filtered * by the bitmask 'searchmask'. */ @@ -253,7 +253,7 @@ void *BMW_addstate(BMWalker *walker) default: BLI_assert(0); break; - } + } return newstate; } diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c index 960f193f8f0..1428c863a56 100644 --- a/source/blender/bmesh/intern/bmesh_walkers_impl.c +++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c @@ -45,13 +45,13 @@ /* Shell Walker: * - * Starts at a vertex on the mesh and walks over the 'shell' it belongs + * Starts at a vertex on the mesh and walks over the 'shell' it belongs * to via visiting connected edges. * * TODO: * * Add restriction flag/callback for wire edges. - * + * */ static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e) @@ -150,7 +150,7 @@ static void *shellWalker_step(BMWalker *walker) /* find the next edge whose other vertex has not been visite */ curedge = shellWalk.curedge; do { - if (!BLI_ghash_haskey(walker->visithash, curedge)) { + if (!BLI_ghash_haskey(walker->visithash, curedge)) { if (!walker->restrictflag || (walker->restrictflag && BMO_TestFlag(walker->bm, curedge, walker->restrictflag))) { @@ -178,7 +178,7 @@ static void *shellWalker_step(BMWalker *walker) /* Connected Vertex Walker: * * Similar to shell walker, but visits vertices instead of edges. - * + * */ static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v) @@ -240,7 +240,7 @@ static void *connectedVertexWalker_step(BMWalker *walker) * TODO: * * Add restriction flag/callback for wire edges. - * + * */ static void islandboundWalker_begin(BMWalker *walker, void *data) @@ -323,7 +323,7 @@ static void *islandboundWalker_step(BMWalker *walker) //if (!BMO_TestFlag(walker->bm, l->f, walker->restrictflag)) // iwalk->curloop = l->radial_next; iwalk->curloop = l; //else iwalk->curloop = l; - iwalk->lastv = v; + iwalk->lastv = v; return owalk.curloop; } @@ -336,7 +336,7 @@ static void *islandboundWalker_step(BMWalker *walker) * TODO: * * Add restriction flag/callback for wire edges. - * + * */ static void islandWalker_begin(BMWalker *walker, void *data) @@ -532,7 +532,7 @@ static void *loopWalker_step(BMWalker *walker) * Starts at a tool-flagged face and walks over the face loop * Conditions for starting and stepping the face loop have been * tuned in an attempt to match the face loops built by EditMesh - * + * */ /* Check whether the face loop should includes the face specified @@ -664,7 +664,7 @@ static void *faceloopWalker_step(BMWalker *walker) * Starts at a tool-flagged edge and walks over the edge ring * Conditions for starting and stepping the edge ring have been * tuned in an attempt to match the edge rings built by EditMesh - * + * */ static void edgeringWalker_begin(BMWalker *walker, void *data) diff --git a/source/blender/bmesh/operators/bevel.c b/source/blender/bmesh/operators/bevel.c index abc4cd52198..2e6637ba977 100644 --- a/source/blender/bmesh/operators/bevel.c +++ b/source/blender/bmesh/operators/bevel.c @@ -91,7 +91,7 @@ static void calc_corner_co(BMesh *bm, BMLoop *l, const float fac, float r_co[3], cross_v3_v3v3(no, l_vec_prev, l_vec_next); if (dot_v3v3(no, no) == 0.0f) { - no[0] = no[1] = 0.0f; no[2] = -1.0f; + no[0] = no[1] = 0.0f; no[2] = -1.0f; } is_concave = dot_v3v3(no, up) < 0.0f; @@ -299,7 +299,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) if (!BLI_smallhash_haskey(&hash, (intptr_t)l2->e)) { BLI_array_growone(etags); BM_SetIndex(l2->e, BLI_array_count(etags) - 1); /* set_dirty! */ - BLI_smallhash_insert(&hash, (intptr_t)l2->e, NULL); + BLI_smallhash_insert(&hash, (intptr_t)l2->e, NULL); BMO_SetFlag(bm, l2->e, EDGE_OLD); } } @@ -382,7 +382,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) } else if (BMO_TestFlag(bm, l->v, BEVEL_FLAG)) { tag = tags + BM_GetIndex(l); - tag->newv = ETAG_GET(l->e, l->v); + tag->newv = ETAG_GET(l->e, l->v); if (!tag->newv) { sub_v3_v3v3(co, l->next->v->co, l->v->co); @@ -400,7 +400,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) tag->newv = BM_Make_Vert(bm, co, l->v); ETAG_SET(l->e, l->v, tag->newv); - } + } } else { tag = tags + BM_GetIndex(l); @@ -453,8 +453,9 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) } e = BM_Make_Edge(bm, firstv, lastv, BM_FACE_FIRST_LOOP(faces[i])->e, 1); - if (BM_FACE_FIRST_LOOP(faces[i])->prev->e != e) + if (BM_FACE_FIRST_LOOP(faces[i])->prev->e != e) { BM_Copy_Attributes(bm, bm, BM_FACE_FIRST_LOOP(faces[i])->prev->e, e); + } BLI_array_append(edges, e); f = BM_Make_Ngon(bm, verts[0], verts[1], edges, BLI_array_count(edges), 0); @@ -588,7 +589,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) else { f = NULL; } - } + } } /* fill in holes at vertices */ diff --git a/source/blender/bmesh/operators/bmesh_dupeops.c b/source/blender/bmesh/operators/bmesh_dupeops.c index 46ed7469571..228c19098fa 100644 --- a/source/blender/bmesh/operators/bmesh_dupeops.c +++ b/source/blender/bmesh/operators/bmesh_dupeops.c @@ -52,7 +52,7 @@ static BMVert *copy_vertex(BMesh *source_mesh, BMVert *source_vertex, BMesh *tar target_vertex = BM_Make_Vert(target_mesh, source_vertex->co, NULL); /* Insert new vertex into the vert has */ - BLI_ghash_insert(vhash, source_vertex, target_vertex); + BLI_ghash_insert(vhash, source_vertex, target_vertex); /* Copy attribute */ BM_Copy_Attributes(source_mesh, target_mesh, source_vertex, target_vertex); @@ -106,7 +106,7 @@ static BMEdge *copy_edge(BMOperator *op, BMesh *source_mesh, } /* Insert new edge into the edge hash */ - BLI_ghash_insert(ehash, source_edge, target_edge); + BLI_ghash_insert(ehash, source_edge, target_edge); /* Copy attributes */ BM_Copy_Attributes(source_mesh, target_mesh, source_edge, target_edge); @@ -124,7 +124,7 @@ static BMEdge *copy_edge(BMOperator *op, BMesh *source_mesh, */ static BMFace *copy_face(BMOperator *op, BMesh *source_mesh, - BMFace *source_face, BMesh *target_mesh, + BMFace *source_face, BMesh *target_mesh, BMVert **vtar, BMEdge **edar, GHash *vhash, GHash *ehash) { /* BMVert *target_vert1, *target_vert2; */ /* UNUSED */ @@ -226,9 +226,10 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } } } - - if (iso) + + if (iso) { BMO_Insert_MapPointer(source, op, "isovertmap", v, v2); + } BMO_SetFlag(source, (BMHeader *)v, DUPE_DONE); } @@ -247,7 +248,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) BMO_SetFlag(source, (BMHeader *)e->v2, DUPE_DONE); } /* now copy the actual edg */ - copy_edge(op, source, e, target, vhash, ehash); + copy_edge(op, source, e, target, vhash, ehash); BMO_SetFlag(source, (BMHeader *)e, DUPE_DONE); } } @@ -285,7 +286,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) /* free pointer hashe */ BLI_ghash_free(vhash, NULL, NULL); - BLI_ghash_free(ehash, NULL, NULL); + BLI_ghash_free(ehash, NULL, NULL); BLI_array_free(vtar); /* free vert pointer array */ BLI_array_free(edar); /* free edge pointer array */ @@ -303,7 +304,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) * BMOP_DUPE_FINPUT: Buffer containing pointers to mesh faces to be duplicated * * OUTPUT SLOTS: - * + * * BMOP_DUPE_VORIGINAL: Buffer containing pointers to the original mesh vertices * BMOP_DUPE_EORIGINAL: Buffer containing pointers to the original mesh edges * BMOP_DUPE_FORIGINAL: Buffer containing pointers to the original mesh faces @@ -362,7 +363,7 @@ void BMOP_DupeFromFlag(BMesh *bm, int etypeflag, const char hflag) * BMOP_DUPE_FINPUT: Buffer containing pointers to mesh faces to be split * * OUTPUT SLOTS: - * + * * BMOP_DUPE_VOUTPUT: Buffer containing pointers to the split mesh vertices * BMOP_DUPE_EOUTPUT: Buffer containing pointers to the split mesh edges * BMOP_DUPE_FOUTPUT: Buffer containing pointers to the split mesh faces diff --git a/source/blender/bmesh/operators/connectops.c b/source/blender/bmesh/operators/connectops.c index cfa6d859025..f33dfb01df7 100644 --- a/source/blender/bmesh/operators/connectops.c +++ b/source/blender/bmesh/operators/connectops.c @@ -121,7 +121,7 @@ void connectverts_exec(BMesh *bm, BMOperator *op) BLI_array_free(verts); } -static BMVert *get_outer_vert(BMesh *bm, BMEdge *e) +static BMVert *get_outer_vert(BMesh *bm, BMEdge *e) { BMIter iter; BMEdge *e2; @@ -241,7 +241,7 @@ void bmesh_bridge_loops_exec(BMesh *bm, BMOperator *op) e2 = e3; } while (e3 && e2 != e); - if (v && !e3) { + if (v && !e3) { if (c == 0) { if (BLI_array_count(vv1) && v == vv1[BLI_array_count(vv1) - 1]) { printf("%s: internal state waning *TODO DESCRIPTION!*\n", __func__); @@ -399,12 +399,12 @@ void bmesh_bridge_loops_exec(BMesh *bm, BMOperator *op) SWAP(int, i2, i2next); } - f = BM_Make_Face_QuadTri(bm, - vv1[i1], - vv2[i2], - vv2[i2next], - vv1[i1next], - NULL, 1); + f = BM_Make_Face_QuadTri(bm, + vv1[i1], + vv2[i2], + vv2[i2next], + vv1[i1next], + NULL, 1); if (!f || f->len != 4) { fprintf(stderr, "%s: in bridge! (bmesh internal error)\n", __func__); } diff --git a/source/blender/bmesh/operators/createops.c b/source/blender/bmesh/operators/createops.c index 04bc9be5fab..2b497b624f1 100644 --- a/source/blender/bmesh/operators/createops.c +++ b/source/blender/bmesh/operators/createops.c @@ -149,8 +149,8 @@ static void UNUSED_FUNCTION(rotsys_remove_edge)(struct BMEdge *e, struct BMVert e1->next = e1->prev = NULL; } -static struct BMEdge *rotsys_nextedge(struct BMEdge *e, struct BMVert *v, - EdgeData *edata, VertData *UNUSED(vdata)) +static struct BMEdge *rotsys_nextedge(struct BMEdge *e, struct BMVert *v, + EdgeData *edata, VertData *UNUSED(vdata)) { if (v == e->v1) return edata[BM_GetIndex(e)].dlink1.next; @@ -159,8 +159,8 @@ static struct BMEdge *rotsys_nextedge(struct BMEdge *e, struct BMVert *v, return NULL; } -static BMEdge *rotsys_prevedge(BMEdge *e, BMVert *v, - EdgeData *edata, VertData *UNUSED(vdata)) +static BMEdge *rotsys_prevedge(BMEdge *e, BMVert *v, + EdgeData *edata, VertData *UNUSED(vdata)) { if (v == e->v1) return edata[BM_GetIndex(e)].dlink1.prev; @@ -545,7 +545,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata) SWAP(BMEdge *, edges[(i + totedge - 1) % totedge], edges[(i + 1) % totedge]) SWAP(BMEdge *, edges[i], edges[(i + 1) % totedge]) } - } + } } } @@ -726,8 +726,8 @@ static void edge_free_path(PathBase *pathbase, EPath *path) BLI_mempool_free(pathbase->pathpool, path); } -static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, EdgeData *edata, - VertData *vdata, PathBase *pathbase, int group) +static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, EdgeData *edata, + VertData *vdata, PathBase *pathbase, int group) { BMEdge *e; GHash *gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "createops find shortest path"); @@ -781,7 +781,7 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E continue; v2 = NULL; - while (1) { + while (1) { if (!last->cure) { last->cure = e = vdata[BM_GetIndex(last->v)].e; } @@ -931,7 +931,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op) if (use_restrict) { int i = 0, j = 0, gi = 0; - group = BMO_Get_MapInt(bm, op, "restrict", e); + group = BMO_Get_MapInt(bm, op, "restrict", e); for (i = 0; i < 30; i++) { if (group & (1 << i)) { diff --git a/source/blender/bmesh/operators/dissolveops.c b/source/blender/bmesh/operators/dissolveops.c index 6d2e025ba83..9228d0e8625 100644 --- a/source/blender/bmesh/operators/dissolveops.c +++ b/source/blender/bmesh/operators/dissolveops.c @@ -100,7 +100,7 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op) f2 = BMW_Begin(®walker, f); for ( ; f2; f2 = BMW_Step(®walker)) { BLI_array_append(faces, f2); - } + } BMW_End(®walker); for (i = 0; i < BLI_array_count(faces); i++) { @@ -124,7 +124,7 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op) faces = regions[i]; if (!faces[0]) { - BMO_RaiseError(bm, op, BMERR_DISSOLVEFACES_FAILED, + BMO_RaiseError(bm, op, BMERR_DISSOLVEFACES_FAILED, "Could not find boundary of dissolve region"); goto cleanup; } @@ -134,7 +134,7 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op) f = BM_Join_Faces(bm, faces, tot); if (!f) { - BMO_RaiseError(bm, op, BMERR_DISSOLVEFACES_FAILED, + BMO_RaiseError(bm, op, BMERR_DISSOLVEFACES_FAILED, "Could not create merged face"); goto cleanup; } @@ -429,7 +429,7 @@ void dissolveverts_exec(BMesh *bm, BMOperator *op) //check for duplicate edges l = BMIter_New(&liter, bm, BM_LOOPS_OF_FACE, f); for ( ; l; l = BMIter_Step(&liter)) { - ed[i] = l->e; + ed[i] = l->e; lp[i] = l; vt[i++] = l->v; } diff --git a/source/blender/bmesh/operators/edgesplitop.c b/source/blender/bmesh/operators/edgesplitop.c index c53914fd23b..29bcf34fede 100644 --- a/source/blender/bmesh/operators/edgesplitop.c +++ b/source/blender/bmesh/operators/edgesplitop.c @@ -140,7 +140,7 @@ static void tag_out_edges(BMesh *bm, EdgeTag *etags, BMOperator *UNUSED(op)) int i, ok; ok = 0; - while (ok++ < 100000) { + while (ok++ < 100000) { BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (!BMO_TestFlag(bm, e, EDGE_SEAM)) continue; diff --git a/source/blender/bmesh/operators/extrudeops.c b/source/blender/bmesh/operators/extrudeops.c index 1c4b6b4a4ca..6fd987c98ba 100644 --- a/source/blender/bmesh/operators/extrudeops.c +++ b/source/blender/bmesh/operators/extrudeops.c @@ -255,7 +255,7 @@ void extrude_edge_context_exec(BMesh *bm, BMOperator *op) } if (delorig) { - BMO_InitOpf(bm, &delop, "del geom=%fvef context=%d", + BMO_InitOpf(bm, &delop, "del geom=%fvef context=%d", EXT_DEL, DEL_ONLYTAGGED); } @@ -506,7 +506,7 @@ static void calc_solidify_normals(BMesh *bm) } } copy_v3_v3(v->no, f->no); - } + } } } diff --git a/source/blender/bmesh/operators/join_triangles.c b/source/blender/bmesh/operators/join_triangles.c index 1a67843ba99..fa56c691b02 100644 --- a/source/blender/bmesh/operators/join_triangles.c +++ b/source/blender/bmesh/operators/join_triangles.c @@ -21,7 +21,7 @@ */ #include "MEM_guardedalloc.h" -#include "BKE_customdata.h" +#include "BKE_customdata.h" #include "DNA_listBase.h" #include "DNA_customdata_types.h" #include "DNA_mesh_types.h" @@ -52,7 +52,7 @@ /* * JOIN_TRIANGLES.C * - * utility bmesh operators, e.g. transform, + * utility bmesh operators, e.g. transform, * translate, rotate, scale, etc. * */ @@ -252,7 +252,7 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op) /* flag all edges of all input face */ BMO_ITER(f1, &siter, bm, op, "faces", BM_FACE) { - BMO_SetFlag(bm, f1, FACE_INPUT); + BMO_SetFlag(bm, f1, FACE_INPUT); BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f1) { BMO_SetFlag(bm, l->e, EDGE_MARK); } diff --git a/source/blender/bmesh/operators/mesh_conv.c b/source/blender/bmesh/operators/mesh_conv.c index b435d67d384..9bc63c7074b 100644 --- a/source/blender/bmesh/operators/mesh_conv.c +++ b/source/blender/bmesh/operators/mesh_conv.c @@ -33,7 +33,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "BKE_customdata.h" +#include "BKE_customdata.h" #include "BKE_mesh.h" #include "BKE_global.h" #include "BKE_DerivedMesh.h" @@ -139,8 +139,8 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) keyco = actkey->data; bm->shapenr = ob->shapenr; for (i = 0, block = me->key->block.first; block; block = block->next, i++) { - CustomData_add_layer_named(&bm->vdata, CD_SHAPEKEY, - CD_ASSIGN, NULL, 0, block->name); + CustomData_add_layer_named(&bm->vdata, CD_SHAPEKEY, + CD_ASSIGN, NULL, 0, block->name); j = CustomData_get_layer_index_n(&bm->vdata, CD_SHAPEKEY, i); bm->vdata.layers[j].uid = block->uid; @@ -182,8 +182,8 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) } for (block = me->key->block.first, j = 0; block; block = block->next, j++) { - float *co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, - CD_SHAPEKEY, j); + float *co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, CD_SHAPEKEY, j); + if (co) { copy_v3_v3(co, ((float *)block->data) + 3 * i); } diff --git a/source/blender/bmesh/operators/mirror.c b/source/blender/bmesh/operators/mirror.c index 8ab57630c5f..f1a7fec7023 100644 --- a/source/blender/bmesh/operators/mirror.c +++ b/source/blender/bmesh/operators/mirror.c @@ -31,7 +31,7 @@ #include -#include "BKE_customdata.h" +#include "BKE_customdata.h" #include "BKE_mesh.h" #include "BKE_global.h" #include "BKE_DerivedMesh.h" diff --git a/source/blender/bmesh/operators/removedoubles.c b/source/blender/bmesh/operators/removedoubles.c index 2a275cd8d3d..55ada9bf161 100644 --- a/source/blender/bmesh/operators/removedoubles.c +++ b/source/blender/bmesh/operators/removedoubles.c @@ -74,9 +74,9 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op) #define FACE_MARK 2 #if 0 -int remdoubles_face_overlaps(BMesh *bm, BMVert **varr, - int len, BMFace *exclude, - BMFace **overlapface) +int remdoubles_face_overlaps(BMesh *bm, BMVert **varr, + int len, BMFace *exclude, + BMFace **overlapface) { BMIter vertfaces; BMFace *f; @@ -144,10 +144,12 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) { BM_SetIndex(f, 0); /* set_dirty! */ BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { - if (BMO_TestFlag(bm, l->v, ELE_DEL)) + if (BMO_TestFlag(bm, l->v, ELE_DEL)) { BMO_SetFlag(bm, f, FACE_MARK|ELE_DEL); - if (BMO_TestFlag(bm, l->e, EDGE_COL)) + } + if (BMO_TestFlag(bm, l->e, EDGE_COL)) { BM_SetIndex(f, BM_GetIndex(f) + 1); /* set_dirty! */ + } } } bm->elem_index_dirty |= BM_FACE; @@ -167,10 +169,12 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { v = l->v; v2 = ((BMLoop *)l->next)->v; - if (BMO_TestFlag(bm, v, ELE_DEL)) + if (BMO_TestFlag(bm, v, ELE_DEL)) { v = BMO_Get_MapPointer(bm, op, "targetmap", v); - if (BMO_TestFlag(bm, v2, ELE_DEL)) + } + if (BMO_TestFlag(bm, v2, ELE_DEL)) { v2 = BMO_Get_MapPointer(bm, op, "targetmap", v2); + } e2 = v != v2 ? BM_Edge_Exist(v, v2) : NULL; if (e2) { @@ -198,10 +202,12 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) v = loops[0]->v; v2 = loops[1]->v; - if (BMO_TestFlag(bm, v, ELE_DEL)) + if (BMO_TestFlag(bm, v, ELE_DEL)) { v = BMO_Get_MapPointer(bm, op, "targetmap", v); - if (BMO_TestFlag(bm, v2, ELE_DEL)) + } + if (BMO_TestFlag(bm, v2, ELE_DEL)) { v2 = BMO_Get_MapPointer(bm, op, "targetmap", v2); + } f2 = BM_Make_Ngon(bm, v, v2, edges, a, 1); if (f2 && (f2 != f)) { @@ -252,7 +258,7 @@ void bmesh_pointmerge_facedata_exec(BMesh *bm, BMOperator *op) float fac; int i, tot; - snapv = BMO_IterNew(&siter, bm, op, "snapv", BM_VERT); + snapv = BMO_IterNew(&siter, bm, op, "snapv", BM_VERT); tot = BM_Vert_FaceCount(snapv); if (!tot) @@ -269,7 +275,7 @@ void bmesh_pointmerge_facedata_exec(BMesh *bm, BMOperator *op) int type = bm->ldata.layers[i].type; void *e1, *e2; - e1 = CustomData_bmesh_get_layer_n(&bm->ldata, firstl->head.data, i); + e1 = CustomData_bmesh_get_layer_n(&bm->ldata, firstl->head.data, i); e2 = CustomData_bmesh_get_layer_n(&bm->ldata, l->head.data, i); CustomData_data_multiply(type, e2, fac); @@ -282,8 +288,9 @@ void bmesh_pointmerge_facedata_exec(BMesh *bm, BMOperator *op) BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) { BM_ITER(l, &iter, bm, BM_LOOPS_OF_VERT, v) { - if (l == firstl) + if (l == firstl) { continue; + } CustomData_bmesh_copy_data(&bm->ldata, &bm->ldata, firstl->head.data, &l->head.data); } @@ -310,7 +317,7 @@ void bmesh_vert_average_facedata_exec(BMesh *bm, BMOperator *op) BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) { BM_ITER(l, &iter, bm, BM_LOOPS_OF_VERT, v) { block = CustomData_bmesh_get_layer_n(&bm->ldata, l->head.data, i); - CustomData_data_dominmax(type, block, &min, &max); + CustomData_data_dominmax(type, block, &min, &max); } } @@ -346,7 +353,7 @@ void bmesh_pointmerge_exec(BMesh *bm, BMOperator *op) } else { BMO_Insert_MapPointer(bm, &weldop, "targetmap", v, snapv); - } + } } BMO_Exec_Op(bm, &weldop); @@ -397,7 +404,7 @@ void bmesh_collapse_exec(BMesh *bm, BMOperator *op) copy_v3_v3(edges[i]->v2->co, min); if (edges[i]->v1 != edges[0]->v1) - BMO_Insert_MapPointer(bm, &weldop, "targetmap", edges[i]->v1, edges[0]->v1); + BMO_Insert_MapPointer(bm, &weldop, "targetmap", edges[i]->v1, edges[0]->v1); if (edges[i]->v2 != edges[0]->v1) BMO_Insert_MapPointer(bm, &weldop, "targetmap", edges[i]->v2, edges[0]->v1); } diff --git a/source/blender/bmesh/operators/subdivideop.c b/source/blender/bmesh/operators/subdivideop.c index cb46441ffd3..c1a550bd578 100644 --- a/source/blender/bmesh/operators/subdivideop.c +++ b/source/blender/bmesh/operators/subdivideop.c @@ -275,7 +275,7 @@ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge, co[2] = 0.0f; } } -#endif +#endif return ev; } @@ -288,8 +288,7 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge, float percent, percent2 = 0.0f; if (BMO_TestFlag(bm, edge, EDGE_PERCENT) && totpoint == 1) - percent = BMO_Get_MapFloat(bm, params->op, - "edgepercents", edge); + percent = BMO_Get_MapFloat(bm, params->op, "edgepercents", edge); else { percent = 1.0f / (float)(totpoint + 1-curpoint); percent2 = (float)(curpoint + 1) / (float)(totpoint + 1); @@ -312,8 +311,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par temp.v2 = &ov2; for (i = 0; i < numcuts; i++) { - v = subdivideedgenum(bm, eed, &temp, i, params->numcuts, params, - &newe, vsta, vend); + v = subdivideedgenum(bm, eed, &temp, i, params->numcuts, params, &newe, vsta, vend); BMO_SetFlag(bm, v, SUBD_SPLIT); BMO_SetFlag(bm, eed, SUBD_SPLIT); @@ -388,7 +386,7 @@ static SubDPattern quad_1edge = { * | s s | * v7-v0--v1-v2 */ -static void quad_2edge_split_path(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, +static void quad_2edge_split_path(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, const subdparams *params) { BMFace *nf; @@ -414,7 +412,7 @@ static SubDPattern quad_2edge_path = { * | s s | * v7-v0--v1-v2 */ -static void quad_2edge_split_innervert(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, +static void quad_2edge_split_innervert(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, const subdparams *params) { BMFace *nf; @@ -520,7 +518,7 @@ static SubDPattern quad_3edge = { * first line | | last line * |v10s s s|v3 * v11-v0--v1-v2 - * + * * it goes from bottom up */ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, @@ -1037,7 +1035,9 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op) j = a = 0; for (nl = BMIter_New(&liter, bmesh, BM_LOOPS_OF_FACE, face); - nl; nl = BMIter_Step(&liter)) { + nl; + nl = BMIter_Step(&liter)) + { if (nl->v == facedata[i].start) { a = j + 1; break; @@ -1085,9 +1085,9 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op) /* editmesh-emulating functio */ void BM_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float smooth, - float fractal, int beauty, int numcuts, - int seltype, int cornertype, int singleedge, - int gridfill, int seed) + float fractal, int beauty, int numcuts, + int seltype, int cornertype, int singleedge, + int gridfill, int seed) { BMOperator op; diff --git a/source/blender/bmesh/operators/subdivideop.h b/source/blender/bmesh/operators/subdivideop.h index 3ea59a375bc..a0e2574b09f 100644 --- a/source/blender/bmesh/operators/subdivideop.h +++ b/source/blender/bmesh/operators/subdivideop.h @@ -34,7 +34,7 @@ typedef struct subdparams { float off[3]; } subdparams; -typedef void (*subd_pattern_fill_fp)(BMesh *bm, BMFace *face, BMVert **verts, +typedef void (*subd_pattern_fill_fp)(BMesh *bm, BMFace *face, BMVert **verts, const subdparams *params); /* diff --git a/source/blender/bmesh/operators/triangulateop.c b/source/blender/bmesh/operators/triangulateop.c index c371acdfcbc..42a7708f441 100644 --- a/source/blender/bmesh/operators/triangulateop.c +++ b/source/blender/bmesh/operators/triangulateop.c @@ -65,12 +65,10 @@ void triangulate_exec(BMesh *bm, BMOperator *op) BLI_array_growone(newfaces); } } - - BM_Triangulate_Face(bm, face, projectverts, EDGE_NEW, - FACE_NEW, newfaces); - BMO_Insert_MapPointer(bm, op, "facemap", - face, face); + BM_Triangulate_Face(bm, face, projectverts, EDGE_NEW, FACE_NEW, newfaces); + + BMO_Insert_MapPointer(bm, op, "facemap", face, face); for (i = 0; newfaces[i]; i++) { BMO_Insert_MapPointer(bm, op, "facemap", newfaces[i], face); diff --git a/source/blender/bmesh/operators/utils.c b/source/blender/bmesh/operators/utils.c index a8f1dcc59e9..4ba7ed96324 100644 --- a/source/blender/bmesh/operators/utils.c +++ b/source/blender/bmesh/operators/utils.c @@ -21,7 +21,7 @@ */ #include "MEM_guardedalloc.h" -#include "BKE_customdata.h" +#include "BKE_customdata.h" #include "DNA_listBase.h" #include "DNA_customdata_types.h" #include "DNA_mesh_types.h" @@ -52,7 +52,7 @@ /* * UTILS.C * - * utility bmesh operators, e.g. transform, + * utility bmesh operators, e.g. transform, * translate, rotate, scale, etc. * */ @@ -63,7 +63,7 @@ void bmesh_makevert_exec(BMesh *bm, BMOperator *op) BMO_Get_Vec(op, "co", vec); - BMO_SetFlag(bm, BM_Make_Vert(bm, vec, NULL), 1); + BMO_SetFlag(bm, BM_Make_Vert(bm, vec, NULL), 1); BMO_Flag_To_Slot(bm, op, "newvertout", 1, BM_VERT); } @@ -1256,8 +1256,9 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op) h = BLI_heap_new(); - for (i = 0; i < num_total; i++ ) + for (i = 0; i < num_total; i++) { vert_list[i].hn = BLI_heap_insert(h, vert_list[i].weight, vert_list[i].v); + } while (!BLI_heap_empty(h)) { BMEdge *e; @@ -1280,7 +1281,7 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op) e_weight += len_v3v3(e->v1->co, e->v2->co); else e_weight += 1.0f; - u = ( e->v1 == v ) ? e->v2 : e->v1; + u = (e->v1 == v) ? e->v2 : e->v1; if (e_weight < vert_list[BM_GetIndex(u)].weight) { /* is this path shorter ? */ /* add it if so */ diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 8ab6c21ff12..722e9cd9700 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -737,7 +737,7 @@ static void BME_bevel_add_vweight(BME_TransData_Head *td, BMesh *bm, BMVert *v, if (BMO_TestFlag(bm, v, BME_BEVEL_NONMAN)) return; BMO_SetFlag(bm, v, BME_BEVEL_BEVEL); - if ( (vtd = BME_get_transdata(td, v)) ) { + if ((vtd = BME_get_transdata(td, v))) { if (options & BME_BEVEL_EMIN) { vtd->factor = 1.0; if (vtd->weight < 0 || weight < vtd->weight) {