diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 00:18:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 00:18:09 +0400 |
commit | 7ff77ed4ea7c6d8fb8b2e75320175b9cbd6ff20a (patch) | |
tree | fcdb22c3f2fa64e08a6cf8182b80405ab0e141f9 /source/blender/blenkernel | |
parent | 402a9d59383d68bff72b3c9da3e53f3e5abcd578 (diff) |
code cleanup: use zero_v3
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/editderivedmesh.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 20 |
6 files changed, 26 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index dab6ad27f3f..3fef7813408 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -185,8 +185,10 @@ static void cdDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) for (i=0; i<dm->numVertData; i++) { DO_MINMAX(cddm->mvert[i].co, min_r, max_r); } - } else { - min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0; + } + else { + zero_v3(min_r); + zero_v3(max_r); } } diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 3bbc66efe5f..93e6fa678f3 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -486,10 +486,10 @@ static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3 DO_INLINE void collision_interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float v3[3], double w1, double w2, double w3 ) { - to[0] = to[1] = to[2] = 0; - VECADDMUL ( to, v1, w1 ); - VECADDMUL ( to, v2, w2 ); - VECADDMUL ( to, v3, w3 ); + zero_v3(to); + VECADDMUL(to, v1, w1); + VECADDMUL(to, v2, w2); + VECADDMUL(to, v3, w3); } #ifndef WITH_ELTOPO diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 666a5cf3054..dbc1335ebcd 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2878,7 +2878,7 @@ static void minmax_new_data (void *cdata) data->minmaxflag = TRACK_Z; data->offset = 0.0f; - data->cache[0] = data->cache[1] = data->cache[2] = 0.0f; + zero_v3(data->cache); data->flag = 0; } @@ -3535,10 +3535,9 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr target->release(target); - if(fail == TRUE) - { + if (fail == TRUE) { /* Don't move the point */ - co[0] = co[1] = co[2] = 0.0f; + zero_v3(co); } /* co is in local object coordinates, change it to global and update target position */ diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 0a10b894551..1b6b95b4c85 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -155,9 +155,8 @@ Curve *add_curve(const char *name, int type) { Curve *cu; - cu= alloc_libblock(&G.main->curve, ID_CU, name); - - cu->size[0]= cu->size[1]= cu->size[2]= 1.0; + cu = alloc_libblock(&G.main->curve, ID_CU, name); + copy_v3_fl(cu->size, 1.0f); cu->flag= CU_FRONT|CU_BACK|CU_DEFORM_BOUNDS_OFF|CU_PATH_RADIUS; cu->pathlen= 100; cu->resolu= cu->resolv= (type == OB_SURF) ? 4 : 12; @@ -392,7 +391,7 @@ void tex_space_curve(Curve *cu) cu->size[1]= (max[1]-min[1])/2.0f; cu->size[2]= (max[2]-min[2])/2.0f; - cu->rot[0]= cu->rot[1]= cu->rot[2]= 0.0f; + zero_v3(cu->rot); if(cu->size[0]==0.0f) cu->size[0]= 1.0f; else if(cu->size[0]>0.0f && cu->size[0]<0.00001f) cu->size[0]= 0.00001f; diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 113e428ce47..693a155c23d 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -1250,7 +1250,8 @@ static void emDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) } } else { - min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0; + zero_v3(min_r); + zero_v3(max_r); } } static int emDM_getNumVerts(DerivedMesh *dm) diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index b24b885c001..f42220780b9 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -2205,8 +2205,8 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, for (x=0;x<halfWidth;x++) { index=(x+y*width)*4; fx=0; - curColor[0]=curColor[1]=curColor[2]=0; - curColor2[0]=curColor2[1]=curColor2[2]=0; + zero_v3(curColor); + zero_v3(curColor2); for (i=x-halfWidth;i<x+halfWidth;i++) { if ((i>=0)&&(i<width)) { @@ -2236,7 +2236,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, for (x=halfWidth;x<width-halfWidth;x++) { index=(x+y*width)*4; fx=0; - curColor[0]=curColor[1]=curColor[2]=0; + zero_v3(curColor); for (i=x-halfWidth;i<x+halfWidth;i++) { curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx]; curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx]; @@ -2259,8 +2259,8 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, for (y=0;y<halfWidth;y++) { index=(x+y*width)*4; fy=0; - curColor[0]=curColor[1]=curColor[2]=0; - curColor2[0]=curColor2[1]=curColor2[2]=0; + zero_v3(curColor); + zero_v3(curColor2); for (i=y-halfWidth;i<y+halfWidth;i++) { if ((i>=0)&&(i<height)) { /* Bottom */ @@ -2289,7 +2289,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, for (y=halfWidth;y<height-halfWidth;y++) { index=(x+y*width)*4; fy=0; - curColor[0]=curColor[1]=curColor[2]=0; + zero_v3(curColor); for (i=y-halfWidth;i<y+halfWidth;i++) { curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy]; curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy]; @@ -2406,7 +2406,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height, for (x=halfWidth;x<width-halfWidth;x++) { index=(x+y*width)*4; fx=0; - curColor[0]=curColor[1]=curColor[2]=0; + zero_v3(curColor); for (i=x-halfWidth;i<x+halfWidth;i++) { curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx]; curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx]; @@ -2429,8 +2429,8 @@ static void RVBlurBitmap2_float ( float* map, int width,int height, for (y=0;y<halfWidth;y++) { index=(x+y*width)*4; fy=0; - curColor[0]=curColor[1]=curColor[2]=0; - curColor2[0]=curColor2[1]=curColor2[2]=0; + zero_v3(curColor); + zero_v3(curColor2); for (i=y-halfWidth;i<y+halfWidth;i++) { if ((i>=0)&&(i<height)) { /* Bottom */ @@ -2459,7 +2459,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height, for (y=halfWidth;y<height-halfWidth;y++) { index=(x+y*width)*4; fy=0; - curColor[0]=curColor[1]=curColor[2]=0; + zero_v3(curColor); for (i=y-halfWidth;i<y+halfWidth;i++) { curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy]; curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy]; |