Commit 42e31a42 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Fix a few sign compare warnings.

parent 59c59628
......@@ -55,7 +55,7 @@ void context_bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo)
static void context_destroy_fbo(IWineD3DDeviceImpl *This, const GLuint *fbo)
{
int i = 0;
unsigned int i;
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, *fbo));
checkGLcall("glBindFramebuffer()");
......@@ -641,7 +641,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
HPBUFFERARB pbuffer = NULL;
HGLRC ctx = NULL, oldCtx;
WineD3DContext *ret = NULL;
int s;
unsigned int s;
TRACE("(%p): Creating a %s context for render target %p\n", This, create_pbuffer ? "offscreen" : "onscreen", target);
......
......@@ -437,7 +437,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DStateBlockImpl *object;
int i, j;
unsigned int i, j;
HRESULT temp_result;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
......@@ -3756,13 +3756,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantB(
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
int i, cnt = min(count, MAX_CONST_B - start);
unsigned int i, cnt = min(count, MAX_CONST_B - start);
TRACE("(iface %p, srcData %p, start %d, count %d)\n",
iface, srcData, start, count);
if (srcData == NULL || cnt < 0)
return WINED3DERR_INVALIDCALL;
if (!srcData || start >= MAX_CONST_B) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->vertexShaderConstantB[start], srcData, cnt * sizeof(BOOL));
for (i = 0; i < cnt; i++)
......@@ -3803,13 +3802,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantI(
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
int i, cnt = min(count, MAX_CONST_I - start);
unsigned int i, cnt = min(count, MAX_CONST_I - start);
TRACE("(iface %p, srcData %p, start %d, count %d)\n",
iface, srcData, start, count);
if (srcData == NULL || cnt < 0)
return WINED3DERR_INVALIDCALL;
if (!srcData || start >= MAX_CONST_I) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->vertexShaderConstantI[start * 4], srcData, cnt * sizeof(int) * 4);
for (i = 0; i < cnt; i++)
......@@ -3956,7 +3954,7 @@ static void device_update_fixed_function_usage_map(IWineD3DDeviceImpl *This) {
}
static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
int i, tex;
unsigned int i, tex;
WORD ffu_map;
device_update_fixed_function_usage_map(This);
......@@ -3996,7 +3994,7 @@ static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
static void device_map_psamplers(IWineD3DDeviceImpl *This) {
const DWORD *sampler_tokens =
((IWineD3DPixelShaderImpl *)This->stateBlock->pixelShader)->baseShader.reg_maps.samplers;
int i;
unsigned int i;
for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) {
if (sampler_tokens[i] && This->texUnitMap[i] != i) {
......@@ -4150,13 +4148,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantB(
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
int i, cnt = min(count, MAX_CONST_B - start);
unsigned int i, cnt = min(count, MAX_CONST_B - start);
TRACE("(iface %p, srcData %p, start %d, count %d)\n",
TRACE("(iface %p, srcData %p, start %u, count %u)\n",
iface, srcData, start, count);
if (srcData == NULL || cnt < 0)
return WINED3DERR_INVALIDCALL;
if (!srcData || start >= MAX_CONST_B) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->pixelShaderConstantB[start], srcData, cnt * sizeof(BOOL));
for (i = 0; i < cnt; i++)
......@@ -4197,13 +4194,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantI(
UINT count) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
int i, cnt = min(count, MAX_CONST_I - start);
unsigned int i, cnt = min(count, MAX_CONST_I - start);
TRACE("(iface %p, srcData %p, start %d, count %d)\n",
TRACE("(iface %p, srcData %p, start %u, count %u)\n",
iface, srcData, start, count);
if (srcData == NULL || cnt < 0)
return WINED3DERR_INVALIDCALL;
if (!srcData || start >= MAX_CONST_I) return WINED3DERR_INVALIDCALL;
memcpy(&This->updateStateBlock->pixelShaderConstantI[start * 4], srcData, cnt * sizeof(int) * 4);
for (i = 0; i < cnt; i++)
......@@ -4758,7 +4754,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
}
if(Type == WINED3DTSS_COLOROP) {
int i;
unsigned int i;
if(Value == WINED3DTOP_DISABLE && oldValue != WINED3DTOP_DISABLE) {
/* Previously enabled stage disabled now. Make sure to dirtify all enabled stages above Stage,
......@@ -4767,11 +4763,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
* The current stage is dirtified below.
*/
for(i = Stage + 1; i < This->stateBlock->lowest_disabled_stage; i++) {
TRACE("Additionally dirtifying stage %d\n", i);
TRACE("Additionally dirtifying stage %u\n", i);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP));
}
This->stateBlock->lowest_disabled_stage = Stage;
TRACE("New lowest disabled: %d\n", Stage);
TRACE("New lowest disabled: %u\n", Stage);
} else if(Value != WINED3DTOP_DISABLE && oldValue == WINED3DTOP_DISABLE) {
/* Previously disabled stage enabled. Stages above it may need enabling
* stage must be lowest_disabled_stage here, if it's bigger success is returned above,
......@@ -4784,11 +4780,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
if(This->updateStateBlock->textureState[i][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE) {
break;
}
TRACE("Additionally dirtifying stage %d due to enable\n", i);
TRACE("Additionally dirtifying stage %u due to enable\n", i);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP));
}
This->stateBlock->lowest_disabled_stage = i;
TRACE("New lowest disabled: %d\n", i);
TRACE("New lowest disabled: %u\n", i);
}
}
......
......@@ -95,15 +95,15 @@ struct glsl_shader_prog_link {
struct list vshader_entry;
struct list pshader_entry;
GLhandleARB programId;
GLhandleARB *vuniformF_locations;
GLhandleARB *puniformF_locations;
GLhandleARB vuniformI_locations[MAX_CONST_I];
GLhandleARB puniformI_locations[MAX_CONST_I];
GLhandleARB posFixup_location;
GLhandleARB bumpenvmat_location[MAX_TEXTURES];
GLhandleARB luminancescale_location[MAX_TEXTURES];
GLhandleARB luminanceoffset_location[MAX_TEXTURES];
GLhandleARB ycorrection_location;
GLint *vuniformF_locations;
GLint *puniformF_locations;
GLint vuniformI_locations[MAX_CONST_I];
GLint puniformI_locations[MAX_CONST_I];
GLint posFixup_location;
GLint bumpenvmat_location[MAX_TEXTURES];
GLint luminancescale_location[MAX_TEXTURES];
GLint luminanceoffset_location[MAX_TEXTURES];
GLint ycorrection_location;
GLenum vertex_color_clamp;
IWineD3DVertexShader *vshader;
IWineD3DPixelShader *pshader;
......@@ -180,7 +180,7 @@ static void print_glsl_info_log(const WineD3D_GL_Info *gl_info, GLhandleARB obj)
*/
static void shader_glsl_load_psamplers(const WineD3D_GL_Info *gl_info, DWORD *tex_unit_map, GLhandleARB programId)
{
GLhandleARB name_loc;
GLint name_loc;
int i;
char sampler_name[20];
......@@ -203,7 +203,7 @@ static void shader_glsl_load_psamplers(const WineD3D_GL_Info *gl_info, DWORD *te
static void shader_glsl_load_vsamplers(const WineD3D_GL_Info *gl_info, DWORD *tex_unit_map, GLhandleARB programId)
{
GLhandleARB name_loc;
GLint name_loc;
char sampler_name[20];
int i;
......@@ -225,7 +225,7 @@ static void shader_glsl_load_vsamplers(const WineD3D_GL_Info *gl_info, DWORD *te
}
static inline void walk_constant_heap(const WineD3D_GL_Info *gl_info, const float *constants,
const GLhandleARB *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
{
int stack_idx = 0;
unsigned int heap_idx = 1;
......@@ -300,7 +300,7 @@ static inline void apply_clamped_constant(const WineD3D_GL_Info *gl_info, GLint
}
static inline void walk_constant_heap_clamped(const WineD3D_GL_Info *gl_info, const float *constants,
const GLhandleARB *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
{
int stack_idx = 0;
unsigned int heap_idx = 1;
......@@ -360,7 +360,7 @@ static inline void walk_constant_heap_clamped(const WineD3D_GL_Info *gl_info, co
/* Loads floating point constants (aka uniforms) into the currently set GLSL program. */
static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info,
const float *constants, const GLhandleARB *constant_locations, const struct constant_heap *heap,
const float *constants, const GLint *constant_locations, const struct constant_heap *heap,
unsigned char *stack, UINT version)
{
const local_constant *lconst;
......@@ -381,7 +381,7 @@ static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const Wine
/* Immediate constants are clamped to [-1;1] at shader creation time if needed */
LIST_FOR_EACH_ENTRY(lconst, &This->baseShader.constantsF, local_constant, entry)
{
GLhandleARB location = constant_locations[lconst->idx];
GLint location = constant_locations[lconst->idx];
/* We found this uniform name in the program - go ahead and send the data */
if (location != -1) GL_EXTCALL(glUniform4fvARB(location, 1, (const GLfloat *)lconst->value));
}
......@@ -390,7 +390,7 @@ static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const Wine
/* Loads integer constants (aka uniforms) into the currently set GLSL program. */
static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info,
const GLhandleARB locations[MAX_CONST_I], const int *constants, WORD constants_set)
const GLint locations[MAX_CONST_I], const int *constants, WORD constants_set)
{
unsigned int i;
struct list* ptr;
......@@ -428,7 +428,7 @@ static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const Wine
static void shader_glsl_load_constantsB(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info,
GLhandleARB programId, const BOOL *constants, WORD constants_set)
{
GLhandleARB tmp_loc;
GLint tmp_loc;
unsigned int i;
char tmp_name[8];
char is_pshader = shader_is_pshader_version(This->baseShader.reg_maps.shader_version);
......@@ -3032,7 +3032,9 @@ static void handle_ps3_input(SHADER_BUFFER *buffer, const struct semantic *seman
if (in_idx >= (in_count + 2)) {
FIXME("More input varyings declared than supported, expect issues\n");
continue;
} else if(map[i] == -1) {
}
else if (map[i] == ~0U)
{
/* Declared, but not read register */
continue;
}
......@@ -3310,7 +3312,7 @@ static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, const WineD
GLhandleARB programId, char prefix)
{
const local_constant *lconst;
GLuint tmp_loc;
GLint tmp_loc;
const float *value;
char glsl_name[8];
......@@ -3340,7 +3342,7 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
struct glsl_shader_prog_link *entry = NULL;
GLhandleARB programId = 0;
GLhandleARB reorder_shader_id = 0;
int i;
unsigned int i;
char glsl_name[8];
GLhandleARB vshader_id, pshader_id;
struct ps_compile_args ps_compile_args;
......@@ -3390,7 +3392,7 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
/* Attach GLSL vshader */
if (vshader_id) {
int max_attribs = 16; /* TODO: Will this always be the case? It is at the moment... */
const unsigned int max_attribs = 16; /* TODO: Will this always be the case? It is at the moment... */
char tmp_name[10];
reorder_shader_id = generate_param_reorder_function(vshader, pshader, gl_info);
......@@ -3635,7 +3637,7 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface, enum tex_types t
GLhandleARB *blt_program = &priv->depth_blt_program[tex_type];
if (!*blt_program) {
GLhandleARB loc;
GLint loc;
*blt_program = create_glsl_blt_shader(gl_info, tex_type);
loc = GL_EXTCALL(glGetUniformLocationARB(*blt_program, "sampler"));
GL_EXTCALL(glUseProgramObjectARB(*blt_program));
......
......@@ -354,7 +354,7 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
for (i = 0; i < MAX_REG_INPUT; ++i)
{
if (This->input_reg_used[i]) This->input_reg_map[i] = This->declared_in_count++;
else This->input_reg_map[i] = -1;
else This->input_reg_map[i] = ~0U;
}
}
......
......@@ -3034,7 +3034,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W
}
static void unloadTexCoords(IWineD3DStateBlockImpl *stateblock) {
int texture_idx;
unsigned int texture_idx;
for (texture_idx = 0; texture_idx < GL_LIMITS(texture_stages); ++texture_idx) {
GL_EXTCALL(glClientActiveTextureARB(GL_TEXTURE0_ARB + texture_idx));
......@@ -3579,7 +3579,7 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, W
GL_EXTCALL(glVertexBlendARB(stateblock->renderState[WINED3DRS_VERTEXBLEND] + 1));
if(!stateblock->wineD3DDevice->vertexBlendUsed) {
int i;
unsigned int i;
for(i = 1; i < GL_LIMITS(blends); i++) {
if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(i)))) {
transform_worldex(STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(i)), stateblock, context);
......@@ -4434,7 +4434,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
}
} else {
if(!context->last_was_vshader) {
int i;
unsigned int i;
static BOOL warned = FALSE;
/* Disable all clip planes to get defined results on all drivers. See comment in the
* state_clipping state handler
......
......@@ -283,7 +283,7 @@ static void WINAPI IWineD3DTextureImpl_ApplyStateChanges(IWineD3DTexture *iface,
******************************************* */
static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
int i;
unsigned int i;
TRACE("(%p) : Cleaning up\n",This);
for (i = 0; i < This->baseTexture.levels; i++) {
......
......@@ -211,7 +211,7 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
const WINED3DVERTEXELEMENT *elements, UINT element_count) {
IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
HRESULT hr = WINED3D_OK;
int i;
unsigned int i;
char isPreLoaded[MAX_STREAMS];
TRACE("(%p) : d3d version %d\n", This, ((IWineD3DImpl *)This->wineD3DDevice->wineD3D)->dxVersion);
......
......@@ -368,7 +368,7 @@ static void WINAPI IWineD3DVertexShaderImpl_FakeSemantics(IWineD3DVertexShader *
IWineD3DVertexShaderImpl *This =(IWineD3DVertexShaderImpl *)iface;
IWineD3DVertexDeclarationImpl* vdecl = (IWineD3DVertexDeclarationImpl*)vertex_declaration;
int i;
unsigned int i;
for (i = 0; i < vdecl->declarationWNumElements - 1; ++i) {
const WINED3DVERTEXELEMENT *element = vdecl->pDeclarationWine + i;
vshader_set_input(This, element->Reg, element->Usage, element->UsageIndex);
......
......@@ -92,7 +92,7 @@ static DWORD WINAPI IWineD3DVolumeTextureImpl_GetPriority(IWineD3DVolumeTexture
void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRGB srgb) {
/* Overrider the IWineD3DResource Preload method */
int i;
unsigned int i;
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
BOOL srgb_mode = This->baseTexture.is_srgb;
......@@ -225,7 +225,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_ApplyStateChanges(IWineD3DVolumeTex
******************************************* */
static void WINAPI IWineD3DVolumeTextureImpl_Destroy(IWineD3DVolumeTexture *iface, D3DCB_DESTROYVOLUMEFN D3DCB_DestroyVolume) {
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
int i;
unsigned int i;
TRACE("(%p) : Cleaning up\n",This);
for (i = 0; i < This->baseTexture.levels; i++) {
if (This->volumes[i] != NULL) {
......
......@@ -2424,7 +2424,7 @@ typedef struct IWineD3DPixelShaderImpl {
/* Some information about the shader behavior */
struct stb_const_desc bumpenvmatconst[MAX_TEXTURES];
char numbumpenvmatconsts;
unsigned char numbumpenvmatconsts;
struct stb_const_desc luminanceconst[MAX_TEXTURES];
char vpos_uniform;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment