diff options
author | Karl Schultz <karl.w.schultz@gmail.com> | 2010-02-13 17:31:58 -0700 |
---|---|---|
committer | Karl Schultz <karl.w.schultz@gmail.com> | 2010-02-13 17:34:04 -0700 |
commit | b30898f4ab533085d97a33638ad0a1cf9ddb1d67 (patch) | |
tree | 7c27558e2905da625b75060628967d3d52fe6728 /src/mesa/shader | |
parent | 5fd2b46a20321d8600d6256bff17ec3ebc9cb510 (diff) | |
download | external_mesa3d-b30898f4ab533085d97a33638ad0a1cf9ddb1d67.zip external_mesa3d-b30898f4ab533085d97a33638ad0a1cf9ddb1d67.tar.gz external_mesa3d-b30898f4ab533085d97a33638ad0a1cf9ddb1d67.tar.bz2 |
mesa: Fix compiler warnings
Add explicit casts, fix constant types, fix variable types.
Fixes about 340 warnings in MSFT Visual Studio.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/nvprogram.c | 6 | ||||
-rw-r--r-- | src/mesa/shader/prog_execute.c | 12 | ||||
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 2 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 2 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 87f295e..c3b10f5 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -570,15 +570,15 @@ _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) inst->DstReg.Index + 1); } if (inst->SrcReg[0].File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2(program->NumTemporaries, + program->NumTemporaries = MAX2((GLint)program->NumTemporaries, inst->SrcReg[0].Index + 1); } if (inst->SrcReg[1].File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2(program->NumTemporaries, + program->NumTemporaries = MAX2((GLint)program->NumTemporaries, inst->SrcReg[1].Index + 1); } if (inst->SrcReg[2].File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2(program->NumTemporaries, + program->NumTemporaries = MAX2((GLint)program->NumTemporaries, inst->SrcReg[2].Index + 1); } } diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 7781cb3..aea4b07 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -599,13 +599,13 @@ store_vector4ui(const struct prog_instruction *inst, if (inst->CondUpdate) { if (writeMask & WRITEMASK_X) - machine->CondCodes[0] = generate_cc(value[0]); + machine->CondCodes[0] = generate_cc((float)value[0]); if (writeMask & WRITEMASK_Y) - machine->CondCodes[1] = generate_cc(value[1]); + machine->CondCodes[1] = generate_cc((float)value[1]); if (writeMask & WRITEMASK_Z) - machine->CondCodes[2] = generate_cc(value[2]); + machine->CondCodes[2] = generate_cc((float)value[2]); if (writeMask & WRITEMASK_W) - machine->CondCodes[3] = generate_cc(value[3]); + machine->CondCodes[3] = generate_cc((float)value[3]); #if DEBUG_PROG printf("CondCodes=(%s,%s,%s,%s) for:\n", _mesa_condcode_string(machine->CondCodes[0]), @@ -1000,7 +1000,7 @@ _mesa_execute_program(GLcontext * ctx, val = -FLT_MAX; } else { - val = log(a[0]) * 1.442695F; + val = (float)(log(a[0]) * 1.442695F); } result[0] = result[1] = result[2] = result[3] = val; store_vector4(inst, machine, result); @@ -1065,7 +1065,7 @@ _mesa_execute_program(GLcontext * ctx, /* The fast LOG2 macro doesn't meet the precision * requirements. */ - q[2] = (log(t[0]) * 1.442695F); + q[2] = (float)(log(t[0]) * 1.442695F); } } else { diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 5822510..d4970c4 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -209,7 +209,7 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, { /* first check if this is a duplicate constant */ GLint pos; - for (pos = 0; pos < paramList->NumParameters; pos++) { + for (pos = 0; pos < (GLint)paramList->NumParameters; pos++) { const GLfloat *pvals = paramList->ParameterValues[pos]; if (pvals[0] == values[0] && pvals[1] == values[1] && diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 83098b7..fe4bddf 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3117,7 +3117,7 @@ _slang_can_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) if (start >= end) return GL_FALSE; /* degenerate case */ - if (end - start > MAX_FOR_LOOP_UNROLL_ITERATIONS) { + if ((GLuint)(end - start) > MAX_FOR_LOOP_UNROLL_ITERATIONS) { slang_info_log_print(A->log, "Note: 'for (%s=%d; %s<%d; ++%s)' is too" " many iterations to unroll", diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 1dce3ad..33964e0 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -239,7 +239,7 @@ parse_general_number(slang_parse_ctx *ctx, float *number) } parse_identifier_str(ctx, &flt); - flt = strdup(flt); + flt = _mesa_strdup(flt); if (!flt) { return 0; } |