From b30898f4ab533085d97a33638ad0a1cf9ddb1d67 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Sat, 13 Feb 2010 17:31:58 -0700 Subject: mesa: Fix compiler warnings Add explicit casts, fix constant types, fix variable types. Fixes about 340 warnings in MSFT Visual Studio. --- src/mesa/main/image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/main/image.c') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 81993e7063..468f2a9b21 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -5662,7 +5662,7 @@ clip_right_or_top(GLint *srcX0, GLint *srcX1, /* chop off [t, 1] part */ ASSERT(t >= 0.0 && t <= 1.0); *dstX1 = maxValue; - bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; + bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; *srcX1 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); } else if (*dstX0 > maxValue) { @@ -5672,7 +5672,7 @@ clip_right_or_top(GLint *srcX0, GLint *srcX1, /* chop off [t, 1] part */ ASSERT(t >= 0.0 && t <= 1.0); *dstX0 = maxValue; - bias = (*srcX0 < *srcX1) ? -0.5 : 0.5; + bias = (*srcX0 < *srcX1) ? -0.5F : 0.5F; *srcX0 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); } } @@ -5695,7 +5695,7 @@ clip_left_or_bottom(GLint *srcX0, GLint *srcX1, /* chop off [0, t] part */ ASSERT(t >= 0.0 && t <= 1.0); *dstX0 = minValue; - bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; /* flipped??? */ + bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; /* flipped??? */ *srcX0 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); } else if (*dstX1 < minValue) { @@ -5705,7 +5705,7 @@ clip_left_or_bottom(GLint *srcX0, GLint *srcX1, /* chop off [0, t] part */ ASSERT(t >= 0.0 && t <= 1.0); *dstX1 = minValue; - bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; + bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; *srcX1 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); } } -- cgit v1.2.3