From 6214c7262fe2d31553a4974022e08a7715693014 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 15 Jun 2009 19:19:29 +0100 Subject: mesa: Use type modifier for float constants. --- src/mesa/main/texgetimage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/texgetimage.c') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 70a25080cb..58421c8528 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -73,8 +73,8 @@ linear_to_nonlinear(GLfloat cl) { /* can't have values outside [0, 1] */ GLfloat cs; - if (cl < 0.0031308) { - cs = 12.92 * cl; + if (cl < 0.0031308f) { + cs = 12.92f * cl; } else { cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055; -- cgit v1.2.3 From 053d8eb8914cae274ccd19abb0a492e7ca220660 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 15 Jun 2009 19:20:05 +0100 Subject: mesa: Use appropriate float/integer types. --- src/mesa/main/texformat_tmp.h | 4 ++-- src/mesa/main/texgetimage.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/main/texgetimage.c') diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 1020624faa..eb160deff9 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1347,7 +1347,7 @@ static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, const GLubyte cb = *src0 & 0xff; /* chroma U */ const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ const GLubyte cr = *src1 & 0xff; /* chroma V */ - const GLfloat y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); @@ -1388,7 +1388,7 @@ static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ const GLubyte y1 = *src1 & 0xff; /* luminance */ const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ - const GLfloat y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 58421c8528..02409d8009 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -77,7 +77,7 @@ linear_to_nonlinear(GLfloat cl) cs = 12.92f * cl; } else { - cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055; + cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055); } return cs; } -- cgit v1.2.3