mesa: Fix compiler warnings

Add explicit casts, fix constant types, fix variable types.
Fixes about 340 warnings in MSFT Visual Studio.
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 @@
 					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 @@
 
    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 @@
                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 @@
 		  /* 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 @@
 {
    /* 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 @@
    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_identifier_str(ctx, &flt);
-   flt = strdup(flt);
+   flt = _mesa_strdup(flt);
    if (!flt) {
       return 0;
    }