Stefan Dösinger : wined3d: Fix a few MSVC data loss warnings.
Alexandre Julliard
julliard at winehq.org
Fri May 13 11:17:50 CDT 2011
Module: wine
Branch: master
Commit: a549b8f09084ec198573222ebc1d2390b88fd197
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a549b8f09084ec198573222ebc1d2390b88fd197
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Thu May 12 18:05:27 2011 +0200
wined3d: Fix a few MSVC data loss warnings.
---
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/gl_compat.c | 12 ++++++------
dlls/wined3d/glsl_shader.c | 2 +-
dlls/wined3d/surface.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index cbfd938..5915ea1 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -274,7 +274,7 @@ static void drawStridedSlow(IWineD3DDeviceImpl *device, const struct wined3d_con
if (specular_fog)
{
DWORD specularColor = *(const DWORD *)ptrToCoords;
- GL_EXTCALL(glFogCoordfEXT(specularColor >> 24));
+ GL_EXTCALL(glFogCoordfEXT((float) (specularColor >> 24)));
}
}
diff --git a/dlls/wined3d/gl_compat.c b/dlls/wined3d/gl_compat.c
index 0f8eaba..5756445 100644
--- a/dlls/wined3d/gl_compat.c
+++ b/dlls/wined3d/gl_compat.c
@@ -178,9 +178,9 @@ static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
}
} else {
if(pname == GL_FOG_START) {
- ctx->fogstart = param;
+ ctx->fogstart = (float) param;
} else if(pname == GL_FOG_END) {
- ctx->fogend = param;
+ ctx->fogend = (float) param;
}
old_fogcoord_glFogi(pname, param);
}
@@ -199,9 +199,9 @@ static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
}
} else {
if(pname == GL_FOG_START) {
- ctx->fogstart = *param;
+ ctx->fogstart = (float) *param;
} else if(pname == GL_FOG_END) {
- ctx->fogend = *param;
+ ctx->fogend = (float) *param;
}
old_fogcoord_glFogiv(pname, param);
}
@@ -331,13 +331,13 @@ static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) {
ctx->fog_coord_value = f;
}
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f) {
- wine_glFogCoordfEXT(f);
+ wine_glFogCoordfEXT((GLfloat) f);
}
static void WINE_GLAPI wine_glFogCoordfvEXT(const GLfloat *f) {
wine_glFogCoordfEXT(*f);
}
static void WINE_GLAPI wine_glFogCoorddvEXT(const GLdouble *f) {
- wine_glFogCoordfEXT(*f);
+ wine_glFogCoordfEXT((GLfloat) *f);
}
/* End GL_EXT_fog_coord emulation */
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index f1049a3..41e1e62 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -829,7 +829,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
correction_params[1] = 1.0f;
} else {
/* position is window relative, not viewport relative */
- correction_params[0] = context->current_rt->resource.height;
+ correction_params[0] = (float) context->current_rt->resource.height;
correction_params[1] = -1.0f;
}
GL_EXTCALL(glUniform4fvARB(prog->ycorrection_location, 1, correction_params));
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 05e4631..d03a5e5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2554,7 +2554,7 @@ HRESULT surface_load(struct wined3d_surface *surface, BOOL srgb)
static inline unsigned short float_32_to_16(const float *in)
{
int exp = 0;
- float tmp = fabs(*in);
+ float tmp = fabsf(*in);
unsigned int mantissa;
unsigned short ret;
More information about the wine-cvs
mailing list