From ccbed1334382a881671a03e281ebd88d51767697 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 19 Mar 2012 22:21:40 +0000 Subject: [PATCH] Quiet warnings about unused functions and variables. Commented or '#if 0' these functions/variables and marked with 'UNUSED' comment so they can be restored in the future if needed. --- intern/decimation/intern/LOD_QSDecimator.cpp | 6 ++++-- source/blender/bmesh/tools/BME_bevel.c | 7 +++++-- source/blender/editors/armature/reeb.c | 11 +++++++++++ source/blender/editors/interface/interface.c | 3 +++ source/blender/editors/transform/transform.c | 20 ++++++++++---------- source/blender/editors/uvedit/uvedit_ops.c | 8 +++++--- 6 files changed, 38 insertions(+), 17 deletions(-) diff --git a/intern/decimation/intern/LOD_QSDecimator.cpp b/intern/decimation/intern/LOD_QSDecimator.cpp index 381571a41f6..bdcf7950447 100644 --- a/intern/decimation/intern/LOD_QSDecimator.cpp +++ b/intern/decimation/intern/LOD_QSDecimator.cpp @@ -265,8 +265,10 @@ BuildHeap( // load in edge pointers to the heap std::vector & edge_set= m_mesh.EdgeSet(); - std::vector::const_iterator edge_end = edge_set.end(); - std::vector::iterator edge_start = edge_set.begin(); + + // UNUSED + // std::vector::const_iterator edge_end = edge_set.end(); + // std::vector::iterator edge_start = edge_set.begin(); std::vector & heap_vector = m_heap->HeapVector(); diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 8a83cc8a928..aea08f8981a 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -300,6 +300,9 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l, float maxfactor, scale, len, dis, vec1[3], vec2[3], t_up_vec[3]; int is_edge, forward, is_split_vert; + /* ov, vtd2, and is_split_vert are set but UNUSED */ + (void)ov, (void)vtd2, (void)is_split_vert; + if (l == NULL) { /* what you call operator overloading in C :) * I wanted to use the same function for both wire edges and poly loops @@ -646,7 +649,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti static BMLoop *BME_bevel_vert(BMesh *bm, BMLoop *l, float value, int UNUSED(options), float *up_vec, BME_TransData_Head *td) { BMVert *v1, *v2; - BMFace *f; + /* BMFace *f; */ /* UNUSED */ /* get/make the first vert to be used in SFME */ /* may need to split the previous edge */ @@ -659,7 +662,7 @@ static BMLoop *BME_bevel_vert(BMesh *bm, BMLoop *l, float value, int UNUSED(opti l = l->next->next; /* "cut off" this corner */ - f = BM_face_split(bm, l->f, v2, v1, NULL, l->e, FALSE); + /* f = */ BM_face_split(bm, l->f, v2, v1, NULL, l->e, FALSE); return l; } diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 97113109981..bb24a1d8412 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -115,6 +115,7 @@ void flipArcBuckets(ReebArc *arc); /***************************************** UTILS **********************************************/ +#if 0 /* UNUSED */ static VertexData *allocVertexData(EditMesh *em) { VertexData *data; @@ -160,6 +161,8 @@ static void nodeSetData(EditVert *eve, ReebNode *n) ((VertexData*)eve->tmp.p)->n = n; } +#endif + void REEB_freeArc(BArc *barc) { ReebArc *arc = (ReebArc*)barc; @@ -232,6 +235,7 @@ void BIF_flagMultiArcs(ReebGraph *rg, int flag) } } +#if 0 /* UNUSED */ static ReebNode * addNode(ReebGraph *rg, EditVert *eve) { float weight; @@ -300,6 +304,7 @@ static void relinkNodes(ReebGraph *low_rg, ReebGraph *high_rg) } } } +#endif ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node) { @@ -321,6 +326,7 @@ ReebNode *BIF_lowestLevelNode(ReebNode *node) return node; } +#if 0 /* UNUSED */ static ReebArc * copyArc(ReebGraph *rg, ReebArc *arc) { ReebArc *cp_arc; @@ -395,6 +401,7 @@ static ReebGraph * copyReebGraph(ReebGraph *rg, int level) return cp_rg; } +#endif ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node) { @@ -408,6 +415,7 @@ ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node) return multi_rg; } +#if 0 /* UNUSED */ static ReebEdge * copyEdge(ReebEdge *edge) { ReebEdge *newEdge = NULL; @@ -954,6 +962,7 @@ static void calculateGraphLength(ReebGraph *rg) calculateArcLength(arc); } } +#endif /**************************************** SYMMETRY HANDLING ******************************************/ @@ -1160,6 +1169,7 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr /****************************************** SMOOTHING **************************************************/ +#if 0 /* UNUSED */ void postprocessGraph(ReebGraph *rg, char mode) { ReebArc *arc; @@ -3138,6 +3148,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges) return 1; } +#endif /****************************************** BUCKET ITERATOR **************************************************/ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 390ee76dfcc..4f84b05a16f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2837,12 +2837,15 @@ static uiBut *ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType * return but; } + +#if 0 /* UNUSED */ static uiBut *UNUSED_FUNCTION(ui_def_but_operator)(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, const char *tip) { wmOperatorType *ot = WM_operatortype_find(opname, 0); if (str == NULL && ot == NULL) str = opname; return ui_def_but_operator_ptr(block, type, ot, opcontext, str, x1, y1, x2, y2, tip); } +#endif static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index b2f83686b45..e027e0a37f7 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4361,7 +4361,7 @@ static int createSlideVerts(TransInfo *t) BMEditMesh *em = me->edit_btmesh; BMesh *bm = em->bm; BMIter iter, iter2; - BMEdge *e, *e1, *ee, *le; + BMEdge *e, *e1 /*, *ee, *le */ /* UNUSED */; BMVert *v, *v2, *first; BMLoop *l, *l1, *l2; TransDataSlideVert *tempsv; @@ -4373,7 +4373,7 @@ static int createSlideVerts(TransInfo *t) ARegion *ar = t->ar; float projectMat[4][4]; float start[3] = {0.0f, 0.0f, 0.0f}, dir[3], end[3] = {0.0f, 0.0f, 0.0f}; - float vec[3], vec2[3], lastvec[3], size, dis=0.0, z; + float vec[3], vec2[3], lastvec[3] /*, size, dis=0.0, z */ /* UNUSED */; int numsel, i, j; if (!v3d) { @@ -4547,10 +4547,10 @@ static int createSlideVerts(TransInfo *t) sld->totsv = j; /*find mouse vector*/ - dis = z = -1.0f; - size = 50.0; + /* dis = z = -1.0f; */ /* UNUSED */ + /* size = 50.0; */ /* UNUSED */ zero_v3(lastvec); zero_v3(dir); - ee = le = NULL; + /* ee = le = NULL; */ /* UNUSED */ BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(e, BM_ELEM_SELECT)) { BMIter iter2; @@ -4588,8 +4588,8 @@ static int createSlideVerts(TransInfo *t) d = dist_to_line_segment_v2(mval, vec1, vec2); if (dis2 == -1.0f || d < dis2) { dis2 = d; - ee = e2; - size = len_v3v3(vec1, vec2); + /* ee = e2; */ /* UNUSED */ + /* size = len_v3v3(vec1, vec2); */ /* UNUSED */ sub_v3_v3v3(dir, vec1, vec2); } } @@ -4680,7 +4680,7 @@ void projectSVData(TransInfo *t, int final) BMIter liter2; BMFace *copyf, *copyf2; BMLoop *l2; - int sel, hide, do_vdata; + int sel, hide /*, do_vdata */ /* UNUSED */; if (BLI_smallhash_haskey(&visit, (uintptr_t)f)) continue; @@ -4698,12 +4698,12 @@ void projectSVData(TransInfo *t, int final) /*project onto copied projection face*/ BM_ITER(l2, &liter2, em->bm, BM_LOOPS_OF_FACE, f) { copyf = copyf2; - do_vdata = l2->v==tempsv->v; + /* do_vdata = l2->v==tempsv->v; */ /* UNUSED */ if (BM_elem_flag_test(l2->e, BM_ELEM_SELECT) || BM_elem_flag_test(l2->prev->e, BM_ELEM_SELECT)) { BMLoop *l3 = l2; - do_vdata = 1; + /* do_vdata = 1; */ /* UNUSED */ if (!BM_elem_flag_test(l2->e, BM_ELEM_SELECT)) l3 = l3->prev; diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 501aa93cfa6..6722c72f686 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -767,7 +767,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i BMLoop *l; MLoopUV *luv; BMIter iter; - float m[3], v1[3], v2[3], c1, c2, *uv1, *uv2, *uv3; + float m[3], v1[3], v2[3], c1, c2, *uv1, /* *uv2, */ /* UNUSED */ *uv3; int id1, id2, i; id1= (id+efa->len-1)%efa->len; @@ -783,7 +783,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i if (i == id1) uv1 = luv->uv; else if (i == id) - uv2 = luv->uv; + ; /* uv2 = luv->uv; */ /* UNUSED */ else if (i == id2) uv3 = luv->uv; @@ -2005,7 +2005,9 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) else if(flush==-1) EDBM_deselect_flush(em); } } - +#else + (void)flush; /* flush is otherwise UNUSED */ + (void)sync; /* sync is otherwise UNUSED */ #endif DAG_id_tag_update(obedit->data, 0);