Fixed gcc warnings for unused var and unitialiazed vars.
NOTE: I had to fix NMesh.c, Mesh_fromNMesh(), that is a real bad function... it was returning a Py object as a Mesh (on error). This is still not really solved (NULL return is not handled).
This commit is contained in:
@@ -613,7 +613,7 @@ struct chartrans *text_to_curve(Object *ob, int mode)
|
||||
VFont *vfont, *oldvfont;
|
||||
VFontData *vfd= NULL;
|
||||
Curve *cu, *cucu;
|
||||
struct chartrans *chartransdata, *ct;
|
||||
struct chartrans *chartransdata=NULL, *ct;
|
||||
float distfac, tabfac, ctime, dtime, tvec[4], vec[4], rotvec[3], minx, maxx, miny, maxy;
|
||||
float cmat[3][3], timeofs, si, co, sizefac;
|
||||
float *f, maxlen=0, xof, yof, xtrax, linedist, *linedata, *linedata2, *linedata3, *linedata4;
|
||||
|
||||
@@ -365,9 +365,9 @@ int sb_detect_collision(float opco[3], float facenormal[3], float *damp,
|
||||
|
||||
/* only with deflecting set */
|
||||
if(ob->pd && ob->pd->deflect) {
|
||||
DerivedMesh *dm=NULL;
|
||||
DispListMesh *disp_mesh = 0;
|
||||
MFace *mface;
|
||||
DerivedMesh *dm= NULL;
|
||||
DispListMesh *disp_mesh= NULL;
|
||||
MFace *mface= NULL;
|
||||
Object *copyob;
|
||||
int dmNeedsFree;
|
||||
|
||||
|
||||
@@ -486,8 +486,9 @@ PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args)
|
||||
}
|
||||
dot /= (sqrt(test_v1) * sqrt(test_v2));
|
||||
|
||||
if (dot < -1.0f || dot > 1.0f)
|
||||
if (dot < -1.0f || dot > 1.0f) {
|
||||
CLAMP(dot,-1.0f,1.0f);
|
||||
}
|
||||
angleRads = (double)acos(dot);
|
||||
|
||||
return PyFloat_FromDouble(angleRads * (180/ Py_PI));
|
||||
|
||||
@@ -1456,21 +1456,29 @@ static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
|
||||
return influence_list;
|
||||
}
|
||||
|
||||
/* this call is VERY BAD! needs fixing (return NULL is not being handled) */
|
||||
Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh , int store_edges )
|
||||
{
|
||||
Mesh *mesh = NULL;
|
||||
|
||||
mesh = add_mesh( );
|
||||
|
||||
if( !mesh )
|
||||
if( !mesh ) {
|
||||
EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||
"FATAL: could not create mesh object" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mesh->id.us = 0; /* no user yet */
|
||||
G.totmesh++;
|
||||
if( !convert_NMeshToMesh( mesh, nmesh, store_edges ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||
|
||||
/* NOTE! the EXPP_ function returns a pyObject *, and still it returned it as a mesh? (ton) */
|
||||
if( !convert_NMeshToMesh( mesh, nmesh, store_edges ) ) {
|
||||
EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||
"faces must have at 3 or 4 vertices" );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
||||
@@ -2599,7 +2599,7 @@ static void joinarea_interactive(ScrArea *area, ScrEdge *onedge)
|
||||
struct ScrEdge *se;
|
||||
unsigned short event;
|
||||
short ok=0, val=0, mval[2];
|
||||
char dir;
|
||||
char dir=0;
|
||||
|
||||
sa1 = test_edge_area(sa1, onedge);
|
||||
if(sa1==0) return;
|
||||
|
||||
Reference in New Issue
Block a user