aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-05-02 00:21:04 -0700
committerVinson Lee <[email protected]>2010-05-02 00:21:04 -0700
commit3c86e2f1dce458aec42b5de54fc2cf25cac28172 (patch)
treef55aaf446be1a464fa647138c69b18394f680785 /src/gallium/drivers/i965
parentf4874705d95adfc85be535b85c9db26f5d3746f7 (diff)
i965g: s/sprintf/util_snprintf/
Diffstat (limited to 'src/gallium/drivers/i965')
-rw-r--r--src/gallium/drivers/i965/intel_decode.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/drivers/i965/intel_decode.c b/src/gallium/drivers/i965/intel_decode.c
index 6c47415cac5..bd8b9174a89 100644
--- a/src/gallium/drivers/i965/intel_decode.c
+++ b/src/gallium/drivers/i965/intel_decode.c
@@ -40,6 +40,7 @@
#include <stdint.h>
#include <string.h>
+#include "util/u_string.h"
#include "intel_decode.h"
/*#include "intel_chipset.h"*/
@@ -478,7 +479,7 @@ i915_get_instruction_src0(const uint32_t *data, int i, char *srcname)
char swizzle[100];
i915_get_instruction_src_name((a0 >> 7) & 0x7, src_nr, srcname);
- sprintf(swizzle, ".%s%s%s%s", swizzle_x, swizzle_y, swizzle_z, swizzle_w);
+ util_snprintf(swizzle, sizeof(swizzle), ".%s%s%s%s", swizzle_x, swizzle_y, swizzle_z, swizzle_w);
if (strcmp(swizzle, ".xyzw") != 0)
strcat(srcname, swizzle);
}
@@ -496,7 +497,7 @@ i915_get_instruction_src1(const uint32_t *data, int i, char *srcname)
char swizzle[100];
i915_get_instruction_src_name((a1 >> 13) & 0x7, src_nr, srcname);
- sprintf(swizzle, ".%s%s%s%s", swizzle_x, swizzle_y, swizzle_z, swizzle_w);
+ util_snprintf(swizzle, sizeof(swizzle), ".%s%s%s%s", swizzle_x, swizzle_y, swizzle_z, swizzle_w);
if (strcmp(swizzle, ".xyzw") != 0)
strcat(srcname, swizzle);
}
@@ -513,7 +514,7 @@ i915_get_instruction_src2(const uint32_t *data, int i, char *srcname)
char swizzle[100];
i915_get_instruction_src_name((a2 >> 21) & 0x7, src_nr, srcname);
- sprintf(swizzle, ".%s%s%s%s", swizzle_x, swizzle_y, swizzle_z, swizzle_w);
+ util_snprintf(swizzle, sizeof(swizzle), ".%s%s%s%s", swizzle_x, swizzle_y, swizzle_z, swizzle_w);
if (strcmp(swizzle, ".xyzw") != 0)
strcat(srcname, swizzle);
}
@@ -642,7 +643,7 @@ i915_decode_dcl(const uint32_t *data, uint32_t hw_offset, int i, char *instr_pre
switch ((d0 >> 19) & 0x3) {
case 1:
- sprintf(dcl_mask, ".%s%s%s%s", dcl_x, dcl_y, dcl_z, dcl_w);
+ util_snprintf(dcl_mask, sizeof(dcl_mask), ".%s%s%s%s", dcl_x, dcl_y, dcl_z, dcl_w);
if (strcmp(dcl_mask, ".") == 0)
fprintf(out, "bad (empty) dcl mask\n");
@@ -976,7 +977,7 @@ decode_3d_1d(const uint32_t *data, int count, uint32_t hw_offset, int *failures,
if (i + 3 >= count)
BUFFER_FAIL(count, len, "3DSTATE_PIXEL_SHADER_PROGRAM");
- sprintf(instr_prefix, "PS%03d", instr);
+ util_snprintf(instr_prefix, sizeof(instr_prefix), "PS%03d", instr);
i915_decode_instruction(data, hw_offset, i, instr_prefix);
i += 3;
}