style cleanup: whitespace / commas

This commit is contained in:
2012-04-29 15:47:02 +00:00
parent 038c12895f
commit e701f9b670
249 changed files with 3261 additions and 3262 deletions

View File

@@ -129,7 +129,7 @@ static float KDOP_AXES[13][3] =
/*
* Generic push and pop heap
*/
#define PUSH_HEAP_BODY(HEAP_TYPE,PRIORITY,heap,heap_size) \
#define PUSH_HEAP_BODY(HEAP_TYPE, PRIORITY, heap, heap_size) \
{ \
HEAP_TYPE element = heap[heap_size-1]; \
int child = heap_size-1; \
@@ -146,7 +146,7 @@ static float KDOP_AXES[13][3] =
heap[child] = element; \
}
#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY,heap,heap_size) \
#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY, heap, heap_size) \
{ \
HEAP_TYPE element = heap[heap_size-1]; \
int parent = 0; \
@@ -215,7 +215,7 @@ static int floor_lg(int a)
*/
static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis)
{
int i,j;
int i, j;
BVHNode *t;
for (i=lo; i < hi; i++) {
j=i;
@@ -237,7 +237,7 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis)
while (x->bv[axis] < (a[j])->bv[axis]) j--;
if (!(i < j))
return i;
SWAP( BVHNode* , a[i], a[j]);
SWAP(BVHNode *, a[i], a[j]);
i++;
}
}
@@ -269,12 +269,12 @@ static void bvh_heapsort(BVHNode **a, int lo, int hi, int axis)
int n = hi-lo, i;
for (i=n/2; i>=1; i=i-1)
{
bvh_downheap(a, i,n,lo, axis);
bvh_downheap(a, i, n, lo, axis);
}
for (i=n; i>1; i=i-1)
{
SWAP(BVHNode*, a[lo],a[lo+i-1]);
bvh_downheap(a, 1,i-1,lo, axis);
SWAP(BVHNode*, a[lo], a[lo+i-1]);
bvh_downheap(a, 1, i-1, lo, axis);
}
}
#endif
@@ -409,7 +409,7 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, const float *co, int
// depends on the fact that the BVH's for each face is already build
static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end)
{
float newmin,newmax;
float newmin, newmax;
int i, j;
float *bv = node->bv;
@@ -671,7 +671,7 @@ static int implicit_needed_branches(int tree_type, int leafs)
* - if all elements are different all partition will get the same subset of elements
* as if the array was sorted.
*
* partition P is described as the elements in the range ( nth[P] , nth[P+1] ]
* partition P is described as the elements in the range ( nth[P], nth[P+1] ]
*
* TODO: This can be optimized a bit by doing a specialized nth_element instead of K nth_elements
*/
@@ -1180,14 +1180,14 @@ typedef struct NodeDistance
} NodeDistance;
#define NodeDistance_priority(a,b) ( (a).dist < (b).dist )
#define NodeDistance_priority(a, b) ( (a).dist < (b).dist )
// TODO: use a priority queue to reduce the number of nodes looked on
static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
{
if (node->totnode == 0) {
if (data->callback)
data->callback(data->userdata , node->index, data->co, &data->nearest);
data->callback(data->userdata, node->index, data->co, &data->nearest);
else {
data->nearest.index = node->index;
data->nearest.dist = calc_nearest_point(data->proj, node, data->nearest.co);
@@ -1329,7 +1329,7 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *n
}
if (nearest) {
memcpy( &data.nearest , nearest, sizeof(*nearest) );
memcpy( &data.nearest, nearest, sizeof(*nearest) );
}
else {
data.nearest.index = -1;