fixed 4 uses of un-inirialized vars + some compiler warnings.

This commit is contained in:
Campbell Barton
2011-05-10 23:48:09 +00:00
parent a7b07ca584
commit bcdd9d236c
13 changed files with 36 additions and 20 deletions

View File

@@ -2215,6 +2215,9 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
t = BM_LOOPS_OF_FACE; break;
case BM_FACE:
t = BM_FACES_OF_MESH; break;
default: /* should never happen */
BLI_assert(!"invalid type given");
t = BM_VERTS_OF_MESH;
}
if (t != BM_LOOPS_OF_FACE) {

View File

@@ -236,7 +236,7 @@ static void BMEdit_RecalcTesselation_intern(BMEditMesh *tm)
}
tm->tottri = i;
tm->looptris = looptris;
tm->looptris = (BMLoop *(*)[3])looptris;
}
void BMEdit_RecalcTesselation(BMEditMesh *tm)
@@ -1534,7 +1534,8 @@ static void bmDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
BMVert *eve;
BMIter iter;
int i;
i= 0;
BM_ITER(eve, &iter, emdm->tc->bm, BM_VERTS_OF_MESH, NULL) {
if (emdm->vertexCos) {
copy_v3_v3(cos_r[i], emdm->vertexCos[i]);

View File

@@ -1165,8 +1165,8 @@ DMFaceIter *cgdm_newFaceIter(DerivedMesh *dm)
MEdge medge;
int i, totedge = cgdm_getNumEdges(dm);
fiter->cgdm = dm;
fiter->liter.cgdm = dm;
fiter->cgdm = (CCGDerivedMesh *)dm;
fiter->liter.cgdm = (CCGDerivedMesh *)dm;
fiter->mface = fiter->mf = dm->dupTessFaceArray(dm);
fiter->mf--;
@@ -3113,7 +3113,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
}
}
return result;
return (DerivedMesh *)result;
}
void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3])

View File

@@ -402,17 +402,24 @@ static int compute_mdisp_quad(BMLoop *l, double v1[3], double v2[3], double v3[3
}
/*funnily enough, I think this is identical to face_to_crn_interp, heh*/
double quad_coord(double aa[3], double bb[3], double cc[3], double dd[3], int a1, int a2)
static double quad_coord(double aa[3], double bb[3], double cc[3], double dd[3], int a1, int a2)
{
double x, y, z, c, f1, f2;
double x, y, z, f1;
x = aa[a1]*cc[a2]-cc[a1]*aa[a2];
y = aa[a1]*dd[a2]+bb[a1]*cc[a2]-cc[a1]*bb[a2]-dd[a1]*aa[a2];
z = bb[a1]*dd[a2]-dd[a1]*bb[a2];
if (fabs(2*(x-y+z)) > DBL_EPSILON*10.0) {
double f2;
f1 = (sqrt(y*y-4.0*x*z) - y + 2.0*z) / (2.0*(x-y+z));
f2 = (-sqrt(y*y-4.0*x*z) - y + 2.0*z) / (2.0*(x-y+z));
f1= fabs(f1);
f2= fabs(f2);
f1 = MIN2(f1, f2);
CLAMP(f1, 0.0, 1.0+DBL_EPSILON);
} else {
f1 = -z/(y - 2*z);
CLAMP(f1, 0.0, 1.0+DBL_EPSILON);
@@ -427,12 +434,8 @@ double quad_coord(double aa[3], double bb[3], double cc[3], double dd[3], int a1
return cc[(i+1)%2] / fabs(dd[(i+1)%2] - cc[(i+1)%2]);
}
}
return f1;
}
f1 = MIN2(fabs(f1), fabs(f2));
CLAMP(f1, 0.0, 1.0+DBL_EPSILON);
return f1;
}

View File

@@ -80,7 +80,7 @@ int BM_Dissolve_Disk(BMesh *bm, BMVert *v) {
BMFace *f, *f2;
BMEdge *e, *keepedge=NULL, *baseedge=NULL;
BMLoop *loop;
int done, len;
int done, len= 0;
if(BM_Nonmanifold_Vert(bm, v)) {
return 0;
@@ -89,7 +89,6 @@ int BM_Dissolve_Disk(BMesh *bm, BMVert *v) {
if(v->e){
/*v->e we keep, what else?*/
e = v->e;
len = 0;
do{
e = bmesh_disk_nextedge(e,v);
if(!(BM_Edge_Share_Faces(e, v->e))){

View File

@@ -68,7 +68,7 @@ void connectverts_exec(BMesh *bm, BMOperator *op)
loops[BLI_array_count(loops)-1] = loops[0];
}
BM_LegalSplits(bm, f, loops, BLI_array_count(loops)/2);
BM_LegalSplits(bm, f, (BMLoop *(*)[2])loops, BLI_array_count(loops)/2);
for (i=0; i<BLI_array_count(loops)/2; i++) {
if (loops[i*2]==NULL) continue;

View File

@@ -3384,6 +3384,7 @@ static int iteratorStopped(void *arg)
ReebGraph *BIF_ReebGraphMultiFromEditMesh(bContext *C)
{
(void)C;
return NULL;
#if 0
Scene *scene = CTX_data_scene(C);

View File

@@ -408,7 +408,7 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
case TH_PIN:
cp= ts->pin; break;
case TH_PIN_OPAC:
cp= &ts->pin_opac; break;
cp= &ts->pin_opac; break; /*XXX BMESH_TODO*/
case TH_PREVIEW_BACK:
cp= ts->preview_back;

View File

@@ -103,7 +103,8 @@ void EDBM_select_mirrored(Object *obedit, BMEditMesh *em)
BMVert *eve, *v1;
BMIter iter;
int i;
i= 0;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_TestHFlag(eve, BM_SELECT) && !BM_TestHFlag(eve, BM_HIDDEN)) {
v1= editbmesh_get_x_mirror_vert(obedit, em, eve, eve->co, i);

View File

@@ -339,7 +339,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
}
/* called when modal loop selection is done... */
static void ringsel_exit(bContext *C, wmOperator *op)
static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
{
tringselOpData *lcd= op->customdata;

View File

@@ -177,8 +177,13 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
}
}
static void copy_editface_active_customdata(EditMesh *em, int type, int index)
static void copy_editface_active_customdata(BMEditMesh *em, int type, int index)
{
#if 1 /*BMESH_TODO*/
(void)em;
(void)type;
(void)index;
#else
EditFace *efa;
int n= CustomData_get_active_layer(&em->fdata, type);
@@ -186,6 +191,7 @@ static void copy_editface_active_customdata(EditMesh *em, int type, int index)
void *data= CustomData_em_get_n(&em->fdata, efa->data, type, n);
CustomData_em_set_n(&em->fdata, efa->data, type, index, data);
}
#endif
}
int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_set)

View File

@@ -55,6 +55,8 @@ struct BMesh;
struct BMEdge;
struct BMFace;
struct wmOperator;
struct wmKeyMap;
struct wmKeyConfig;
/* ******************** bmeshutils.c */

View File

@@ -2084,7 +2084,7 @@ static int draw_dm_edges_pins__setDrawOptions(void *userData, int index)
BMIter feiter;
BMFace *fe;
int fcount, fpcount = 0;
int fcount = 0, fpcount = 0;
int pin = 0;
/* If pinned faces are drawn then only draw pinned edges at the borders.