diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-11 16:00:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-11 16:00:08 +0400 |
commit | 094c9799f9926ae37515a1fe0380403ce3298a77 (patch) | |
tree | 780f06d65010a80ae7d3c67000af00db89d11a32 /source/blender/blenlib | |
parent | eb7bccb39a639683275ed0b80b927cd5eb8264fa (diff) |
quiet -Wdouble-promotion warnings
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 28 |
2 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 241ab62e175..b2c9a5706a3 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -426,9 +426,9 @@ void mul_m3_v3_double(float mat[][3], double vec[3]) x=vec[0]; y=vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; + vec[0]= x*(double)mat[0][0] + y*(double)mat[1][0] + (double)mat[2][0]*vec[2]; + vec[1]= x*(double)mat[0][1] + y*(double)mat[1][1] + (double)mat[2][1]*vec[2]; + vec[2]= x*(double)mat[0][2] + y*(double)mat[1][2] + (double)mat[2][2]*vec[2]; } void add_m3_m3m3(float m1[][3], float m2[][3], float m3[][3]) diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 7fecbae8229..1637cd16161 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -211,7 +211,7 @@ void quat_to_mat4(float m[][4], const float q[4]) double q0, q1, q2, q3, qda,qdb,qdc,qaa,qab,qac,qbb,qbc,qcc; #ifdef DEBUG - if(!((q0=dot_qtqt(q, q))==0.0f || (fabs(q0-1.0) < QUAT_EPSILON))) { + if(!((q0=dot_qtqt(q, q))==0.0f || (fabsf(q0-1.0) < QUAT_EPSILON))) { fprintf(stderr, "Warning! quat_to_mat4() called with non-normalized: size %.8f *** report a bug ***\n", (float)q0); } #endif @@ -257,7 +257,7 @@ void mat3_to_quat(float *q, float wmat[][3]) /* work on a copy */ copy_m3_m3(mat, wmat); - normalize_m3(mat); /* this is needed AND a NormalQuat in the end */ + normalize_m3(mat); /* this is needed AND a 'normalize_qt' in the end */ tr= 0.25* (double)(1.0f+mat[0][0]+mat[1][1]+mat[2][2]); @@ -271,31 +271,31 @@ void mat3_to_quat(float *q, float wmat[][3]) } else { if(mat[0][0] > mat[1][1] && mat[0][0] > mat[2][2]) { - s= 2.0*sqrtf(1.0f + mat[0][0] - mat[1][1] - mat[2][2]); + s= 2.0f*sqrtf(1.0f + mat[0][0] - mat[1][1] - mat[2][2]); q[1]= (float)(0.25*s); s= 1.0/s; - q[0]= (float)((mat[2][1] - mat[1][2])*s); - q[2]= (float)((mat[1][0] + mat[0][1])*s); - q[3]= (float)((mat[2][0] + mat[0][2])*s); + q[0]= (float)((double)(mat[2][1] - mat[1][2])*s); + q[2]= (float)((double)(mat[1][0] + mat[0][1])*s); + q[3]= (float)((double)(mat[2][0] + mat[0][2])*s); } else if(mat[1][1] > mat[2][2]) { - s= 2.0*sqrtf(1.0f + mat[1][1] - mat[0][0] - mat[2][2]); + s= 2.0f*sqrtf(1.0f + mat[1][1] - mat[0][0] - mat[2][2]); q[2]= (float)(0.25*s); s= 1.0/s; - q[0]= (float)((mat[2][0] - mat[0][2])*s); - q[1]= (float)((mat[1][0] + mat[0][1])*s); - q[3]= (float)((mat[2][1] + mat[1][2])*s); + q[0]= (float)((double)(mat[2][0] - mat[0][2])*s); + q[1]= (float)((double)(mat[1][0] + mat[0][1])*s); + q[3]= (float)((double)(mat[2][1] + mat[1][2])*s); } else { - s= 2.0*sqrtf(1.0 + mat[2][2] - mat[0][0] - mat[1][1]); + s= 2.0f*sqrtf(1.0f + mat[2][2] - mat[0][0] - mat[1][1]); q[3]= (float)(0.25*s); s= 1.0/s; - q[0]= (float)((mat[1][0] - mat[0][1])*s); - q[1]= (float)((mat[2][0] + mat[0][2])*s); - q[2]= (float)((mat[2][1] + mat[1][2])*s); + q[0]= (float)((double)(mat[1][0] - mat[0][1])*s); + q[1]= (float)((double)(mat[2][0] + mat[0][2])*s); + q[2]= (float)((double)(mat[2][1] + mat[1][2])*s); } } |