[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41931] branches/bmesh/blender/source/ blender/blenlib/intern/BLI_mempool.c: remove NULL check for the pool, trunk doesnt have this, caller better check.
Campbell Barton
ideasman42 at gmail.com
Wed Nov 16 20:26:11 CET 2011
Revision: 41931
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41931
Author: campbellbarton
Date: 2011-11-16 19:26:11 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
remove NULL check for the pool, trunk doesnt have this, caller better check.
Modified Paths:
--------------
branches/bmesh/blender/source/blender/blenlib/intern/BLI_mempool.c
Modified: branches/bmesh/blender/source/blender/blenlib/intern/BLI_mempool.c
===================================================================
--- branches/bmesh/blender/source/blender/blenlib/intern/BLI_mempool.c 2011-11-16 19:22:14 UTC (rev 41930)
+++ branches/bmesh/blender/source/blender/blenlib/intern/BLI_mempool.c 2011-11-16 19:26:11 UTC (rev 41931)
@@ -111,7 +111,7 @@
mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
BLI_addtail(&(pool->chunks), mpchunk);
- if(i==0) {
+ if (i==0) {
pool->free = mpchunk->data; /*start of the list*/
if (pool->allow_iter)
pool->free->freeword = FREEWORD;
@@ -129,7 +129,7 @@
}
}
/*final pointer in the previously allocated chunk is wrong.*/
- if(lasttail) {
+ if (lasttail) {
lasttail->next = mpchunk->data;
if (pool->allow_iter)
lasttail->freeword = FREEWORD;
@@ -149,8 +149,6 @@
{
void *retval=NULL;
- if (!pool) return NULL;
-
pool->totused++;
if (!(pool->free)) {
@@ -245,7 +243,7 @@
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
{
if (!pool->allow_iter) {
- fprintf(stderr, "evil! you can't iterate over this mempool!\n");
+ fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__);
iter->curchunk = NULL;
iter->curindex = 0;
More information about the Bf-blender-cvs
mailing list