glsl: use util_snprintf()
[mesa.git] / src / compiler / glsl / opt_dead_builtin_varyings.cpp
index 0ce192186064ee61d700356f11fe5adefc45ba0f..0cb04b34589ad7063f71caf4be7d9b89e68fdd72 100644 (file)
@@ -53,6 +53,7 @@
 #include "compiler/glsl_types.h"
 #include "link_varyings.h"
 #include "main/mtypes.h"
+#include "util/u_string.h"
 
 namespace {
 
@@ -322,14 +323,14 @@ public:
 
          if (!(external_color_usage & (1 << i))) {
             if (info->color[i]) {
-               snprintf(name, 32, "gl_%s_FrontColor%i_dummy", mode_str, i);
+               util_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]) {
-               snprintf(name, 32, "gl_%s_BackColor%i_dummy", mode_str, i);
+               util_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);
@@ -341,7 +342,7 @@ public:
           info->fog) {
          char name[32];
 
-         snprintf(name, 32, "gl_%s_FogFragCoord_dummy", mode_str);
+         util_snprintf(name, 32, "gl_%s_FogFragCoord_dummy", mode_str);
          this->new_fog = new (ctx) ir_variable(glsl_type::float_type, name,
                                                ir_var_temporary);
       }
@@ -365,13 +366,13 @@ public:
             if (!(external_usage & (1 << i))) {
                /* This varying is unused in the next stage. Declare
                 * a temporary instead of an output. */
-               snprintf(name, 32, "gl_%s_%s%i_dummy", mode_str, var_name, i);
+               util_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 {
-               snprintf(name, 32, "gl_%s_%s%i", mode_str, var_name, i);
+               util_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);