glsl2: added casts to silence warnings

This commit is contained in:
Brian Paul
2010-08-11 14:04:51 -06:00
parent 4415a84645
commit 9f9386d22a
3 changed files with 12 additions and 12 deletions

View File

@@ -400,7 +400,7 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
* named 'foo'. * named 'foo'.
*/ */
char key[128]; char key[128];
snprintf(key, sizeof(key), "%p[%u]", base, array_size); snprintf(key, sizeof(key), "%p[%u]", (void *) base, array_size);
const glsl_type *t = (glsl_type *) hash_table_find(array_types, key); const glsl_type *t = (glsl_type *) hash_table_find(array_types, key);
if (t == NULL) { if (t == NULL) {
@@ -458,7 +458,7 @@ glsl_type::record_key_hash(const void *a)
break; break;
size += snprintf(& hash_key[size], sizeof(hash_key) - size, size += snprintf(& hash_key[size], sizeof(hash_key) - size,
"%p", key->fields.structure[i].type); "%p", (void *) key->fields.structure[i].type);
} }
return hash_table_string_hash(& hash_key); return hash_table_string_hash(& hash_key);

View File

@@ -64,7 +64,7 @@ do_dead_code(exec_list *instructions)
if (debug) { if (debug) {
printf("%s@%p: %d refs, %d assigns, %sdeclared in our scope\n", printf("%s@%p: %d refs, %d assigns, %sdeclared in our scope\n",
entry->var->name, entry->var, entry->var->name, (void *) entry->var,
entry->referenced_count, entry->assigned_count, entry->referenced_count, entry->assigned_count,
entry->declaration ? "" : "not "); entry->declaration ? "" : "not ");
} }
@@ -85,7 +85,7 @@ do_dead_code(exec_list *instructions)
if (debug) { if (debug) {
printf("Removed assignment to %s@%p\n", printf("Removed assignment to %s@%p\n",
entry->var->name, entry->var); entry->var->name, (void *) entry->var);
} }
} }
} else { } else {
@@ -97,7 +97,7 @@ do_dead_code(exec_list *instructions)
if (debug) { if (debug) {
printf("Removed declaration of %s@%p\n", printf("Removed declaration of %s@%p\n",
entry->var->name, entry->var); entry->var->name, (void *) entry->var);
} }
} }
} }

View File

@@ -82,14 +82,14 @@ ir_validate::visit(ir_dereference_variable *ir)
{ {
if ((ir->var == NULL) || (ir->var->as_variable() == NULL)) { if ((ir->var == NULL) || (ir->var->as_variable() == NULL)) {
printf("ir_dereference_variable @ %p does not specify a variable %p\n", printf("ir_dereference_variable @ %p does not specify a variable %p\n",
ir, ir->var); (void *) ir, (void *) ir->var);
abort(); abort();
} }
if (hash_table_find(ht, ir->var) == NULL) { if (hash_table_find(ht, ir->var) == NULL) {
printf("ir_dereference_variable @ %p specifies undeclared variable " printf("ir_dereference_variable @ %p specifies undeclared variable "
"`%s' @ %p\n", "`%s' @ %p\n",
ir, ir->var->name, ir->var); (void *) ir, ir->var->name, (void *) ir->var);
abort(); abort();
} }
@@ -122,8 +122,8 @@ ir_validate::visit_enter(ir_function *ir)
printf("Function definition nested inside another function " printf("Function definition nested inside another function "
"definition:\n"); "definition:\n");
printf("%s %p inside %s %p\n", printf("%s %p inside %s %p\n",
ir->name, ir, ir->name, (void *) ir,
this->current_function->name, this->current_function); this->current_function->name, (void *) this->current_function);
abort(); abort();
} }
@@ -154,9 +154,9 @@ ir_validate::visit_enter(ir_function_signature *ir)
printf("Function signature nested inside wrong function " printf("Function signature nested inside wrong function "
"definition:\n"); "definition:\n");
printf("%p inside %s %p instead of %s %p\n", printf("%p inside %s %p instead of %s %p\n",
ir, (void *) ir,
this->current_function->name, this->current_function, this->current_function->name, (void *) this->current_function,
ir->function_name(), ir->function()); ir->function_name(), (void *) ir->function());
abort(); abort();
} }