[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51354] trunk/blender/source: code cleanup : use float sizes for function args.
Campbell Barton
ideasman42 at gmail.com
Tue Oct 16 01:12:04 CEST 2012
Revision: 51354
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51354
Author: campbellbarton
Date: 2012-10-15 23:11:59 +0000 (Mon, 15 Oct 2012)
Log Message:
-----------
code cleanup: use float sizes for function args.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/BKE_node.h
trunk/blender/source/blender/blenkernel/intern/node.c
trunk/blender/source/blender/blenkernel/intern/smoke.c
trunk/blender/source/blender/blenlib/BLI_kdopbvh.h
trunk/blender/source/blender/blenlib/BLI_kdtree.h
trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
trunk/blender/source/blender/blenlib/intern/BLI_kdtree.c
trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h
trunk/blender/source/blender/compositor/operations/COM_MixBaseOperation.h
trunk/blender/source/blender/makesdna/DNA_packedFile_types.h
trunk/blender/source/blender/nodes/texture/node_texture_tree.c
trunk/blender/source/blender/nodes/texture/node_texture_util.c
trunk/blender/source/blender/nodes/texture/node_texture_util.h
trunk/blender/source/blender/nodes/texture/nodes/node_texture_bricks.c
trunk/blender/source/blender/nodes/texture/nodes/node_texture_proc.c
trunk/blender/source/blender/nodes/texture/nodes/node_texture_rotate.c
trunk/blender/source/blender/nodes/texture/nodes/node_texture_valToNor.c
trunk/blender/source/blender/python/mathutils/mathutils_Color.c
trunk/blender/source/blender/python/mathutils/mathutils_Color.h
trunk/blender/source/blender/render/extern/include/RE_shader_ext.h
trunk/blender/source/blender/render/intern/include/envmap.h
trunk/blender/source/blender/render/intern/include/pointdensity.h
trunk/blender/source/blender/render/intern/include/shading.h
trunk/blender/source/blender/render/intern/source/envmap.c
trunk/blender/source/blender/render/intern/source/pointdensity.c
trunk/blender/source/blender/render/intern/source/render_texture.c
trunk/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
Modified: trunk/blender/source/blender/blenkernel/BKE_node.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_node.h 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenkernel/BKE_node.h 2012-10-15 23:11:59 UTC (rev 51354)
@@ -349,7 +349,7 @@
void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock);
void nodeRemoveAllSockets(struct bNodeTree *ntree, struct bNode *node);
-void nodeAddToPreview(struct bNode *node, float col[4], int x, int y, int do_manage);
+void nodeAddToPreview(struct bNode *node, const float col[4], int x, int y, int do_manage);
struct bNode *nodeAddNode(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
@@ -785,7 +785,9 @@
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree, int use_tree_data);
void ntreeTexEndExecTree(struct bNodeTreeExec *exec, int use_tree_data);
-int ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, int osatex, short thread, struct Tex *tex, short which_output, int cfra, int preview, struct ShadeInput *shi, struct MTex *mtex);
+int ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target,
+ float coord[3], float dxt[3], float dyt[3], int osatex, const short thread,
+ struct Tex *tex, short which_output, int cfra, int preview, struct ShadeInput *shi, struct MTex *mtex);
/*************************************************/
Modified: trunk/blender/source/blender/blenkernel/intern/node.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/node.c 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenkernel/intern/node.c 2012-10-15 23:11:59 UTC (rev 51354)
@@ -889,7 +889,7 @@
/* hack warning! this function is only used for shader previews, and
* since it gets called multiple times per pixel for Ztransp we only
* add the color once. Preview gets cleared before it starts render though */
-void nodeAddToPreview(bNode *node, float col[4], int x, int y, int do_manage)
+void nodeAddToPreview(bNode *node, const float col[4], int x, int y, int do_manage)
{
bNodePreview *preview = node->preview;
if (preview) {
Modified: trunk/blender/source/blender/blenkernel/intern/smoke.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/smoke.c 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenkernel/intern/smoke.c 2012-10-15 23:11:59 UTC (rev 51354)
@@ -1054,7 +1054,7 @@
}
}
-static void get_texture_value(Tex *texture, float *tex_co, TexResult *texres)
+static void get_texture_value(Tex *texture, float tex_co[3], TexResult *texres)
{
int result_type;
Modified: trunk/blender/source/blender/blenlib/BLI_kdopbvh.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_kdopbvh.h 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenlib/BLI_kdopbvh.h 2012-10-15 23:11:59 UTC (rev 51354)
@@ -75,7 +75,7 @@
} BVHTreeRayHit;
/* callback must update nearest in case it finds a nearest result */
-typedef void (*BVHTree_NearestPointCallback)(void *userdata, int index, const float *co, BVHTreeNearest *nearest);
+typedef void (*BVHTree_NearestPointCallback)(void *userdata, int index, const float co[3], BVHTreeNearest *nearest);
/* callback must update hit in case it finds a nearest successful hit */
typedef void (*BVHTree_RayCastCallback)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
@@ -87,11 +87,11 @@
void BLI_bvhtree_free(BVHTree *tree);
/* construct: first insert points, then call balance */
-int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints);
+int BLI_bvhtree_insert(BVHTree *tree, int index, const float co[3], int numpoints);
void BLI_bvhtree_balance(BVHTree *tree);
/* update: first update points/nodes, then call update_tree to refit the bounding volumes */
-int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints);
+int BLI_bvhtree_update_node(BVHTree *tree, int index, const float co[3], const float co_moving[3], int numpoints);
void BLI_bvhtree_update_tree(BVHTree *tree);
/* collision/overlap: check two trees if they overlap, alloc's *overlap with length of the int return value */
@@ -99,15 +99,19 @@
float BLI_bvhtree_getepsilon(BVHTree *tree);
-/* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */
-int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata);
+/* find nearest node to the given coordinates
+ * (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */
+int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest,
+ BVHTree_NearestPointCallback callback, void *userdata);
-int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit,
+ BVHTree_RayCastCallback callback, void *userdata);
-float BLI_bvhtree_bb_raycast(const float *bv, const float light_start[3], const float light_end[3], float pos[3]);
+float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3]);
/* range query */
-int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata);
+int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius,
+ BVHTree_RangeQuery callback, void *userdata);
#ifdef __cplusplus
}
Modified: trunk/blender/source/blender/blenlib/BLI_kdtree.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_kdtree.h 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenlib/BLI_kdtree.h 2012-10-15 23:11:59 UTC (rev 51354)
@@ -56,7 +56,7 @@
/* Find nearest returns index, and -1 if no node is found.
* Find n nearest returns number of points found, with results in nearest.
* Normal is optional, but if given will limit results to points in normal direction from co. */
-int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *nearest);
+int BLI_kdtree_find_nearest(KDTree *tree, const float co[3], const float nor[3], KDTreeNearest *nearest);
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, const float co[3], const float nor[3], KDTreeNearest *nearest);
/* Range search returns number of points found, with results in nearest */
Modified: trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c 2012-10-15 23:11:59 UTC (rev 51354)
@@ -921,7 +921,7 @@
/* bvhtree_info(tree); */
}
-int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints)
+int BLI_bvhtree_insert(BVHTree *tree, int index, const float co[3], int numpoints)
{
int i;
BVHNode *node = NULL;
@@ -952,7 +952,7 @@
/* call before BLI_bvhtree_update_tree() */
-int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints)
+int BLI_bvhtree_update_node(BVHTree *tree, int index, const float co[3], const float co_moving[3], int numpoints)
{
int i;
BVHNode *node = NULL;
@@ -1346,7 +1346,7 @@
/* Determines the distance that the ray must travel to hit the bounding volume of the given node */
-static float ray_nearest_hit(BVHRayCastData *data, const float *bv)
+static float ray_nearest_hit(BVHRayCastData *data, const float bv[6])
{
int i;
@@ -1524,7 +1524,7 @@
return data.hit.index;
}
-float BLI_bvhtree_bb_raycast(const float *bv, const float light_start[3], const float light_end[3], float pos[3])
+float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3])
{
BVHRayCastData data;
float dist = 0.0;
Modified: trunk/blender/source/blender/blenlib/intern/BLI_kdtree.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_kdtree.c 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/blenlib/intern/BLI_kdtree.c 2012-10-15 23:11:59 UTC (rev 51354)
@@ -132,7 +132,7 @@
tree->root = kdtree_balance(tree->nodes, tree->totnode, 0);
}
-static float squared_distance(const float v2[3], const float v1[3], const float *UNUSED(n1), const float *n2)
+static float squared_distance(const float v2[3], const float v1[3], const float UNUSED(n1[3]), const float n2[3])
{
float d[3], dist;
@@ -152,7 +152,7 @@
return dist;
}
-int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *nearest)
+int BLI_kdtree_find_nearest(KDTree *tree, const float co[3], const float nor[3], KDTreeNearest *nearest)
{
KDTreeNode *root, *node, *min_node;
KDTreeNode **stack, *defaultstack[100];
Modified: trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h 2012-10-15 22:45:47 UTC (rev 51353)
+++ trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h 2012-10-15 23:11:59 UTC (rev 51354)
@@ -45,7 +45,7 @@
*/
MathBaseOperation();
- void clampIfNeeded(float *color);
+ void clampIfNeeded(float color[4]);
public:
/**
* the inner loop of this program
Modified: trunk/blender/source/blender/compositor/operations/COM_MixBaseOperation.h
===================================================================
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list