[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45484] trunk/blender: use 'const float[3] ' for derived mesh callback args.

Campbell Barton ideasman42 at gmail.com
Mon Apr 9 09:06:06 CEST 2012


Revision: 45484
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45484
Author:   campbellbarton
Date:     2012-04-09 07:06:06 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
use 'const float[3]' for derived mesh callback args.

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/source/blender/blenkernel/BKE_DerivedMesh.h
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/blenkernel/intern/anim.c
    trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
    trunk/blender/source/blender/blenkernel/intern/editderivedmesh.c
    trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
    trunk/blender/source/blender/editors/armature/editarmature.c
    trunk/blender/source/blender/editors/mesh/editmesh_bvh.c
    trunk/blender/source/blender/editors/mesh/editmesh_knife.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/editors/space_view3d/view3d_snap.c
    trunk/blender/source/blender/editors/util/crazyspace.c

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/CMakeLists.txt	2012-04-09 07:06:06 UTC (rev 45484)
@@ -304,8 +304,8 @@
 	message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
 
-if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
-	message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG require WITH_AUDASPACE")
+if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK OR WITH_GAMEENGINE))
+	message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG/WITH_GAMEENGINE require WITH_AUDASPACE")
 endif()
 
 if(NOT WITH_SDL AND WITH_GHOST_SDL)

Modified: trunk/blender/source/blender/blenkernel/BKE_DerivedMesh.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_DerivedMesh.h	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/blenkernel/BKE_DerivedMesh.h	2012-04-09 07:06:06 UTC (rev 45484)
@@ -262,29 +262,28 @@
 	 * coordinate and normal. For historical reasons the normal can be
 	 * passed as a float or short array, only one should be non-NULL.
 	 */
-	void (*foreachMappedVert)(
-						  DerivedMesh *dm,
-						  void (*func)(void *userData, int index, float *co,
-									   float *no_f, short *no_s),
-						  void *userData);
+	void (*foreachMappedVert)(DerivedMesh *dm,
+	                          void (*func)(void *userData, int index, const float co[3],
+	                                       const float no_f[3], const short no_s[3]),
+	                          void *userData);
 
 	/* Iterate over each mapped edge in the derived mesh, calling the
 	 * given function with the original edge and the mapped edge's new
 	 * coordinates.
 	 */
 	void (*foreachMappedEdge)(DerivedMesh *dm,
-							  void (*func)(void *userData, int index,
-										   float *v0co, float *v1co),
-							  void *userData);
+	                          void (*func)(void *userData, int index,
+	                                       const float v0co[3], const float v1co[3]),
+	                          void *userData);
 
 	/* Iterate over each mapped face in the derived mesh, calling the
 	 * given function with the original face and the mapped face's (or
 	 * faces') center and normal.
 	 */
 	void (*foreachMappedFaceCenter)(DerivedMesh *dm,
-									void (*func)(void *userData, int index,
-												 float *cent, float *no),
-									void *userData);
+	                                void (*func)(void *userData, int index,
+	                                             const float cent[3], const float no[3]),
+	                                void *userData);
 
 	/* Iterate over all vertex points, calling DO_MINMAX with given args.
 	 *

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -2306,7 +2306,8 @@
 
 /* ********* For those who don't grasp derived stuff! (ton) :) *************** */
 
