}
for (i = 0; i < auto_disc.results->len; i++) {
- struct auto_source_discovery_result *result =
+ struct auto_source_discovery_result *autodisc_result =
g_ptr_array_index(auto_disc.results, i);
bt_value_array_append_element_status append_element_status;
}
append_element_status = bt_value_array_append_string_element(
- component_info, result->plugin_name);
+ component_info, autodisc_result->plugin_name);
if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
"Failed to append one array element.");
}
append_element_status = bt_value_array_append_string_element(
- component_info, result->source_cc_name);
+ component_info, autodisc_result->source_cc_name);
if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
"Failed to append one array element.");
}
append_element_status = bt_value_array_append_element(
- component_info, result->inputs);
+ component_info, autodisc_result->inputs);
if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
"Failed to append one array element.");
}
append_element_status = bt_value_array_append_element(
- component_info, result->original_input_indices);
+ component_info, autodisc_result->original_input_indices);
if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
"Failed to append one array element.");
uint64_t sz = bt_value_array_get_length(value);
for (uint64_t i = 0; i < sz; i++) {
const bt_value *item;
- int ret;
if (i > 0) {
g_string_append(buf, ", ");
double dbl_val;
const char *str_val;
int size;
- int i;
GPtrArray *map_keys = NULL;
if (!value) {
bt_common_color_reset());
break;
case BT_VALUE_TYPE_ARRAY:
+ {
+ guint i;
size = bt_value_array_get_length(value);
if (size < 0) {
goto error;
print_value_rec(fp, element, indent + 2);
}
break;
+ }
case BT_VALUE_TYPE_MAP:
{
guint i;
/* Create all fields contained in the structure field. */
for (i = 0; i < structure_type->fields->len; i++) {
- struct bt_ctf_field_common *field;
+ struct bt_ctf_field_common *member_field;
struct bt_ctf_field_type_common_structure_field *struct_field =
BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(
structure_type, i);
- field = field_create_func(struct_field->type);
- if (!field) {
+ member_field = field_create_func(struct_field->type);
+ if (!member_field) {
BT_LOGE("Failed to create structure field's member: name=\"%s\", index=%zu",
g_quark_to_string(struct_field->name), i);
ret = -1;
goto end;
}
- g_ptr_array_index(structure->fields, i) = field;
+ g_ptr_array_index(structure->fields, i) = member_field;
}
BT_LOGD("Initialized common structure field object: addr=%p, ft-addr=%p",
/* Create all fields contained in the variant field. */
for (i = 0; i < variant_type->choices->len; i++) {
- struct bt_ctf_field_common *field;
+ struct bt_ctf_field_common *member_field;
struct bt_ctf_field_type_common_variant_choice *var_choice =
BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(
variant_type, i);
- field = field_create_func(var_choice->type);
- if (!field) {
+ member_field = field_create_func(var_choice->type);
+ if (!member_field) {
BT_LOGE("Failed to create variant field's member: name=\"%s\", index=%zu",
g_quark_to_string(var_choice->name), i);
ret = -1;
goto end;
}
- g_ptr_array_index(variant->fields, i) = field;
+ g_ptr_array_index(variant->fields, i) = member_field;
}
BT_LOGD("Initialized common variant field object: addr=%p, ft-addr=%p",
ctx->indent_level++;
for (i = 0; i < var_fc->options->len; i++) {
- struct fs_sink_ctf_named_field_class *named_fc =
+ struct fs_sink_ctf_named_field_class *option_named_fc =
fs_sink_ctf_field_class_variant_borrow_option_by_index(
var_fc, i);
append_indent(ctx);
g_string_append_printf(ctx->tsdl,
"\"%s\" = %" PRIu64 ",\n",
- named_fc->name->str, i);
+ option_named_fc->name->str, i);
}
append_end_block(ctx);
const bt_field_class_structure_member *member =
bt_field_class_structure_borrow_member_by_index_const(
fc, i);
- const bt_value *user_attrs;
+ const bt_value *member_user_attrs;
const bt_field_class *member_fc =
bt_field_class_structure_member_borrow_field_class_const(member);
write_nl(ctx);
write_compound_member_name(ctx,
bt_field_class_structure_member_get_name(member));
- user_attrs = bt_field_class_structure_member_borrow_user_attributes_const(
+ member_user_attrs = bt_field_class_structure_member_borrow_user_attributes_const(
member);
- if (bt_value_map_is_empty(user_attrs)) {
+ if (bt_value_map_is_empty(member_user_attrs)) {
write_sp(ctx);
write_field_class(ctx, member_fc);
} else {
write_nl(ctx);
/* User attributes */
- write_user_attributes(ctx, user_attrs,
+ write_user_attributes(ctx, member_user_attrs,
false, NULL);
decr_indent(ctx);
if (ranges) {
GArray *sorted_ranges = range_set_to_int_ranges(
ranges, selector_is_signed);
- uint64_t i;
BT_ASSERT_DBG(sorted_ranges);
BT_ASSERT_DBG(sorted_ranges->len > 0);
static
void write_trace(struct details_write_ctx *ctx, const bt_trace *trace)
{
- const char *name;
GPtrArray *streams = g_ptr_array_new();
uint64_t i;
bool printed_prop = false;
/* Write name */
if (ctx->details_comp->cfg.with_trace_name) {
- name = bt_trace_get_name(trace);
+ const char *name = bt_trace_get_name(trace);
if (name) {
g_string_append(ctx->str, " `");
write_str_prop_value(ctx, name);
for (i = 0; i < count; i++) {
const bt_message *msg = msgs[i];
bool has_ns_from_origin;
- int ret;
-
ret = get_msg_ns_from_origin(msg, &ns_from_origin,
&has_ns_from_origin);
if (ret) {