variable 'pool' could be accessed as NULL, globalPool was allocated but not assigned before use.

also remove unused vars.
This commit is contained in:
Campbell Barton
2011-01-08 10:13:59 +00:00
parent c2d133a9fc
commit c35db522da

View File

@@ -242,7 +242,7 @@ void GPU_buffer_free( GPUBuffer *buffer, GPUBufferPool *pool )
if( pool == 0 )
pool = globalPool;
if( pool == 0 )
globalPool = GPU_buffer_pool_new();
pool = globalPool = GPU_buffer_pool_new();
/* free the last used buffer in the queue if no more space, but only
if we are in the main thread. for e.g. rendering or baking it can
@@ -269,7 +269,6 @@ void GPU_buffer_free( GPUBuffer *buffer, GPUBufferPool *pool )
GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
{
GPUDrawObject *object;
MVert *mvert;
MFace *mface;
int numverts[32768]; /* material number is an 16-bit short so there's at most 32768 materials */
int redir[32768]; /* material number is an 16-bit short so there's at most 32768 materials */
@@ -291,7 +290,6 @@ GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
/*object->legacy = 1;*/
memset(numverts,0,sizeof(int)*32768);
mvert = dm->getVertArray(dm);
mface = dm->getFaceArray(dm);
numfaces= dm->getNumFaces(dm);
@@ -1116,14 +1114,12 @@ void GPU_buffer_copy_edge(DerivedMesh *dm, float *varray, int *UNUSED(index), in
{
int i;
MVert *mvert;
MEdge *medge;
unsigned int *varray_ = (unsigned int *)varray;
int numedges;
DEBUG_VBO("GPU_buffer_copy_edge\n");
mvert = dm->getVertArray(dm);
medge = dm->getEdgeArray(dm);
numedges= dm->getNumEdges(dm);