code cleanup:

- remove unused vars
- no need to hard code version number for collada.
- cleanup some typos in comments.
- movieclip_calc_length was passing arg which should be unsigned to BLI_stringdec()
This commit is contained in:
Campbell Barton 2012-04-08 07:34:09 +00:00
parent 68daca1cbf
commit c1e475e527
7 changed files with 20 additions and 26 deletions

@ -273,7 +273,7 @@ static void movieclip_calc_length(MovieClip *clip)
}
else if (clip->source == MCLIP_SRC_SEQUENCE) {
int framenr = 1;
short numlen;
unsigned short numlen;
char name[FILE_MAX], head[FILE_MAX], tail[FILE_MAX];
BLI_stringdec(clip->name, head, tail, &numlen);

@ -235,7 +235,7 @@ void BM_face_center_mean_calc(BMesh *UNUSED(bm), BMFace *f, float r_cent[3])
* a plane defined by the average
* of its edges cross products
*/
void compute_poly_plane(float (*verts)[3], int nverts)
void compute_poly_plane(float (*verts)[3], const int nverts)
{
float avgc[3], norm[3], mag, avgn[3];
@ -257,15 +257,9 @@ void compute_poly_plane(float (*verts)[3], int nverts)
add_v3_v3(avgn, norm);
}
/* what was this bit for */
if (is_zero_v3(avgn)) {
avgn[0] = 0.0f;
avgn[1] = 0.0f;
if (UNLIKELY(normalize_v3(avgn) == 0.0f)) {
avgn[2] = 1.0f;
}
else {
normalize_v3(avgn);
}
for (i = 0; i < nverts; i++) {
v1 = verts[i];
@ -511,7 +505,7 @@ static int linecrossesf(const float v1[2], const float v2[2], const float v3[2],
int w1, w2, w3, w4, w5 /*, re */;
float mv1[2], mv2[2], mv3[2], mv4[2];
/* now test windin */
/* now test winding */
w1 = testedgesidef(v1, v3, v2);
w2 = testedgesidef(v2, v4, v1);
w3 = !testedgesidef(v1, v2, v3);
@ -607,8 +601,9 @@ int BM_face_point_inside_test(BMesh *bm, BMFace *f, const float co[3])
return crosses % 2 != 0;
}
static int goodline(float const (*projectverts)[3], BMFace *f, int v1i,
int v2i, int v3i, int UNUSED(nvert))
static int goodline(float const (*projectverts)[3], BMFace *f,
int v1i, int v2i, int v3i,
int UNUSED(nvert))
{
BMLoop *l_iter;
BMLoop *l_first;
@ -684,17 +679,20 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const i
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
do {
isear = 1;
isear = TRUE;
v1 = l_iter->prev->v;
v2 = l_iter->v;
v3 = l_iter->next->v;
if (BM_edge_exists(v1, v3)) {
isear = 0;
isear = FALSE;
}
else if (!goodline((float const (*)[3])verts, f, BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3), nvert)) {
isear = 0;
else if (!goodline((float const (*)[3])verts, f,
BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3),
nvert))
{
isear = FALSE;
}
if (isear) {

@ -65,7 +65,7 @@ int bmesh_disk_count(BMVert *v);
#define BM_ELEM_API_FLAG_DISABLE(element, f) ((element)->oflags[0].pflag &= ~(f))
#define BM_ELEM_API_FLAG_TEST(element, f) ((element)->oflags[0].pflag & (f))
void compute_poly_plane(float (*verts)[3], int nverts);
void compute_poly_plane(float (*verts)[3], const int nverts);
void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nverts);
/* include the rest of our private declarations */

@ -83,7 +83,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
* (this is somewhat outdate, though bits of its API are still used) - joeedh
*
* Cycles are circular doubly linked lists that form the basis of adjacency
* information in the BME modeller. Full adjacency relations can be derived
* information in the BME modeler. Full adjacency relations can be derived
* from examining these cycles very quickly. Although each cycle is a double
* 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.
@ -100,7 +100,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
* Base: vertex->edge pointer.
*
* 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
* two bmesh_CycleNode structures to keep track of that edges 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

@ -48,7 +48,6 @@ void bmo_vert_slide_exec(BMesh *bm, BMOperator *op)
BMVert *vertex;
BMEdge *edge;
BMEdge *slide_edge;
int is_start_v1 = 0;
/* Selection counts */
int selected_edges = 0;

@ -217,13 +217,13 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
else {
asset.getContributor().mAuthor = "Blender User";
}
#ifdef WITH_BUILDINFO
char version_buf[128];
#ifdef WITH_BUILDINFO
sprintf(version_buf, "Blender %d.%02d.%d r%s", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION, build_rev);
asset.getContributor().mAuthoringTool = version_buf;
#else
asset.getContributor().mAuthoringTool = "Blender 2.6x";
sprintf(version_buf, "Blender %d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
#endif
asset.getContributor().mAuthoringTool = version_buf;
asset.add();
// <library_cameras>

@ -365,9 +365,6 @@ static void vtx_slide_find_edge(VertexSlideOp *vso, wmEvent *event)
/* Nearest edge */
BMEdge *nst_edge = NULL;
/* Temp Vtx */
BMVert *start_vtx = vso->start_vtx;
const float mval_float[] = { (float)event->mval[0], (float)event->mval[1]};
/* Set mouse coords */