-static void make_vertexcosnos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void make_vertexcosnos__mapFunc(void *userData, int index, const float co[3],
+                                       const float no_f[3], const short no_s[3])
 {
 	float *vec = userData;
 	

Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -840,7 +840,8 @@
 
 /* ------------- */
 
-static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
+                                  const float no_f[3], const short no_s[3])
 {
 	DupliObject *dob;
 	vertexDupliData *vdd= userData;

Modified: trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -1418,10 +1418,9 @@
 }
 
 static void cdDM_foreachMappedVert(
-						   DerivedMesh *dm,
-						   void (*func)(void *userData, int index, float *co,
-										float *no_f, short *no_s),
-						   void *userData)
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]),
+        void *userData)
 {
 	MVert *mv = CDDM_get_verts(dm);
 	int i, orig, *index = DM_get_vert_data_layer(dm, CD_ORIGINDEX);
@@ -1438,10 +1437,9 @@
 }
 
 static void cdDM_foreachMappedEdge(
-						   DerivedMesh *dm,
-						   void (*func)(void *userData, int index,
-										float *v0co, float *v1co),
-						   void *userData)
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]),
+        void *userData)
 {
 	CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
 	MVert *mv = cddm->mvert;
@@ -1460,10 +1458,9 @@
 }
 
 static void cdDM_foreachMappedFaceCenter(
-						   DerivedMesh *dm,
-						   void (*func)(void *userData, int index,
-										float *cent, float *no),
-						   void *userData)
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float cent[3], const float no[3]),
+        void *userData)
 {
 	CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
 	MVert *mv = cddm->mvert;

Modified: trunk/blender/source/blender/blenkernel/intern/editderivedmesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/editderivedmesh.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/blenkernel/intern/editderivedmesh.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -351,9 +351,9 @@
 }
 
 static void emDM_foreachMappedVert(
-		DerivedMesh *dm,
-		void (*func)(void *userData, int index, float *co, float *no_f, short *no_s),
-		void *userData)
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]),
+        void *userData)
 {
 	EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
 	BMVert *eve;
@@ -371,9 +371,9 @@
 	}
 }
 static void emDM_foreachMappedEdge(
-		DerivedMesh *dm,
-		void (*func)(void *userData, int index, float *v0co, float *v1co),
-		void *userData)
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]),
+        void *userData)
 {
 	EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
 	BMEdge *eed;
@@ -551,9 +551,9 @@
 }
 
 static void emDM_foreachMappedFaceCenter(
-		DerivedMesh *dm,
-		void (*func)(void *userData, int index, float *co, float *no),
-		void *userData)
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float co[3], const float no[3]),
+        void *userData)
 {
 	EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
 	float (*polyNos)[3] = NULL;

Modified: trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -1391,7 +1391,10 @@
 	MEM_freeN(faceMap2);
 }
 
-static void ccgDM_foreachMappedVert(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no_f, short *no_s), void *userData)
+static void ccgDM_foreachMappedVert(
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]),
+        void *userData)
 {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 	CCGVertIterator *vi = ccgSubSurf_getVertIterator(ccgdm->ss);
@@ -1408,7 +1411,10 @@
 	ccgVertIterator_free(vi);
 }
 
-static void ccgDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData, int index, float *v0co, float *v1co), void *userData)
+static void ccgDM_foreachMappedEdge(
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]),
+        void *userData)
 {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 	CCGSubSurf *ss = ccgdm->ss;
@@ -2382,7 +2388,10 @@
 	ccgEdgeIterator_free(ei);
 }
 
-static void ccgDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no), void *userData)
+static void ccgDM_foreachMappedFaceCenter(
+        DerivedMesh *dm,
+        void (*func)(void *userData, int index, const float co[3], const float no[3]),
+        void *userData)
 {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 	CCGSubSurf *ss = ccgdm->ss;

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/editors/armature/editarmature.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -4508,7 +4508,8 @@
 	return 0;
 }
 
-static void add_vgroups__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
+static void add_vgroups__mapFunc(void *userData, int index, const float co[3],
+                                 const float UNUSED(no_f[3]), const short UNUSED(no_s[3]))
 {
 	/* DerivedMesh mapFunc for getting final coords in weight paint mode */
 

Modified: trunk/blender/source/blender/editors/mesh/editmesh_bvh.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_bvh.c	2012-04-09 05:17:07 UTC (rev 45483)
+++ trunk/blender/source/blender/editors/mesh/editmesh_bvh.c	2012-04-09 07:06:06 UTC (rev 45484)
@@ -69,8 +69,8 @@
 	Scene *scene;
 } BMBVHTree;
 
-static void cage_mapped_verts_callback(void *userData, int index, float *co, 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list