summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-07-15 11:44:47 +0200
committerMichal Krol <michal@tungstengraphics.com>2008-07-15 11:49:02 +0200
commitf9c574d7192d2193ff3e12629a8db1a74b6dbf55 (patch)
treecb128f689d953fc8b8fa21cd990ef478dfe757a6 /src/mesa/shader/slang
parent6c534b830c6f5427c391c5225c34561141c201ba (diff)
mesa: Silence compiler warnings on Windows.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c2
-rw-r--r--src/mesa/shader/slang/slang_print.c13
-rw-r--r--src/mesa/shader/slang/slang_simplify.c10
-rw-r--r--src/mesa/shader/slang/slang_vartable.c10
4 files changed, 16 insertions, 19 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index af45dfb2e8..425beefe85 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2623,7 +2623,7 @@ _slang_gen_subscript(slang_assemble_ctx * A, slang_operation *oper)
index = (GLint) oper->children[1].literal[0];
if (oper->children[1].type != SLANG_OPER_LITERAL_INT ||
- index >= max) {
+ index >= (GLint) max) {
slang_info_log_error(A->log, "Invalid array index for vector type");
return NULL;
}
diff --git a/src/mesa/shader/slang/slang_print.c b/src/mesa/shader/slang/slang_print.c
index ff9c62c929..f08c25ffdc 100644
--- a/src/mesa/shader/slang/slang_print.c
+++ b/src/mesa/shader/slang/slang_print.c
@@ -241,7 +241,7 @@ find_var(const slang_variable_scope *s, slang_atom name)
void
slang_print_tree(const slang_operation *op, int indent)
{
- int i;
+ GLuint i;
switch (op->type) {
@@ -261,13 +261,10 @@ slang_print_tree(const slang_operation *op, int indent)
case SLANG_OPER_BLOCK_NEW_SCOPE:
spaces(indent);
printf("{{ // new scope locals=%p: ", (void*)op->locals);
- {
- int i;
- for (i = 0; i < op->locals->num_variables; i++) {
- printf("%s ", (char *) op->locals->variables[i]->a_name);
- }
- printf("\n");
+ for (i = 0; i < op->locals->num_variables; i++) {
+ printf("%s ", (char *) op->locals->variables[i]->a_name);
}
+ printf("\n");
print_generic(op, NULL, indent+3);
spaces(indent);
printf("}}\n");
@@ -665,7 +662,7 @@ slang_print_tree(const slang_operation *op, int indent)
void
slang_print_function(const slang_function *f, GLboolean body)
{
- int i;
+ GLuint i;
#if 0
if (_mesa_strcmp((char *) f->header.a_name, "main") != 0)
diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c
index 158d6bc8cf..88ca83d288 100644
--- a/src/mesa/shader/slang/slang_simplify.c
+++ b/src/mesa/shader/slang/slang_simplify.c
@@ -76,7 +76,7 @@ _slang_lookup_constant(const char *name)
for (i = 0; info[i].Name; i++) {
if (strcmp(info[i].Name, name) == 0) {
/* found */
- GLint value = -1.0;
+ GLint value = -1;
_mesa_GetIntegerv(info[i].Token, &value);
ASSERT(value >= 0); /* sanity check that glGetFloatv worked */
return value / info[i].Divisor;
@@ -110,7 +110,7 @@ _slang_simplify(slang_operation *oper,
oper->literal[0] =
oper->literal[1] =
oper->literal[2] =
- oper->literal[3] = value;
+ oper->literal[3] = (GLfloat) value;
oper->type = SLANG_OPER_LITERAL_INT;
return;
}
@@ -380,7 +380,7 @@ _slang_adapt_call(slang_operation *callOper, const slang_function *fun,
&origArg);
callOper->children[i + j].children[1].type
= SLANG_OPER_LITERAL_INT;
- callOper->children[i + j].children[1].literal[0] = j;
+ callOper->children[i + j].children[1].literal[0] = (GLfloat) j;
}
}
@@ -394,11 +394,11 @@ _slang_adapt_call(slang_operation *callOper, const slang_function *fun,
}
}
- if (callOper->num_children < numParams) {
+ if (callOper->num_children < (GLuint) numParams) {
/* still not enough args for all params */
return GL_FALSE;
}
- else if (callOper->num_children > numParams) {
+ else if (callOper->num_children > (GLuint) numParams) {
/* now too many arguments */
/* XXX this isn't always an error, see spec */
return GL_FALSE;
diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c
index bb4d2d656c..7bc92ea297 100644
--- a/src/mesa/shader/slang/slang_vartable.c
+++ b/src/mesa/shader/slang/slang_vartable.c
@@ -129,7 +129,7 @@ _slang_pop_var_table(slang_var_table *vt)
/* just verify that any remaining allocations in this scope
* were for temps
*/
- for (i = 0; i < vt->MaxRegisters * 4; i++) {
+ for (i = 0; i < (int) vt->MaxRegisters * 4; i++) {
if (t->Temps[i] != FREE && t->Parent->Temps[i] == FREE) {
if (dbg) printf(" Free reg %d\n", i/4);
assert(t->Temps[i] == TEMP);
@@ -206,7 +206,7 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp)
for (i = 0; i <= vt->MaxRegisters * 4 - size; i += step) {
GLuint found = 0;
- for (j = 0; j < size; j++) {
+ for (j = 0; j < (GLuint) size; j++) {
if (i + j < vt->MaxRegisters * 4 && t->Temps[i + j] == FREE) {
found++;
}
@@ -218,7 +218,7 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp)
/* found block of size free regs */
if (size > 1)
assert(i % 4 == 0);
- for (j = 0; j < size; j++)
+ for (j = 0; j < (GLuint) size; j++)
t->Temps[i + j] = isTemp ? TEMP : VAR;
assert(i < MAX_PROGRAM_TEMPS * 4);
t->ValSize[i] = size;
@@ -313,7 +313,7 @@ _slang_free_temp(slang_var_table *vt, slang_ir_storage *store)
else {
/*assert(store->Swizzle == SWIZZLE_NOOP);*/
assert(t->ValSize[r*4] == store->Size);
- for (i = 0; i < store->Size; i++) {
+ for (i = 0; i < (GLuint) store->Size; i++) {
assert(t->Temps[r * 4 + i] == TEMP);
t->Temps[r * 4 + i] = FREE;
}
@@ -327,7 +327,7 @@ _slang_is_temp(const slang_var_table *vt, const slang_ir_storage *store)
struct table *t = vt->Top;
GLuint comp;
assert(store->Index >= 0);
- assert(store->Index < vt->MaxRegisters);
+ assert(store->Index < (int) vt->MaxRegisters);
if (store->Swizzle == SWIZZLE_NOOP)
comp = 0;
else