diff options
author | Eric Engestrom <[email protected]> | 2018-11-20 11:59:28 +0000 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2019-07-19 22:39:38 +0100 |
commit | dffeaa55dd1155d7a1e8feb5ecfc54fff688fcd8 (patch) | |
tree | a232b3bef0f7251f90cd3a279674218c46a60d65 /src/compiler/glsl | |
parent | 00e23cd96998deae429508efa10545be13420379 (diff) |
util: use standard name for snprintf()
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/ir_builder_print_visitor.cpp | 5 | ||||
-rw-r--r-- | src/compiler/glsl/ir_print_visitor.cpp | 16 | ||||
-rw-r--r-- | src/compiler/glsl/link_interface_blocks.cpp | 4 | ||||
-rw-r--r-- | src/compiler/glsl/linker.cpp | 4 | ||||
-rw-r--r-- | src/compiler/glsl/opt_dead_builtin_varyings.cpp | 10 |
5 files changed, 19 insertions, 20 deletions
diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp b/src/compiler/glsl/ir_builder_print_visitor.cpp index d34afa3daee..5ab50a58415 100644 --- a/src/compiler/glsl/ir_builder_print_visitor.cpp +++ b/src/compiler/glsl/ir_builder_print_visitor.cpp @@ -718,9 +718,8 @@ ir_builder_print_visitor::visit_leave(ir_call *ir) const struct hash_entry *const he = _mesa_hash_table_search(index_map, ir->return_deref); - util_snprintf(return_deref_string, sizeof(return_deref_string), - "operand(r%04X).val", - (unsigned)(uintptr_t) he->data); + snprintf(return_deref_string, sizeof(return_deref_string), + "operand(r%04X).val", (unsigned)(uintptr_t) he->data); } else { strcpy(return_deref_string, "NULL"); } diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp index e208aaef888..b3a62ce38bd 100644 --- a/src/compiler/glsl/ir_print_visitor.cpp +++ b/src/compiler/glsl/ir_print_visitor.cpp @@ -167,31 +167,31 @@ void ir_print_visitor::visit(ir_variable *ir) char binding[32] = {0}; if (ir->data.binding) - util_snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding); + snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding); char loc[32] = {0}; if (ir->data.location != -1) - util_snprintf(loc, sizeof(loc), "location=%i ", ir->data.location); + snprintf(loc, sizeof(loc), "location=%i ", ir->data.location); char component[32] = {0}; if (ir->data.explicit_component || ir->data.location_frac != 0) - util_snprintf(component, sizeof(component), "component=%i ", + snprintf(component, sizeof(component), "component=%i ", ir->data.location_frac); char stream[32] = {0}; if (ir->data.stream & (1u << 31)) { if (ir->data.stream & ~(1u << 31)) { - util_snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ", - ir->data.stream & 3, (ir->data.stream >> 2) & 3, - (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3); + snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ", + ir->data.stream & 3, (ir->data.stream >> 2) & 3, + (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3); } } else if (ir->data.stream) { - util_snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream); + snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream); } char image_format[32] = {0}; if (ir->data.image_format) { - util_snprintf(image_format, sizeof(image_format), "format=%x ", + snprintf(image_format, sizeof(image_format), "format=%x ", ir->data.image_format); } diff --git a/src/compiler/glsl/link_interface_blocks.cpp b/src/compiler/glsl/link_interface_blocks.cpp index d7d228ee1a5..29c5c6f97ae 100644 --- a/src/compiler/glsl/link_interface_blocks.cpp +++ b/src/compiler/glsl/link_interface_blocks.cpp @@ -239,7 +239,7 @@ public: if (var->data.explicit_location && var->data.location >= VARYING_SLOT_VAR0) { char location_str[11]; - util_snprintf(location_str, 11, "%d", var->data.location); + snprintf(location_str, 11, "%d", var->data.location); const struct hash_entry *entry = _mesa_hash_table_search(ht, location_str); @@ -265,7 +265,7 @@ public: * unsigned location value which is overkill but future proof. */ char location_str[11]; - util_snprintf(location_str, 11, "%d", var->data.location); + snprintf(location_str, 11, "%d", var->data.location); _mesa_hash_table_insert(ht, ralloc_strdup(mem_ctx, location_str), var); } else { _mesa_hash_table_insert(ht, diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 7445def6aa4..281d59d12a5 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4204,8 +4204,8 @@ is_top_level_shader_storage_block_member(const char* name, return false; } - util_snprintf(full_instanced_name, name_length, "%s.%s", - interface_name, field_name); + snprintf(full_instanced_name, name_length, "%s.%s", + interface_name, field_name); /* Check if its top-level shader storage block member of an * instanced interface block, or of a unnamed interface block. diff --git a/src/compiler/glsl/opt_dead_builtin_varyings.cpp b/src/compiler/glsl/opt_dead_builtin_varyings.cpp index 6ed00128ed9..853847ebfd5 100644 --- a/src/compiler/glsl/opt_dead_builtin_varyings.cpp +++ b/src/compiler/glsl/opt_dead_builtin_varyings.cpp @@ -323,14 +323,14 @@ public: if (!(external_color_usage & (1 << i))) { if (info->color[i]) { - util_snprintf(name, 32, "gl_%s_FrontColor%i_dummy", mode_str, i); + snprintf(name, 32, "gl_%s_FrontColor%i_dummy", mode_str, i); this->new_color[i] = new (ctx) ir_variable(glsl_type::vec4_type, name, ir_var_temporary); } if (info->backcolor[i]) { - util_snprintf(name, 32, "gl_%s_BackColor%i_dummy", mode_str, i); + snprintf(name, 32, "gl_%s_BackColor%i_dummy", mode_str, i); this->new_backcolor[i] = new (ctx) ir_variable(glsl_type::vec4_type, name, ir_var_temporary); @@ -342,7 +342,7 @@ public: info->fog) { char name[32]; - util_snprintf(name, 32, "gl_%s_FogFragCoord_dummy", mode_str); + snprintf(name, 32, "gl_%s_FogFragCoord_dummy", mode_str); this->new_fog = new (ctx) ir_variable(glsl_type::float_type, name, ir_var_temporary); } @@ -366,13 +366,13 @@ public: if (!(external_usage & (1 << i))) { /* This varying is unused in the next stage. Declare * a temporary instead of an output. */ - util_snprintf(name, 32, "gl_%s_%s%i_dummy", mode_str, var_name, i); + snprintf(name, 32, "gl_%s_%s%i_dummy", mode_str, var_name, i); new_var[i] = new (ctx) ir_variable(glsl_type::vec4_type, name, ir_var_temporary); } else { - util_snprintf(name, 32, "gl_%s_%s%i", mode_str, var_name, i); + snprintf(name, 32, "gl_%s_%s%i", mode_str, var_name, i); new_var[i] = new(ctx) ir_variable(glsl_type::vec4_type, name, this->info->mode); |