util: use standard name for snprintf()
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -718,9 +718,8 @@ ir_builder_print_visitor::visit_leave(ir_call *ir)
|
|||||||
const struct hash_entry *const he =
|
const struct hash_entry *const he =
|
||||||
_mesa_hash_table_search(index_map, ir->return_deref);
|
_mesa_hash_table_search(index_map, ir->return_deref);
|
||||||
|
|
||||||
util_snprintf(return_deref_string, sizeof(return_deref_string),
|
snprintf(return_deref_string, sizeof(return_deref_string),
|
||||||
"operand(r%04X).val",
|
"operand(r%04X).val", (unsigned)(uintptr_t) he->data);
|
||||||
(unsigned)(uintptr_t) he->data);
|
|
||||||
} else {
|
} else {
|
||||||
strcpy(return_deref_string, "NULL");
|
strcpy(return_deref_string, "NULL");
|
||||||
}
|
}
|
||||||
|
@@ -167,31 +167,31 @@ void ir_print_visitor::visit(ir_variable *ir)
|
|||||||
|
|
||||||
char binding[32] = {0};
|
char binding[32] = {0};
|
||||||
if (ir->data.binding)
|
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};
|
char loc[32] = {0};
|
||||||
if (ir->data.location != -1)
|
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};
|
char component[32] = {0};
|
||||||
if (ir->data.explicit_component || ir->data.location_frac != 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);
|
ir->data.location_frac);
|
||||||
|
|
||||||
char stream[32] = {0};
|
char stream[32] = {0};
|
||||||
if (ir->data.stream & (1u << 31)) {
|
if (ir->data.stream & (1u << 31)) {
|
||||||
if (ir->data.stream & ~(1u << 31)) {
|
if (ir->data.stream & ~(1u << 31)) {
|
||||||
util_snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
|
snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
|
||||||
ir->data.stream & 3, (ir->data.stream >> 2) & 3,
|
ir->data.stream & 3, (ir->data.stream >> 2) & 3,
|
||||||
(ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
|
(ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
|
||||||
}
|
}
|
||||||
} else if (ir->data.stream) {
|
} 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};
|
char image_format[32] = {0};
|
||||||
if (ir->data.image_format) {
|
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);
|
ir->data.image_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -239,7 +239,7 @@ public:
|
|||||||
if (var->data.explicit_location &&
|
if (var->data.explicit_location &&
|
||||||
var->data.location >= VARYING_SLOT_VAR0) {
|
var->data.location >= VARYING_SLOT_VAR0) {
|
||||||
char location_str[11];
|
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 =
|
const struct hash_entry *entry =
|
||||||
_mesa_hash_table_search(ht, location_str);
|
_mesa_hash_table_search(ht, location_str);
|
||||||
@@ -265,7 +265,7 @@ public:
|
|||||||
* unsigned location value which is overkill but future proof.
|
* unsigned location value which is overkill but future proof.
|
||||||
*/
|
*/
|
||||||
char location_str[11];
|
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);
|
_mesa_hash_table_insert(ht, ralloc_strdup(mem_ctx, location_str), var);
|
||||||
} else {
|
} else {
|
||||||
_mesa_hash_table_insert(ht,
|
_mesa_hash_table_insert(ht,
|
||||||
|
@@ -4204,8 +4204,8 @@ is_top_level_shader_storage_block_member(const char* name,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
util_snprintf(full_instanced_name, name_length, "%s.%s",
|
snprintf(full_instanced_name, name_length, "%s.%s",
|
||||||
interface_name, field_name);
|
interface_name, field_name);
|
||||||
|
|
||||||
/* Check if its top-level shader storage block member of an
|
/* Check if its top-level shader storage block member of an
|
||||||
* instanced interface block, or of a unnamed interface block.
|
* instanced interface block, or of a unnamed interface block.
|
||||||
|
@@ -323,14 +323,14 @@ public:
|
|||||||
|
|
||||||
if (!(external_color_usage & (1 << i))) {
|
if (!(external_color_usage & (1 << i))) {
|
||||||
if (info->color[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] =
|
this->new_color[i] =
|
||||||
new (ctx) ir_variable(glsl_type::vec4_type, name,
|
new (ctx) ir_variable(glsl_type::vec4_type, name,
|
||||||
ir_var_temporary);
|
ir_var_temporary);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->backcolor[i]) {
|
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] =
|
this->new_backcolor[i] =
|
||||||
new (ctx) ir_variable(glsl_type::vec4_type, name,
|
new (ctx) ir_variable(glsl_type::vec4_type, name,
|
||||||
ir_var_temporary);
|
ir_var_temporary);
|
||||||
@@ -342,7 +342,7 @@ public:
|
|||||||
info->fog) {
|
info->fog) {
|
||||||
char name[32];
|
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,
|
this->new_fog = new (ctx) ir_variable(glsl_type::float_type, name,
|
||||||
ir_var_temporary);
|
ir_var_temporary);
|
||||||
}
|
}
|
||||||
@@ -366,13 +366,13 @@ public:
|
|||||||
if (!(external_usage & (1 << i))) {
|
if (!(external_usage & (1 << i))) {
|
||||||
/* This varying is unused in the next stage. Declare
|
/* This varying is unused in the next stage. Declare
|
||||||
* a temporary instead of an output. */
|
* 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_var[i] =
|
||||||
new (ctx) ir_variable(glsl_type::vec4_type, name,
|
new (ctx) ir_variable(glsl_type::vec4_type, name,
|
||||||
ir_var_temporary);
|
ir_var_temporary);
|
||||||
}
|
}
|
||||||
else {
|
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_var[i] =
|
||||||
new(ctx) ir_variable(glsl_type::vec4_type, name,
|
new(ctx) ir_variable(glsl_type::vec4_type, name,
|
||||||
this->info->mode);
|
this->info->mode);
|
||||||
|
@@ -557,7 +557,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length,
|
|||||||
char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
|
char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
util_snprintf(n, name_length, "%s[]", array->name);
|
snprintf(n, name_length, "%s[]", array->name);
|
||||||
else {
|
else {
|
||||||
/* insert outermost dimensions in the correct spot
|
/* insert outermost dimensions in the correct spot
|
||||||
* otherwise the dimension order will be backwards
|
* otherwise the dimension order will be backwards
|
||||||
@@ -565,11 +565,11 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length,
|
|||||||
const char *pos = strchr(array->name, '[');
|
const char *pos = strchr(array->name, '[');
|
||||||
if (pos) {
|
if (pos) {
|
||||||
int idx = pos - array->name;
|
int idx = pos - array->name;
|
||||||
util_snprintf(n, idx+1, "%s", array->name);
|
snprintf(n, idx+1, "%s", array->name);
|
||||||
util_snprintf(n + idx, name_length - idx, "[%u]%s",
|
snprintf(n + idx, name_length - idx, "[%u]%s",
|
||||||
length, array->name + idx);
|
length, array->name + idx);
|
||||||
} else {
|
} else {
|
||||||
util_snprintf(n, name_length, "%s[%u]", array->name, length);
|
snprintf(n, name_length, "%s[%u]", array->name, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,8 +635,8 @@ glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns,
|
|||||||
assert(columns > 1 || !row_major);
|
assert(columns > 1 || !row_major);
|
||||||
|
|
||||||
char name[128];
|
char name[128];
|
||||||
util_snprintf(name, sizeof(name), "%sx%uB%s", bare_type->name,
|
snprintf(name, sizeof(name), "%sx%uB%s", bare_type->name,
|
||||||
explicit_stride, row_major ? "RM" : "");
|
explicit_stride, row_major ? "RM" : "");
|
||||||
|
|
||||||
mtx_lock(&glsl_type::hash_mutex);
|
mtx_lock(&glsl_type::hash_mutex);
|
||||||
|
|
||||||
@@ -1000,8 +1000,8 @@ glsl_type::get_array_instance(const glsl_type *base,
|
|||||||
* named 'foo'.
|
* named 'foo'.
|
||||||
*/
|
*/
|
||||||
char key[128];
|
char key[128];
|
||||||
util_snprintf(key, sizeof(key), "%p[%u]x%uB", (void *) base, array_size,
|
snprintf(key, sizeof(key), "%p[%u]x%uB", (void *) base, array_size,
|
||||||
explicit_stride);
|
explicit_stride);
|
||||||
|
|
||||||
mtx_lock(&glsl_type::hash_mutex);
|
mtx_lock(&glsl_type::hash_mutex);
|
||||||
|
|
||||||
|
@@ -403,7 +403,7 @@ create_jit_vertex_header(struct gallivm_state *gallivm, int data_elems)
|
|||||||
LLVMTypeRef vertex_header;
|
LLVMTypeRef vertex_header;
|
||||||
char struct_name[24];
|
char struct_name[24];
|
||||||
|
|
||||||
util_snprintf(struct_name, 23, "vertex_header%d", data_elems);
|
snprintf(struct_name, 23, "vertex_header%d", data_elems);
|
||||||
|
|
||||||
elem_types[DRAW_JIT_VERTEX_VERTEX_ID] = LLVMIntTypeInContext(gallivm->context, 32);
|
elem_types[DRAW_JIT_VERTEX_VERTEX_ID] = LLVMIntTypeInContext(gallivm->context, 32);
|
||||||
elem_types[DRAW_JIT_VERTEX_CLIP_POS] = LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4);
|
elem_types[DRAW_JIT_VERTEX_CLIP_POS] = LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4);
|
||||||
@@ -578,8 +578,8 @@ draw_llvm_create_variant(struct draw_llvm *llvm,
|
|||||||
variant->llvm = llvm;
|
variant->llvm = llvm;
|
||||||
variant->shader = shader;
|
variant->shader = shader;
|
||||||
|
|
||||||
util_snprintf(module_name, sizeof(module_name), "draw_llvm_vs_variant%u",
|
snprintf(module_name, sizeof(module_name), "draw_llvm_vs_variant%u",
|
||||||
variant->shader->variants_cached);
|
variant->shader->variants_cached);
|
||||||
|
|
||||||
variant->gallivm = gallivm_create(module_name, llvm->context);
|
variant->gallivm = gallivm_create(module_name, llvm->context);
|
||||||
|
|
||||||
@@ -1595,8 +1595,8 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
|
|||||||
|
|
||||||
memset(&system_values, 0, sizeof(system_values));
|
memset(&system_values, 0, sizeof(system_values));
|
||||||
|
|
||||||
util_snprintf(func_name, sizeof(func_name), "draw_llvm_vs_variant%u",
|
snprintf(func_name, sizeof(func_name), "draw_llvm_vs_variant%u",
|
||||||
variant->shader->variants_cached);
|
variant->shader->variants_cached);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
arg_types[i++] = get_context_ptr_type(variant); /* context */
|
arg_types[i++] = get_context_ptr_type(variant); /* context */
|
||||||
@@ -2282,8 +2282,8 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
|||||||
|
|
||||||
memset(&system_values, 0, sizeof(system_values));
|
memset(&system_values, 0, sizeof(system_values));
|
||||||
|
|
||||||
util_snprintf(func_name, sizeof(func_name), "draw_llvm_gs_variant%u",
|
snprintf(func_name, sizeof(func_name), "draw_llvm_gs_variant%u",
|
||||||
variant->shader->variants_cached);
|
variant->shader->variants_cached);
|
||||||
|
|
||||||
assert(variant->vertex_header_ptr_type);
|
assert(variant->vertex_header_ptr_type);
|
||||||
|
|
||||||
@@ -2420,8 +2420,8 @@ draw_gs_llvm_create_variant(struct draw_llvm *llvm,
|
|||||||
variant->llvm = llvm;
|
variant->llvm = llvm;
|
||||||
variant->shader = shader;
|
variant->shader = shader;
|
||||||
|
|
||||||
util_snprintf(module_name, sizeof(module_name), "draw_llvm_gs_variant%u",
|
snprintf(module_name, sizeof(module_name), "draw_llvm_gs_variant%u",
|
||||||
variant->shader->variants_cached);
|
variant->shader->variants_cached);
|
||||||
|
|
||||||
variant->gallivm = gallivm_create(module_name, llvm->context);
|
variant->gallivm = gallivm_create(module_name, llvm->context);
|
||||||
|
|
||||||
|
@@ -51,13 +51,13 @@ dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, bool verbose)
|
|||||||
strcpy(proc_name, "unknown");
|
strcpy(proc_name, "unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
util_snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
|
snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
|
||||||
|
|
||||||
if (mkdir(dir, 0774) && errno != EEXIST)
|
if (mkdir(dir, 0774) && errno != EEXIST)
|
||||||
fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
|
fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
|
||||||
|
|
||||||
util_snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
|
snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
|
||||||
p_atomic_inc_return(&index) - 1);
|
p_atomic_inc_return(&index) - 1);
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr, "dd: dumping to file %s\n", buf);
|
fprintf(stderr, "dd: dumping to file %s\n", buf);
|
||||||
@@ -1086,9 +1086,9 @@ dd_thread_main(void *input)
|
|||||||
const char *process_name = util_get_process_name();
|
const char *process_name = util_get_process_name();
|
||||||
if (process_name) {
|
if (process_name) {
|
||||||
char threadname[16];
|
char threadname[16];
|
||||||
util_snprintf(threadname, sizeof(threadname), "%.*s:ddbg",
|
snprintf(threadname, sizeof(threadname), "%.*s:ddbg",
|
||||||
(int)MIN2(strlen(process_name), sizeof(threadname) - 6),
|
(int)MIN2(strlen(process_name), sizeof(threadname) - 6),
|
||||||
process_name);
|
process_name);
|
||||||
u_thread_setname(threadname);
|
u_thread_setname(threadname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,8 +80,8 @@ build_binary_int_overflow(struct gallivm_state *gallivm,
|
|||||||
|
|
||||||
debug_assert(type_width == 16 || type_width == 32 || type_width == 64);
|
debug_assert(type_width == 16 || type_width == 32 || type_width == 64);
|
||||||
|
|
||||||
util_snprintf(intr_str, sizeof intr_str, "%s.i%u",
|
snprintf(intr_str, sizeof intr_str, "%s.i%u",
|
||||||
intr_prefix, type_width);
|
intr_prefix, type_width);
|
||||||
|
|
||||||
oelems[0] = type_ref;
|
oelems[0] = type_ref;
|
||||||
oelems[1] = LLVMInt1TypeInContext(gallivm->context);
|
oelems[1] = LLVMInt1TypeInContext(gallivm->context);
|
||||||
|
@@ -241,9 +241,9 @@ lp_profile(LLVMValueRef func, const void *code)
|
|||||||
if (getenv("PERF_BUILDID_DIR")) {
|
if (getenv("PERF_BUILDID_DIR")) {
|
||||||
pid_t pid = getpid();
|
pid_t pid = getpid();
|
||||||
char filename[256];
|
char filename[256];
|
||||||
util_snprintf(filename, sizeof filename, "/tmp/perf-%llu.map", (unsigned long long)pid);
|
snprintf(filename, sizeof filename, "/tmp/perf-%llu.map", (unsigned long long)pid);
|
||||||
perf_map_file = fopen(filename, "wt");
|
perf_map_file = fopen(filename, "wt");
|
||||||
util_snprintf(filename, sizeof filename, "/tmp/perf-%llu.map.asm", (unsigned long long)pid);
|
snprintf(filename, sizeof filename, "/tmp/perf-%llu.map.asm", (unsigned long long)pid);
|
||||||
perf_asm_file.open(filename);
|
perf_asm_file.open(filename);
|
||||||
}
|
}
|
||||||
first_time = FALSE;
|
first_time = FALSE;
|
||||||
|
@@ -1948,8 +1948,8 @@ update_cached_block(struct gallivm_state *gallivm,
|
|||||||
LLVMBasicBlockRef bb;
|
LLVMBasicBlockRef bb;
|
||||||
LLVMValueRef args[3];
|
LLVMValueRef args[3];
|
||||||
|
|
||||||
util_snprintf(name, sizeof name, "%s_update_cache_one_block",
|
snprintf(name, sizeof name, "%s_update_cache_one_block",
|
||||||
format_desc->short_name);
|
format_desc->short_name);
|
||||||
function = LLVMGetNamedFunction(module, name);
|
function = LLVMGetNamedFunction(module, name);
|
||||||
|
|
||||||
if (!function) {
|
if (!function) {
|
||||||
|
@@ -327,8 +327,8 @@ lp_build_gather_avx2(struct gallivm_state *gallivm,
|
|||||||
src_ptr = LLVMBuildGEP(builder, base_ptr, &offsets, 1, "vector-gep");
|
src_ptr = LLVMBuildGEP(builder, base_ptr, &offsets, 1, "vector-gep");
|
||||||
|
|
||||||
char intrinsic[64];
|
char intrinsic[64];
|
||||||
util_snprintf(intrinsic, sizeof intrinsic, "llvm.masked.gather.v%u%s%u",
|
snprintf(intrinsic, sizeof intrinsic, "llvm.masked.gather.v%u%s%u",
|
||||||
length, dst_type.floating ? "f" : "i", src_width);
|
length, dst_type.floating ? "f" : "i", src_width);
|
||||||
LLVMValueRef alignment = LLVMConstInt(i32_type, src_width/8, 0);
|
LLVMValueRef alignment = LLVMConstInt(i32_type, src_width/8, 0);
|
||||||
LLVMValueRef mask = LLVMConstAllOnes(i1_vec_type);
|
LLVMValueRef mask = LLVMConstAllOnes(i1_vec_type);
|
||||||
LLVMValueRef passthru = LLVMGetUndef(src_vec_type);
|
LLVMValueRef passthru = LLVMGetUndef(src_vec_type);
|
||||||
|
@@ -372,7 +372,7 @@ init_gallivm_state(struct gallivm_state *gallivm, const char *name,
|
|||||||
{
|
{
|
||||||
const unsigned pointer_size = 8 * sizeof(void *);
|
const unsigned pointer_size = 8 * sizeof(void *);
|
||||||
char layout[512];
|
char layout[512];
|
||||||
util_snprintf(layout, sizeof layout, "%c-p:%u:%u:%u-i64:64:64-a0:0:%u-s0:%u:%u",
|
snprintf(layout, sizeof layout, "%c-p:%u:%u:%u-i64:64:64-a0:0:%u-s0:%u:%u",
|
||||||
#ifdef PIPE_ARCH_LITTLE_ENDIAN
|
#ifdef PIPE_ARCH_LITTLE_ENDIAN
|
||||||
'e', // little endian
|
'e', // little endian
|
||||||
#else
|
#else
|
||||||
@@ -595,7 +595,7 @@ gallivm_compile_module(struct gallivm_state *gallivm)
|
|||||||
if (gallivm_debug & GALLIVM_DEBUG_DUMP_BC) {
|
if (gallivm_debug & GALLIVM_DEBUG_DUMP_BC) {
|
||||||
char filename[256];
|
char filename[256];
|
||||||
assert(gallivm->module_name);
|
assert(gallivm->module_name);
|
||||||
util_snprintf(filename, sizeof(filename), "ir_%s.bc", gallivm->module_name);
|
snprintf(filename, sizeof(filename), "ir_%s.bc", gallivm->module_name);
|
||||||
LLVMWriteBitcodeToFile(gallivm->module, filename);
|
LLVMWriteBitcodeToFile(gallivm->module, filename);
|
||||||
debug_printf("%s written\n", filename);
|
debug_printf("%s written\n", filename);
|
||||||
debug_printf("Invoke as \"opt %s %s | llc -O%d %s%s\"\n",
|
debug_printf("Invoke as \"opt %s %s | llc -O%d %s%s\"\n",
|
||||||
|
@@ -90,9 +90,9 @@ lp_format_intrinsic(char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (length) {
|
if (length) {
|
||||||
util_snprintf(name, size, "%s.v%u%c%u", name_root, length, c, width);
|
snprintf(name, size, "%s.v%u%c%u", name_root, length, c, width);
|
||||||
} else {
|
} else {
|
||||||
util_snprintf(name, size, "%s.%c%u", name_root, c, width);
|
snprintf(name, size, "%s.%c%u", name_root, c, width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -108,7 +108,7 @@ lp_build_print_value(struct gallivm_state *gallivm,
|
|||||||
type_fmt[5] = '\0';
|
type_fmt[5] = '\0';
|
||||||
} else if (type_kind == LLVMIntegerTypeKind) {
|
} else if (type_kind == LLVMIntegerTypeKind) {
|
||||||
if (LLVMGetIntTypeWidth(type_ref) == 64) {
|
if (LLVMGetIntTypeWidth(type_ref) == 64) {
|
||||||
util_snprintf(type_fmt + 2, 3, "%s", PRId64);
|
snprintf(type_fmt + 2, 3, "%s", PRId64);
|
||||||
} else if (LLVMGetIntTypeWidth(type_ref) == 8) {
|
} else if (LLVMGetIntTypeWidth(type_ref) == 8) {
|
||||||
type_fmt[2] = 'u';
|
type_fmt[2] = 'u';
|
||||||
} else {
|
} else {
|
||||||
|
@@ -3565,8 +3565,8 @@ lp_build_sample_soa_func(struct gallivm_state *gallivm,
|
|||||||
* Additionally lod_property has to be included too.
|
* Additionally lod_property has to be included too.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
util_snprintf(func_name, sizeof(func_name), "texfunc_res_%d_sam_%d_%x",
|
snprintf(func_name, sizeof(func_name), "texfunc_res_%d_sam_%d_%x",
|
||||||
texture_index, sampler_index, sample_key);
|
texture_index, sampler_index, sample_key);
|
||||||
|
|
||||||
function = LLVMGetNamedFunction(module, func_name);
|
function = LLVMGetNamedFunction(module, func_name);
|
||||||
|
|
||||||
|
@@ -97,9 +97,9 @@ emit_dump_reg(struct gallivm_state *gallivm,
|
|||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
util_snprintf(buf, sizeof buf, " %s[%u].%c = ",
|
snprintf(buf, sizeof buf, " %s[%u].%c = ",
|
||||||
tgsi_file_name(file),
|
tgsi_file_name(file),
|
||||||
index, "xyzw"[chan]);
|
index, "xyzw"[chan]);
|
||||||
|
|
||||||
lp_build_print_value(gallivm, buf, value);
|
lp_build_print_value(gallivm, buf, value);
|
||||||
}
|
}
|
||||||
|
@@ -142,12 +142,12 @@ pipe_loader_find_module(const char *driver_name,
|
|||||||
len = next - library_paths;
|
len = next - library_paths;
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
ret = util_snprintf(path, sizeof(path), "%.*s/%s%s%s",
|
ret = snprintf(path, sizeof(path), "%.*s/%s%s%s",
|
||||||
len, library_paths,
|
len, library_paths,
|
||||||
MODULE_PREFIX, driver_name, UTIL_DL_EXT);
|
MODULE_PREFIX, driver_name, UTIL_DL_EXT);
|
||||||
else
|
else
|
||||||
ret = util_snprintf(path, sizeof(path), "%s%s%s",
|
ret = snprintf(path, sizeof(path), "%s%s%s",
|
||||||
MODULE_PREFIX, driver_name, UTIL_DL_EXT);
|
MODULE_PREFIX, driver_name, UTIL_DL_EXT);
|
||||||
|
|
||||||
if (ret > 0 && ret < sizeof(path) && u_file_access(path, 0) != -1) {
|
if (ret > 0 && ret < sizeof(path) && u_file_access(path, 0) != -1) {
|
||||||
lib = util_dl_open(path);
|
lib = util_dl_open(path);
|
||||||
|
@@ -364,8 +364,8 @@ debug_flush_might_flush_cb(UNUSED void *key, void *value, void *data)
|
|||||||
const char *reason = (const char *) data;
|
const char *reason = (const char *) data;
|
||||||
char message[80];
|
char message[80];
|
||||||
|
|
||||||
util_snprintf(message, sizeof(message),
|
snprintf(message, sizeof(message),
|
||||||
"%s referenced mapped buffer detected.", reason);
|
"%s referenced mapped buffer detected.", reason);
|
||||||
|
|
||||||
debug_flush_alert(message, reason, 3, item->bt_depth, TRUE, TRUE, NULL);
|
debug_flush_alert(message, reason, 3, item->bt_depth, TRUE, TRUE, NULL);
|
||||||
debug_flush_alert(NULL, "Map", 0, fbuf->bt_depth, TRUE, FALSE,
|
debug_flush_alert(NULL, "Map", 0, fbuf->bt_depth, TRUE, FALSE,
|
||||||
|
@@ -57,7 +57,7 @@ debug_dump_image(const char *prefix,
|
|||||||
unsigned char *rgb8;
|
unsigned char *rgb8;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
util_snprintf(filename, sizeof(filename), "%s.ppm", prefix);
|
snprintf(filename, sizeof(filename), "%s.ppm", prefix);
|
||||||
|
|
||||||
rgb8 = MALLOC(height * width * 3);
|
rgb8 = MALLOC(height * width * 3);
|
||||||
if (!rgb8) {
|
if (!rgb8) {
|
||||||
|
@@ -191,9 +191,9 @@ debug_symbol_name_dbghelp(const void *addr, char* buf, unsigned size)
|
|||||||
if (GetModuleFileNameA(hModule, buffer, sizeof buffer) == sizeof buffer) {
|
if (GetModuleFileNameA(hModule, buffer, sizeof buffer) == sizeof buffer) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
util_snprintf(buf, size, "%p at %s+0x%lx",
|
snprintf(buf, size, "%p at %s+0x%lx",
|
||||||
addr, buffer,
|
addr, buffer,
|
||||||
(unsigned long)((uintptr_t)addr - (uintptr_t)hModule));
|
(unsigned long)((uintptr_t)addr - (uintptr_t)hModule));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -208,9 +208,9 @@ debug_symbol_name_dbghelp(const void *addr, char* buf, unsigned size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Line.FileName) {
|
if (Line.FileName) {
|
||||||
util_snprintf(buf, size, "%s at %s:%lu", pSymbol->Name, Line.FileName, Line.LineNumber);
|
snprintf(buf, size, "%s at %s:%lu", pSymbol->Name, Line.FileName, Line.LineNumber);
|
||||||
} else {
|
} else {
|
||||||
util_snprintf(buf, size, "%s", pSymbol->Name);
|
snprintf(buf, size, "%s", pSymbol->Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -258,7 +258,7 @@ debug_symbol_name(const void *addr, char* buf, unsigned size)
|
|||||||
}
|
}
|
||||||
#endif /* defined(HAVE_EXECINFO_H) */
|
#endif /* defined(HAVE_EXECINFO_H) */
|
||||||
|
|
||||||
util_snprintf(buf, size, "%p", addr);
|
snprintf(buf, size, "%p", addr);
|
||||||
buf[size - 1] = 0;
|
buf[size - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -119,7 +119,7 @@ u_socket_connect(const char *hostname, uint16_t port)
|
|||||||
hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version
|
hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
|
||||||
util_snprintf(portString, sizeof(portString), "%d", port);
|
snprintf(portString, sizeof(portString), "%d", port);
|
||||||
|
|
||||||
r = getaddrinfo(hostname, portString, NULL, &addr);
|
r = getaddrinfo(hostname, portString, NULL, &addr);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
|
@@ -556,8 +556,8 @@ util_make_fs_blit_msaa_gen(struct pipe_context *pipe,
|
|||||||
assert(tgsi_tex == TGSI_TEXTURE_2D_MSAA ||
|
assert(tgsi_tex == TGSI_TEXTURE_2D_MSAA ||
|
||||||
tgsi_tex == TGSI_TEXTURE_2D_ARRAY_MSAA);
|
tgsi_tex == TGSI_TEXTURE_2D_ARRAY_MSAA);
|
||||||
|
|
||||||
util_snprintf(text, sizeof(text), shader_templ, type, samp_type,
|
snprintf(text, sizeof(text), shader_templ, type, samp_type,
|
||||||
output_semantic, conversion_decl, type, conversion, output_mask);
|
output_semantic, conversion_decl, type, conversion, output_mask);
|
||||||
|
|
||||||
if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
|
if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
|
||||||
puts(text);
|
puts(text);
|
||||||
|
@@ -623,8 +623,8 @@ test_texture_barrier(struct pipe_context *ctx, bool use_fbfetch,
|
|||||||
|
|
||||||
assert(num_samples >= 1 && num_samples <= 8);
|
assert(num_samples >= 1 && num_samples <= 8);
|
||||||
|
|
||||||
util_snprintf(name, sizeof(name), "%s: %s, %u samples", __func__,
|
snprintf(name, sizeof(name), "%s: %s, %u samples", __func__,
|
||||||
use_fbfetch ? "FBFETCH" : "sampler", MAX2(num_samples, 1));
|
use_fbfetch ? "FBFETCH" : "sampler", MAX2(num_samples, 1));
|
||||||
|
|
||||||
if (!ctx->screen->get_param(ctx->screen, PIPE_CAP_TEXTURE_BARRIER)) {
|
if (!ctx->screen->get_param(ctx->screen, PIPE_CAP_TEXTURE_BARRIER)) {
|
||||||
util_report_result_helper(SKIP, name);
|
util_report_result_helper(SKIP, name);
|
||||||
|
@@ -110,8 +110,8 @@ etna_screen_get_name(struct pipe_screen *pscreen)
|
|||||||
struct etna_screen *priv = etna_screen(pscreen);
|
struct etna_screen *priv = etna_screen(pscreen);
|
||||||
static char buffer[128];
|
static char buffer[128];
|
||||||
|
|
||||||
util_snprintf(buffer, sizeof(buffer), "Vivante GC%x rev %04x", priv->model,
|
snprintf(buffer, sizeof(buffer), "Vivante GC%x rev %04x", priv->model,
|
||||||
priv->revision);
|
priv->revision);
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
@@ -101,7 +101,7 @@ static const char *
|
|||||||
fd_screen_get_name(struct pipe_screen *pscreen)
|
fd_screen_get_name(struct pipe_screen *pscreen)
|
||||||
{
|
{
|
||||||
static char buffer[128];
|
static char buffer[128];
|
||||||
util_snprintf(buffer, sizeof(buffer), "FD%03d",
|
snprintf(buffer, sizeof(buffer), "FD%03d",
|
||||||
fd_screen(pscreen)->device_id);
|
fd_screen(pscreen)->device_id);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
@@ -103,7 +103,7 @@ i915_get_name(struct pipe_screen *screen)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
util_snprintf(buffer, sizeof(buffer), "i915 (chipset: %s)", chipset);
|
snprintf(buffer, sizeof(buffer), "i915 (chipset: %s)", chipset);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,12 +62,12 @@ llvmpipe_flush( struct pipe_context *pipe,
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
|
for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
|
||||||
util_snprintf(filename, sizeof(filename), "cbuf%u_%u", i, frame_no);
|
snprintf(filename, sizeof(filename), "cbuf%u_%u", i, frame_no);
|
||||||
debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.cbufs[i]);
|
debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.cbufs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
util_snprintf(filename, sizeof(filename), "zsbuf_%u", frame_no);
|
snprintf(filename, sizeof(filename), "zsbuf_%u", frame_no);
|
||||||
debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.zsbuf);
|
debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.zsbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -789,7 +789,7 @@ thread_function(void *init_data)
|
|||||||
char thread_name[16];
|
char thread_name[16];
|
||||||
unsigned fpstate;
|
unsigned fpstate;
|
||||||
|
|
||||||
util_snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", task->thread_index);
|
snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", task->thread_index);
|
||||||
u_thread_setname(thread_name);
|
u_thread_setname(thread_name);
|
||||||
|
|
||||||
/* Make sure that denorms are treated like zeros. This is
|
/* Make sure that denorms are treated like zeros. This is
|
||||||
|
@@ -97,9 +97,9 @@ static const char *
|
|||||||
llvmpipe_get_name(struct pipe_screen *screen)
|
llvmpipe_get_name(struct pipe_screen *screen)
|
||||||
{
|
{
|
||||||
static char buf[100];
|
static char buf[100];
|
||||||
util_snprintf(buf, sizeof(buf), "llvmpipe (LLVM %u.%u, %u bits)",
|
snprintf(buf, sizeof(buf), "llvmpipe (LLVM %u.%u, %u bits)",
|
||||||
HAVE_LLVM >> 8, HAVE_LLVM & 0xff,
|
HAVE_LLVM >> 8, HAVE_LLVM & 0xff,
|
||||||
lp_native_vector_width );
|
lp_native_vector_width );
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2490,8 +2490,8 @@ generate_fragment(struct llvmpipe_context *lp,
|
|||||||
|
|
||||||
blend_vec_type = lp_build_vec_type(gallivm, blend_type);
|
blend_vec_type = lp_build_vec_type(gallivm, blend_type);
|
||||||
|
|
||||||
util_snprintf(func_name, sizeof(func_name), "fs%u_variant%u_%s",
|
snprintf(func_name, sizeof(func_name), "fs%u_variant%u_%s",
|
||||||
shader->no, variant->no, partial_mask ? "partial" : "whole");
|
shader->no, variant->no, partial_mask ? "partial" : "whole");
|
||||||
|
|
||||||
arg_types[0] = variant->jit_context_ptr_type; /* context */
|
arg_types[0] = variant->jit_context_ptr_type; /* context */
|
||||||
arg_types[1] = int32_type; /* x */
|
arg_types[1] = int32_type; /* x */
|
||||||
@@ -2829,8 +2829,8 @@ generate_variant(struct llvmpipe_context *lp,
|
|||||||
if (!variant)
|
if (!variant)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
util_snprintf(module_name, sizeof(module_name), "fs%u_variant%u",
|
snprintf(module_name, sizeof(module_name), "fs%u_variant%u",
|
||||||
shader->no, shader->variants_created);
|
shader->no, shader->variants_created);
|
||||||
|
|
||||||
variant->gallivm = gallivm_create(module_name, lp->context);
|
variant->gallivm = gallivm_create(module_name, lp->context);
|
||||||
if (!variant->gallivm) {
|
if (!variant->gallivm) {
|
||||||
|
@@ -727,8 +727,8 @@ generate_setup_variant(struct lp_setup_variant_key *key,
|
|||||||
|
|
||||||
variant->no = setup_no++;
|
variant->no = setup_no++;
|
||||||
|
|
||||||
util_snprintf(func_name, sizeof(func_name), "setup_variant_%u",
|
snprintf(func_name, sizeof(func_name), "setup_variant_%u",
|
||||||
variant->no);
|
variant->no);
|
||||||
|
|
||||||
variant->gallivm = gallivm = gallivm_create(func_name, lp->context);
|
variant->gallivm = gallivm = gallivm_create(func_name, lp->context);
|
||||||
if (!variant->gallivm) {
|
if (!variant->gallivm) {
|
||||||
|
@@ -399,7 +399,7 @@ static boolean
|
|||||||
test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned length)
|
test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned length)
|
||||||
{
|
{
|
||||||
char test_name[128];
|
char test_name[128];
|
||||||
util_snprintf(test_name, sizeof test_name, "%s.v%u", test->name, length);
|
snprintf(test_name, sizeof test_name, "%s.v%u", test->name, length);
|
||||||
LLVMContextRef context;
|
LLVMContextRef context;
|
||||||
struct gallivm_state *gallivm;
|
struct gallivm_state *gallivm;
|
||||||
LLVMValueRef test_func;
|
LLVMValueRef test_func;
|
||||||
|
@@ -96,8 +96,8 @@ add_fetch_rgba_test(struct gallivm_state *gallivm, unsigned verbose,
|
|||||||
LLVMValueRef rgba;
|
LLVMValueRef rgba;
|
||||||
LLVMValueRef cache = NULL;
|
LLVMValueRef cache = NULL;
|
||||||
|
|
||||||
util_snprintf(name, sizeof name, "fetch_%s_%s", desc->short_name,
|
snprintf(name, sizeof name, "fetch_%s_%s", desc->short_name,
|
||||||
type.floating ? "float" : "unorm8");
|
type.floating ? "float" : "unorm8");
|
||||||
|
|
||||||
args[0] = LLVMPointerType(lp_build_vec_type(gallivm, type), 0);
|
args[0] = LLVMPointerType(lp_build_vec_type(gallivm, type), 0);
|
||||||
args[1] = LLVMPointerType(LLVMInt8TypeInContext(context), 0);
|
args[1] = LLVMPointerType(LLVMInt8TypeInContext(context), 0);
|
||||||
|
@@ -34,7 +34,7 @@ nouveau_screen_get_name(struct pipe_screen *pscreen)
|
|||||||
struct nouveau_device *dev = nouveau_screen(pscreen)->device;
|
struct nouveau_device *dev = nouveau_screen(pscreen)->device;
|
||||||
static char buffer[128];
|
static char buffer[128];
|
||||||
|
|
||||||
util_snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
|
snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,9 +82,9 @@ softpipe_flush( struct pipe_context *pipe,
|
|||||||
if (flags & PIPE_FLUSH_END_OF_FRAME) {
|
if (flags & PIPE_FLUSH_END_OF_FRAME) {
|
||||||
static unsigned frame_no = 1;
|
static unsigned frame_no = 1;
|
||||||
static char filename[256];
|
static char filename[256];
|
||||||
util_snprintf(filename, sizeof(filename), "cbuf_%u.bmp", frame_no);
|
snprintf(filename, sizeof(filename), "cbuf_%u.bmp", frame_no);
|
||||||
debug_dump_surface_bmp(pipe, filename, softpipe->framebuffer.cbufs[0]);
|
debug_dump_surface_bmp(pipe, filename, softpipe->framebuffer.cbufs[0]);
|
||||||
util_snprintf(filename, sizeof(filename), "zsbuf_%u.bmp", frame_no);
|
snprintf(filename, sizeof(filename), "zsbuf_%u.bmp", frame_no);
|
||||||
debug_dump_surface_bmp(pipe, filename, softpipe->framebuffer.zsbuf);
|
debug_dump_surface_bmp(pipe, filename, softpipe->framebuffer.zsbuf);
|
||||||
++frame_no;
|
++frame_no;
|
||||||
}
|
}
|
||||||
|
@@ -60,12 +60,12 @@ static void svga_flush( struct pipe_context *pipe,
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < fb->nr_cbufs; i++) {
|
for (i = 0; i < fb->nr_cbufs; i++) {
|
||||||
util_snprintf(filename, sizeof(filename), "cbuf%u_%04u.bmp", i, frame_no);
|
snprintf(filename, sizeof(filename), "cbuf%u_%04u.bmp", i, frame_no);
|
||||||
debug_dump_surface_bmp(&svga->pipe, filename, fb->cbufs[i]);
|
debug_dump_surface_bmp(&svga->pipe, filename, fb->cbufs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 && fb->zsbuf) {
|
if (0 && fb->zsbuf) {
|
||||||
util_snprintf(filename, sizeof(filename), "zsbuf_%04u.bmp", frame_no);
|
snprintf(filename, sizeof(filename), "zsbuf_%04u.bmp", frame_no);
|
||||||
debug_dump_surface_bmp(&svga->pipe, filename, fb->zsbuf);
|
debug_dump_surface_bmp(&svga->pipe, filename, fb->zsbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ svga_get_name( struct pipe_screen *pscreen )
|
|||||||
llvm = "LLVM;";
|
llvm = "LLVM;";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
util_snprintf(name, sizeof(name), "SVGA3D; %s %s %s", build, mutex, llvm);
|
snprintf(name, sizeof(name), "SVGA3D; %s %s %s", build, mutex, llvm);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -900,12 +900,12 @@ init_logging(struct pipe_screen *screen)
|
|||||||
char host_log[1000];
|
char host_log[1000];
|
||||||
|
|
||||||
/* Log Version to Host */
|
/* Log Version to Host */
|
||||||
util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
|
snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
|
||||||
"%s%s\n", log_prefix, svga_get_name(screen));
|
"%s%s\n", log_prefix, svga_get_name(screen));
|
||||||
svgascreen->sws->host_log(svgascreen->sws, host_log);
|
svgascreen->sws->host_log(svgascreen->sws, host_log);
|
||||||
|
|
||||||
util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
|
snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
|
||||||
"%s" PACKAGE_VERSION MESA_GIT_SHA1, log_prefix);
|
"%s" PACKAGE_VERSION MESA_GIT_SHA1, log_prefix);
|
||||||
svgascreen->sws->host_log(svgascreen->sws, host_log);
|
svgascreen->sws->host_log(svgascreen->sws, host_log);
|
||||||
|
|
||||||
/* If the SVGA_EXTRA_LOGGING env var is set, log the process's command
|
/* If the SVGA_EXTRA_LOGGING env var is set, log the process's command
|
||||||
@@ -914,8 +914,8 @@ init_logging(struct pipe_screen *screen)
|
|||||||
if (debug_get_bool_option("SVGA_EXTRA_LOGGING", FALSE)) {
|
if (debug_get_bool_option("SVGA_EXTRA_LOGGING", FALSE)) {
|
||||||
char cmdline[1000];
|
char cmdline[1000];
|
||||||
if (os_get_command_line(cmdline, sizeof(cmdline))) {
|
if (os_get_command_line(cmdline, sizeof(cmdline))) {
|
||||||
util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
|
snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
|
||||||
"%s%s\n", log_prefix, cmdline);
|
"%s%s\n", log_prefix, cmdline);
|
||||||
svgascreen->sws->host_log(svgascreen->sws, host_log);
|
svgascreen->sws->host_log(svgascreen->sws, host_log);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,9 +69,9 @@ static const char *
|
|||||||
swr_get_name(struct pipe_screen *screen)
|
swr_get_name(struct pipe_screen *screen)
|
||||||
{
|
{
|
||||||
static char buf[100];
|
static char buf[100];
|
||||||
util_snprintf(buf, sizeof(buf), "SWR (LLVM %u.%u, %u bits)",
|
snprintf(buf, sizeof(buf), "SWR (LLVM %u.%u, %u bits)",
|
||||||
HAVE_LLVM >> 8, HAVE_LLVM & 0xff,
|
HAVE_LLVM >> 8, HAVE_LLVM & 0xff,
|
||||||
lp_native_vector_width );
|
lp_native_vector_width);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1452,11 +1452,11 @@ void anv_GetPhysicalDeviceProperties2(
|
|||||||
(VkPhysicalDeviceDriverPropertiesKHR *) ext;
|
(VkPhysicalDeviceDriverPropertiesKHR *) ext;
|
||||||
|
|
||||||
driver_props->driverID = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR;
|
driver_props->driverID = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR;
|
||||||
util_snprintf(driver_props->driverName, VK_MAX_DRIVER_NAME_SIZE_KHR,
|
snprintf(driver_props->driverName, VK_MAX_DRIVER_NAME_SIZE_KHR,
|
||||||
"Intel open-source Mesa driver");
|
"Intel open-source Mesa driver");
|
||||||
|
|
||||||
util_snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
|
snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
|
||||||
"Mesa " PACKAGE_VERSION MESA_GIT_SHA1);
|
"Mesa " PACKAGE_VERSION MESA_GIT_SHA1);
|
||||||
|
|
||||||
driver_props->conformanceVersion = (VkConformanceVersionKHR) {
|
driver_props->conformanceVersion = (VkConformanceVersionKHR) {
|
||||||
.major = 1,
|
.major = 1,
|
||||||
|
@@ -330,7 +330,7 @@ debug_dump_enum(const struct debug_named_value *names,
|
|||||||
++names;
|
++names;
|
||||||
}
|
}
|
||||||
|
|
||||||
util_snprintf(rest, sizeof(rest), "0x%08lx", value);
|
snprintf(rest, sizeof(rest), "0x%08lx", value);
|
||||||
return rest;
|
return rest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ debug_dump_enum_noprefix(const struct debug_named_value *names,
|
|||||||
++names;
|
++names;
|
||||||
}
|
}
|
||||||
|
|
||||||
util_snprintf(rest, sizeof(rest), "0x%08lx", value);
|
snprintf(rest, sizeof(rest), "0x%08lx", value);
|
||||||
return rest;
|
return rest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +387,7 @@ debug_dump_flags(const struct debug_named_value *names, unsigned long value)
|
|||||||
else
|
else
|
||||||
first = 0;
|
first = 0;
|
||||||
|
|
||||||
util_snprintf(rest, sizeof(rest), "0x%08lx", value);
|
snprintf(rest, sizeof(rest), "0x%08lx", value);
|
||||||
strncat(output, rest, sizeof(output) - strlen(output) - 1);
|
strncat(output, rest, sizeof(output) - strlen(output) - 1);
|
||||||
output[sizeof(output) - 1] = '\0';
|
output[sizeof(output) - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
@@ -257,7 +257,7 @@ util_queue_thread_func(void *input)
|
|||||||
|
|
||||||
if (strlen(queue->name) > 0) {
|
if (strlen(queue->name) > 0) {
|
||||||
char name[16];
|
char name[16];
|
||||||
util_snprintf(name, sizeof(name), "%s%i", queue->name, thread_index);
|
snprintf(name, sizeof(name), "%s%i", queue->name, thread_index);
|
||||||
u_thread_setname(name);
|
u_thread_setname(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,10 +405,10 @@ util_queue_init(struct util_queue *queue,
|
|||||||
memset(queue, 0, sizeof(*queue));
|
memset(queue, 0, sizeof(*queue));
|
||||||
|
|
||||||
if (process_len) {
|
if (process_len) {
|
||||||
util_snprintf(queue->name, sizeof(queue->name), "%.*s:%s",
|
snprintf(queue->name, sizeof(queue->name), "%.*s:%s",
|
||||||
process_len, process_name, name);
|
process_len, process_name, name);
|
||||||
} else {
|
} else {
|
||||||
util_snprintf(queue->name, sizeof(queue->name), "%s", name);
|
snprintf(queue->name, sizeof(queue->name), "%s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
queue->flags = flags;
|
queue->flags = flags;
|
||||||
|
@@ -82,6 +82,7 @@ util_vsnprintf(char *str, size_t size, const char *format, va_list ap)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define snprintf util_snprintf
|
||||||
static inline int
|
static inline int
|
||||||
PRINTFLIKE(3, 4)
|
PRINTFLIKE(3, 4)
|
||||||
util_snprintf(char *str, size_t size, const char *format, ...)
|
util_snprintf(char *str, size_t size, const char *format, ...)
|
||||||
@@ -184,7 +185,6 @@ util_strncmp(const char *s1, const char *s2, size_t n)
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#define util_vsnprintf vsnprintf
|
#define util_vsnprintf vsnprintf
|
||||||
#define util_snprintf snprintf
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user