[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34171] trunk/blender/source/blender/gpu/ intern/gpu_buffers.c: variable 'pool' could be accessed as NULL, globalPool was allocated but not assigned before use.

Campbell Barton ideasman42 at gmail.com
Sat Jan 8 11:14:00 CET 2011


Revision: 34171
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34171
Author:   campbellbarton
Date:     2011-01-08 10:13:59 +0000 (Sat, 08 Jan 2011)
Log Message:
-----------
variable 'pool' could be accessed as NULL, globalPool was allocated but not assigned before use.
also remove unused vars.

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/intern/gpu_buffers.c

Modified: trunk/blender/source/blender/gpu/intern/gpu_buffers.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_buffers.c	2011-01-08 04:49:33 UTC (rev 34170)
+++ trunk/blender/source/blender/gpu/intern/gpu_buffers.c	2011-01-08 10:13:59 UTC (rev 34171)
@@ -242,7 +242,7 @@
 	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 @@
 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 @@
 	/*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 @@
 {
 	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);




More information about the Bf-blender-cvs mailing list