diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-27 14:35:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-27 14:35:39 +0400 |
commit | 47c373c7a970fa4bd26453a6e35a4b066f2b77e4 (patch) | |
tree | 43d916fb86bcf797afa834649706669694225fe8 /source/blender/blenlib/intern | |
parent | 120297734b4a01d93e5223e02f255b5aef01e281 (diff) |
style cleanup (mostly whitespace)
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdtree.c | 26 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_mempool.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/freetypefont.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/jitter.c | 14 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 38 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 42 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/noise.c | 16 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 28 |
10 files changed, 92 insertions, 92 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c index d5f66c0e75f..47c44629d65 100644 --- a/source/blender/blenlib/intern/BLI_kdtree.c +++ b/source/blender/blenlib/intern/BLI_kdtree.c @@ -179,17 +179,17 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest * stack[cur++]=root->right; } - while(cur--){ + while(cur--) { node=stack[cur]; cur_dist = node->co[node->d] - co[node->d]; - if(cur_dist<0.0f){ + if(cur_dist<0.0f) { cur_dist= -cur_dist*cur_dist; - if(-cur_dist<min_dist){ + if(-cur_dist<min_dist) { cur_dist=squared_distance(node->co,co,node->nor,nor); - if(cur_dist<min_dist){ + if(cur_dist<min_dist) { min_dist=cur_dist; min_node=node; } @@ -202,9 +202,9 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest * else{ cur_dist= cur_dist*cur_dist; - if(cur_dist<min_dist){ + if(cur_dist<min_dist) { cur_dist=squared_distance(node->co,co,node->nor,nor); - if(cur_dist<min_dist){ + if(cur_dist<min_dist) { min_dist=cur_dist; min_node=node; } @@ -214,7 +214,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest * if(node->left) stack[cur++]=node->left; } - if(cur+3 > totstack){ + if(cur+3 > totstack) { KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack"); memcpy(temp,stack,totstack*sizeof(KDTreeNode*)); if(stack != defaultstack) @@ -286,15 +286,15 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree stack[cur++]=root->right; } - while(cur--){ + while(cur--) { node=stack[cur]; cur_dist = node->co[node->d] - co[node->d]; - if(cur_dist<0.0f){ + if(cur_dist<0.0f) { cur_dist= -cur_dist*cur_dist; - if(found<n || -cur_dist<nearest[found-1].dist){ + if(found<n || -cur_dist<nearest[found-1].dist) { cur_dist=squared_distance(node->co,co,node->nor,nor); if(found<n || cur_dist<nearest[found-1].dist) @@ -309,7 +309,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree else{ cur_dist= cur_dist*cur_dist; - if(found<n || cur_dist<nearest[found-1].dist){ + if(found<n || cur_dist<nearest[found-1].dist) { cur_dist=squared_distance(node->co,co,node->nor,nor); if(found<n || cur_dist<nearest[found-1].dist) add_nearest(nearest,&found,n,node->index,cur_dist,node->co); @@ -320,7 +320,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree if(node->left) stack[cur++]=node->left; } - if(cur+3 > totstack){ + if(cur+3 > totstack) { KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack"); memcpy(temp,stack,totstack*sizeof(KDTreeNode*)); if(stack != defaultstack) @@ -427,7 +427,7 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD stack[cur++]=node->right; } - if(cur+3 > totstack){ + if(cur+3 > totstack) { KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack"); memcpy(temp,stack,totstack*sizeof(KDTreeNode*)); if(stack != defaultstack) diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 5e64ed2e3e6..6abe6c7c8be 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -166,7 +166,7 @@ void *BLI_mempool_alloc(BLI_mempool *pool) pool->free = mpchunk->data; /*start of the list*/ if (pool->allow_iter) pool->free->freeword = FREEWORD; - for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){ + for(addr = mpchunk->data, j=0; j < pool->pchunk; j++) { curnode = ((BLI_freenode*)addr); addr += pool->esize; curnode->next = (BLI_freenode*)addr; diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 8f6100f1122..3a0d44db12e 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -117,8 +117,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf che->width= glyph->advance.x * scale; // Start converting the FT data - npoints = (int *)MEM_callocN((ftoutline.n_contours)* sizeof(int),"endpoints") ; - onpoints = (int *)MEM_callocN((ftoutline.n_contours)* sizeof(int),"onpoints") ; + npoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"endpoints"); + onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"onpoints"); // calculate total points of each contour for(j = 0; j < ftoutline.n_contours; j++) { @@ -145,8 +145,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf //contour loop, bezier & conic styles merged for(j = 0; j < ftoutline.n_contours; j++) { // add new curve - nu = (Nurb*)MEM_callocN(sizeof(struct Nurb),"objfnt_nurb"); - bezt = (BezTriple*)MEM_callocN((onpoints[j])* sizeof(BezTriple),"objfnt_bezt") ; + nu = (Nurb *)MEM_callocN(sizeof(struct Nurb), "objfnt_nurb"); + bezt = (BezTriple *)MEM_callocN((onpoints[j]) * sizeof(BezTriple), "objfnt_bezt"); BLI_addtail(&che->nurbsbase, nu); nu->type= CU_BEZIER; diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c index ab33187ec4d..52733b092d3 100644 --- a/source/blender/blenlib/intern/jitter.c +++ b/source/blender/blenlib/intern/jitter.c @@ -51,10 +51,10 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1) x = jit1[i]; y = jit1[i+1]; for (j = 2*num-2; j>=0 ; j-=2) { - if (i != j){ + if (i != j) { vecx = jit1[j] - x - 1.0f; vecy = jit1[j+1] - y - 1.0f; - for (k = 3; k>0 ; k--){ + for (k = 3; k>0 ; k--) { if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) { len= sqrt(vecx*vecx + vecy*vecy); if(len>0 && len<rad1) { @@ -91,7 +91,7 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1) x -= dvecx/18.0f; y -= dvecy/18.0f; - x -= floorf(x) ; + x -= floorf(x); y -= floorf(y); jit2[i] = x; jit2[i+1] = y; @@ -104,12 +104,12 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2) int i, j; float vecx, vecy, dvecx, dvecy, x, y; - for (i=2*num -2; i>= 0 ; i-=2){ + for (i=2*num -2; i>= 0 ; i-=2) { dvecx = dvecy = 0.0; x = jit1[i]; y = jit1[i+1]; - for (j =2*num -2; j>= 0 ; j-=2){ - if (i != j){ + for (j =2*num -2; j>= 0 ; j-=2) { + if (i != j) { vecx = jit1[j] - x - 1.0f; vecy = jit1[j+1] - y - 1.0f; @@ -130,7 +130,7 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2) x -= dvecx/2.0f; y -= dvecy/2.0f; - x -= floorf(x) ; + x -= floorf(x); y -= floorf(y); jit2[i] = x; jit2[i+1] = y; diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 461f53ac434..f418b87f37e 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -381,7 +381,7 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[ if(u>u2) SWAP(float, u, u2); if(u>1.0f+eps || u2<-eps) return -1; /* non-ovlerlapping segments */ - else if(maxf(0.0f, u) == minf(1.0f, u2)){ /* one common point: can return result */ + else if(maxf(0.0f, u) == minf(1.0f, u2)) { /* one common point: can return result */ interp_v2_v2v2(vi, v1, v2, maxf(0, u)); return 1; } @@ -995,7 +995,7 @@ int isect_sweeping_sphere_tri_v3( if(z <= 0.0f && (x >= 0.0f && y >= 0.0f)) { - //(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000){ + //(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000) { *r_lambda=t0; copy_v3_v3(ipoint,point); return 1; @@ -1154,7 +1154,7 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3] if ((v < 0.0f)||(v > 1.0f)) return 0; f= e1[a1]; - if((f > -0.000001f) && (f < 0.000001f)){ + if((f > -0.000001f) && (f < 0.000001f)) { f= e1[a2]; if((f > -0.000001f) && (f < 0.000001f)) return 0; u= (-p[a2]-v*e2[a2])/f; @@ -1680,8 +1680,8 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, x1 += ix; error += delta_y; - if(callback(x1, y1, userData) == 0) { - return ; + if (callback(x1, y1, userData) == 0) { + return; } } } @@ -2523,7 +2523,7 @@ pointers may be NULL if not needed static float _det_m3(float m2[3][3]) { float det = 0.f; - if (m2){ + if (m2) { det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1]) -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1]) +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]); @@ -2548,8 +2548,8 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo if (pos && rpos && (list_size > 0)) /* paranoya check */ { /* do com for both clouds */ - for(a=0; a<list_size; a++){ - if (weight){ + for(a=0; a<list_size; a++) { + if (weight) { float v[3]; copy_v3_v3(v,pos[a]); mul_v3_fl(v,weight[a]); @@ -2558,7 +2558,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo } else add_v3_v3(accu_com, pos[a]); - if (rweight){ + if (rweight) { float v[3]; copy_v3_v3(v,rpos[a]); mul_v3_fl(v,rweight[a]); @@ -2568,7 +2568,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo else add_v3_v3(accu_rcom, rpos[a]); } - if (!weight || !rweight){ + if (!weight || !rweight) { accu_weight = accu_rweight = list_size; } @@ -2576,7 +2576,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo mul_v3_fl(accu_rcom,1.0f/accu_rweight); if (lloc) copy_v3_v3(lloc,accu_com); if (rloc) copy_v3_v3(rloc,accu_rcom); - if (lrot || lscale){ /* caller does not want rot nor scale, strange but legal */ + if (lrot || lscale) { /* caller does not want rot nor scale, strange but legal */ /*so now do some reverse engeneering and see if we can split rotation from scale ->Polardecompose*/ /* build 'projection' matrix */ float m[3][3],mr[3][3],q[3][3],qi[3][3]; @@ -2587,7 +2587,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo zero_m3(mr); /* build 'projection' matrix */ - for(a=0; a<list_size; a++){ + for(a=0; a<list_size; a++) { sub_v3_v3v3(va,rpos[a],accu_rcom); /* mul_v3_fl(va,bp->mass); mass needs renormalzation here ?? */ sub_v3_v3v3(vb,pos[a],accu_com); @@ -2628,7 +2628,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo /* without the far case ... but seems to work here pretty neat */ odet = 0.f; ndet = _det_m3(q); - while((odet-ndet)*(odet-ndet) > eps && i<imax){ + while((odet-ndet)*(odet-ndet) > eps && i<imax) { invert_m3_m3(qi,q); transpose_m3(qi); add_m3_m3m3(q,q,qi); @@ -2638,7 +2638,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo i++; } - if (i){ + if (i) { float scale[3][3]; float irot[3][3]; if(lrot) copy_m3_m3(lrot,q); @@ -2883,20 +2883,20 @@ typedef union { static vFloat vec_splat_float(float val) { - return (vFloat){val, val, val, val}; + return (vFloat) {val, val, val, val}; } static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3) { vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle; - vUInt8 rotate = (vUInt8){4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3}; + vUInt8 rotate = (vUInt8) {4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3}; vFloatResult vresult; float result; /* compute r* */ - vrx = (vFloat){q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]); - vry = (vFloat){q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]); - vrz = (vFloat){q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]); + vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]); + vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]); + vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]); /* normalize r* */ rlen = vec_rsqrte(vrx*vrx + vry*vry + vrz*vrz + vec_splat_float(1e-16f)); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 0c8c98988d1..f1dc65bd066 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -594,14 +594,14 @@ void transpose_m3(float mat[][3]) { float t; - t = mat[0][1] ; - mat[0][1] = mat[1][0] ; + t = mat[0][1]; + mat[0][1] = mat[1][0]; mat[1][0] = t; - t = mat[0][2] ; - mat[0][2] = mat[2][0] ; + t = mat[0][2]; + mat[0][2] = mat[2][0]; mat[2][0] = t; - t = mat[1][2] ; - mat[1][2] = mat[2][1] ; + t = mat[1][2]; + mat[1][2] = mat[2][1]; mat[2][1] = t; } @@ -609,25 +609,25 @@ void transpose_m4(float mat[][4]) { float t; - t = mat[0][1] ; - mat[0][1] = mat[1][0] ; + t = mat[0][1]; + mat[0][1] = mat[1][0]; mat[1][0] = t; - t = mat[0][2] ; - mat[0][2] = mat[2][0] ; + t = mat[0][2]; + mat[0][2] = mat[2][0]; mat[2][0] = t; - t = mat[0][3] ; - mat[0][3] = mat[3][0] ; + t = mat[0][3]; + mat[0][3] = mat[3][0]; mat[3][0] = t; - t = mat[1][2] ; - mat[1][2] = mat[2][1] ; + t = mat[1][2]; + mat[1][2] = mat[2][1]; mat[2][1] = t; - t = mat[1][3] ; - mat[1][3] = mat[3][1] ; + t = mat[1][3]; + mat[1][3] = mat[3][1]; mat[3][1] = t; - t = mat[2][3] ; - mat[2][3] = mat[3][2] ; + t = mat[2][3]; + mat[2][3] = mat[3][2]; mat[3][2] = t; } @@ -1099,7 +1099,7 @@ void rotate_m4(float mat[][4], const char axis, const float angle) cosine = (float)cos(angle); sine = (float)sin(angle); - switch(axis){ + switch (axis) { case 'X': for(col=0 ; col<4 ; col++) temp[col] = cosine*mat[1][col] + sine*mat[2][col]; @@ -1347,7 +1347,7 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4]) s[k] = -s[k]; } for (j = k+1; j < n; j++) { - if ((k < nct) && (s[k] != 0.0f)) { + if ((k < nct) && (s[k] != 0.0f)) { // Apply the transformation. @@ -1538,7 +1538,7 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4]) } t = (ks != p ? fabsf(e[ks]) : 0.f) + (ks != k+1 ? fabsf(e[ks-1]) : 0.0f); - if (fabsf(s[ks]) <= eps*t) { + if (fabsf(s[ks]) <= eps*t) { s[ks] = 0.0f; break; } diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index b0e6fe51810..6337e30a54b 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -507,7 +507,7 @@ void QuatInterpolW(float *result, float *quat1, float *quat2, float t) { float omega, cosom, sinom, sc1, sc2; - cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ; + cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3]; /* rotate around shortest angle */ if ((1.0f + cosom) > 0.0001f) { @@ -548,8 +548,8 @@ void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4], { float quat[4], omega, cosom, sinom, sc1, sc2; - cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ; - + cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3]; + /* rotate around shortest angle */ if (cosom < 0.0f) { cosom = -cosom; diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index b3cb2856383..f77ea3895c3 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -957,29 +957,29 @@ static float noise3_perlin(float vec[3]) sz = surve(rz0); - q = g[ b00 + bz0 ] ; + q = g[ b00 + bz0 ]; u = at(rx0,ry0,rz0); - q = g[ b10 + bz0 ] ; + q = g[ b10 + bz0 ]; v = at(rx1,ry0,rz0); a = lerp(sx, u, v); - q = g[ b01 + bz0 ] ; + q = g[ b01 + bz0 ]; u = at(rx0,ry1,rz0); - q = g[ b11 + bz0 ] ; + q = g[ b11 + bz0 ]; v = at(rx1,ry1,rz0); b = lerp(sx, u, v); c = lerp(sy, a, b); /* interpolate in y at lo x */ - q = g[ b00 + bz1 ] ; + q = g[ b00 + bz1 ]; u = at(rx0,ry0,rz1); - q = g[ b10 + bz1 ] ; + q = g[ b10 + bz1 ]; v = at(rx1,ry0,rz1); a = lerp(sx, u, v); - q = g[ b01 + bz1 ] ; + q = g[ b01 + bz1 ]; u = at(rx0,ry1,rz1); - q = g[ b11 + bz1 ] ; + q = g[ b11 + bz1 ]; v = at(rx1,ry1,rz1); b = lerp(sx, u, v); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index f2d88c0587b..e79490b29fd 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1935,12 +1935,12 @@ void BLI_string_to_utf8(char *original, char *utf_8, const char *code) if (cd == (iconv_t)(-1)) { printf("iconv_open Error"); *utf_8='\0'; - return ; + return; } rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft); if (rv == (size_t) -1) { printf("iconv Error\n"); - return ; + return; } *utf_8 = '\0'; iconv_close(cd); diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index df0634e4fcf..7c48d000d39 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -104,7 +104,7 @@ static struct ListBase *dirbase = &dirbase_; char *BLI_current_working_dir(char *dir, const int maxncpy) { const char *pwd= getenv("PWD"); - if (pwd){ + if (pwd) { BLI_strncpy(dir, pwd, maxncpy); return dir; } @@ -117,12 +117,12 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2) { /* type is equal to stat.st_mode */ - if (S_ISDIR(entry1->type)){ + if (S_ISDIR(entry1->type)) { if (S_ISDIR(entry2->type)==0) return (-1); } else{ if (S_ISDIR(entry2->type)) return (1); } - if (S_ISREG(entry1->type)){ + if (S_ISREG(entry1->type)) { if (S_ISREG(entry2->type)==0) return (-1); } else{ if (S_ISREG(entry2->type)) return (1); @@ -175,7 +175,7 @@ double BLI_dir_free_space(const char *dir) strcpy(name,dir); - if(len){ + if(len) { slash = strrchr(name,'/'); if (slash) slash[1] = 0; } else strcpy(name,"/"); @@ -206,20 +206,20 @@ static void bli_builddir(const char *dirname, const char *relname) BLI_strncpy(buf, relname, sizeof(buf)); rellen=strlen(relname); - if (rellen){ + if (rellen) { buf[rellen]='/'; rellen++; } - if (chdir(dirname) == -1){ + if (chdir(dirname) == -1) { perror(dirname); return; } - if ( (dir = (DIR *)opendir(".")) ){ + if ( (dir = (DIR *)opendir(".")) ) { while ((fname = (struct dirent*) readdir(dir)) != NULL) { dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - if (dlink){ + if (dlink) { BLI_strncpy(buf + rellen ,fname->d_name, sizeof(buf) - rellen); dlink->name = BLI_strdup(buf); BLI_addhead(dirbase,dlink); @@ -227,7 +227,7 @@ static void bli_builddir(const char *dirname, const char *relname) } } - if (newnum){ + if (newnum) { if(files) { void *tmp= realloc(files, (totnum+newnum) * sizeof(struct direntry)); @@ -243,9 +243,9 @@ static void bli_builddir(const char *dirname, const char *relname) if(files==NULL) files=(struct direntry *)malloc(newnum * sizeof(struct direntry)); - if (files){ + if (files) { dlink = (struct dirlink *) dirbase->first; - while(dlink){ + while(dlink) { memset(&files[actnum], 0 , sizeof(struct direntry)); files[actnum].relname = dlink->name; files[actnum].path = BLI_strdupcat(dirname, dlink->name); @@ -298,7 +298,7 @@ static void bli_adddirstrings(void) struct tm *tm; time_t zero= 0; - for(num=0, file= files; num<actnum; num++, file++){ + for(num=0, file= files; num<actnum; num++, file++) { #ifdef WIN32 mode = 0; BLI_strncpy(file->mode1, types[0], sizeof(file->mode1)); @@ -313,14 +313,14 @@ static void bli_adddirstrings(void) if (((mode & S_ISGID) == S_ISGID) && (file->mode2[2]=='-'))file->mode2[2]='l'; - if (mode & (S_ISUID | S_ISGID)){ + if (mode & (S_ISUID | S_ISGID)) { if (file->mode1[2]=='x') file->mode1[2]='s'; else file->mode1[2]='S'; if (file->mode2[2]=='x')file->mode2[2]='s'; } - if (mode & S_ISVTX){ + if (mode & S_ISVTX) { if (file->mode3[2] == 'x') file->mode3[2] = 't'; else file->mode3[2] = 'T'; } |