diff options
author | Brian Paul <[email protected]> | 2013-06-26 09:27:34 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-06-26 10:42:59 -0600 |
commit | 21f8729c3da4443b2db00da20f5afd880362701e (patch) | |
tree | 166d4f4798cfbca2d2dc7457da159ddb70ee9421 /src/gallium/state_trackers/vega/matrix.h | |
parent | 4d452f1988931e7101146d1cf2807c2a02437dbb (diff) |
vega: add some casts to silence MSVC warnings
Diffstat (limited to 'src/gallium/state_trackers/vega/matrix.h')
-rw-r--r-- | src/gallium/state_trackers/vega/matrix.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/vega/matrix.h b/src/gallium/state_trackers/vega/matrix.h index bed2b3193d0..794c7e7a4ce 100644 --- a/src/gallium/state_trackers/vega/matrix.h +++ b/src/gallium/state_trackers/vega/matrix.h @@ -221,9 +221,9 @@ static INLINE void matrix_rotate(struct matrix *dst, else if (floatsEqual(angle, 180)) cos_val = -1.f; else { - float radians = DEGREES_TO_RADIANS(angle); - sin_val = sin(radians); - cos_val = cos(radians); + double radians = DEGREES_TO_RADIANS(angle); + sin_val = (float) sin(radians); + cos_val = (float) cos(radians); } if (!matrix_is_affine(dst)) { @@ -410,7 +410,7 @@ static INLINE void line_normalize(float *l) { float x = l[2] - l[0]; float y = l[3] - l[1]; - float len = sqrt(x*x + y*y); + float len = (float) sqrt(x*x + y*y); l[2] = l[0] + x/len; l[3] = l[1] + y/len; } @@ -420,14 +420,14 @@ static INLINE VGfloat line_length(VGfloat x1, VGfloat y1, { VGfloat x = x2 - x1; VGfloat y = y2 - y1; - return sqrt(x*x + y*y); + return (VGfloat) sqrt(x*x + y*y); } static INLINE VGfloat line_lengthv(const VGfloat *l) { VGfloat x = l[2] - l[0]; VGfloat y = l[3] - l[1]; - return sqrt(x*x + y*y); + return (VGfloat) sqrt(x*x + y*y); } @@ -442,7 +442,7 @@ static INLINE void line_point_at(float *l, float t, float *pt) static INLINE void vector_unit(float *vec) { - float len = sqrt(vec[0] * vec[0] + vec[1] * vec[1]); + float len = (float) sqrt(vec[0] * vec[0] + vec[1] * vec[1]); vec[0] /= len; vec[1] /= len; } |