[Bf-blender-cvs] [82628a6] master: Code cleanup: use struct type for mempool & style edits

Campbell Barton noreply at git.blender.org
Wed Apr 9 23:01:23 CEST 2014


Commit: 82628a6b0e490a180ba822336c7177cda71ba57d
Author: Campbell Barton
Date:   Thu Apr 10 06:24:33 2014 +1000
https://developer.blender.org/rB82628a6b0e490a180ba822336c7177cda71ba57d

Code cleanup: use struct type for mempool & style edits

===================================================================

M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/linestyle.c
M	source/blender/blenlib/BLI_sys_types.h
M	source/blender/blenlib/intern/BLI_mempool.c
M	source/blender/makesdna/DNA_customdata_types.h

===================================================================

diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index c8862e1..84b54ff 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -498,7 +498,7 @@ void DM_update_materials(DerivedMesh *dm, Object *ob)
 	if (dm->mat)
 		MEM_freeN(dm->mat);
 
-	dm->mat = MEM_callocN (totmat * sizeof(*dm->mat), "DerivedMesh.mat");
+	dm->mat = MEM_callocN(totmat * sizeof(*dm->mat), "DerivedMesh.mat");
 
 	for (i = 1; i < totmat; i++) {
 		dm->mat[i] = give_current_material(ob, i);
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index 3622174..f826e61 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -1024,7 +1024,7 @@ void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *list
 			default:
 				continue;
 		}
-		link = (LinkData *) MEM_callocN( sizeof(LinkData), "link to color ramp");
+		link = (LinkData *) MEM_callocN(sizeof(LinkData), "link to color ramp");
 		link->data = color_ramp;
 		BLI_addtail(listbase, link);
 	}
diff --git a/source/blender/blenlib/BLI_sys_types.h b/source/blender/blenlib/BLI_sys_types.h
index 8d9ed07..fcdbf16 100644
--- a/source/blender/blenlib/BLI_sys_types.h
+++ b/source/blender/blenlib/BLI_sys_types.h
@@ -197,9 +197,6 @@ typedef uint64_t u_int64_t;
 
 #endif /* ifdef platform for types */
 
-
-/* note: use of (int, TRUE / FALSE) is deprecated,
- * use (bool, true / false) instead */
 #ifdef HAVE_STDBOOL_H
 # include <stdbool.h>
 #elif !defined(__bool_true_false_are_defined) && !defined(__BOOL_DEFINED)
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index 21af8af..b959bec 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -143,7 +143,7 @@ static unsigned int power_of_2_max_u(unsigned int x)
 	x = x | (x >> 2);
 	x = x | (x >> 4);
 	x = x | (x >> 8);
-	x = x | (x >>16);
+	x = x | (x >> 16);
 	return x + 1;
 }
 #endif
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 325c2a8..b6ae49c 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -69,7 +69,7 @@ typedef struct CustomData {
 	int pad[1];
 	int totlayer, maxlayer;       /* number of layers, size of layers array */
 	int totsize;                  /* in editmode, total size of all data layers */
-	void *pool;                   /* Bmesh: Memory pool for allocation of blocks */
+	struct BLI_mempool *pool;     /* (BMesh Only): Memory pool for allocation of blocks */
 	CustomDataExternal *external; /* external file storing customdata layers */
 } CustomData;




More information about the Bf-blender-cvs mailing list