diff options
author | Ton Roosendaal <ton@blender.org> | 2005-10-28 14:09:46 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-10-28 14:09:46 +0400 |
commit | 4069604736c59dfb07caaac925b2291a5982e5e7 (patch) | |
tree | df0782c67bc20a8f400ae542a173cdb440470958 /source/blender/python/api2_2x/NMesh.c | |
parent | 595447a85ea2e388fa17b4a44dacf256ac97f343 (diff) |
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).
Diffstat (limited to 'source/blender/python/api2_2x/NMesh.c')
-rw-r--r-- | source/blender/python/api2_2x/NMesh.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c index 76a1fd56c9a..8944a64659c 100644 --- a/source/blender/python/api2_2x/NMesh.c +++ b/source/blender/python/api2_2x/NMesh.c @@ -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; } |