bt_object_get_ref_no_null_check(var_with_sel_fc->selector_fc);
bt_field_class_freeze(selector_fc);
var_fc = (void *) var_with_sel_fc;
+ BT_LIB_LOGD("Created default variant field class with selector object: "
+ "%![var-fc-]+F, %![sel-fc-]+F", var_fc, selector_fc);
} else {
var_fc = g_new0(struct bt_field_class_variant, 1);
if (!var_fc) {
/* init_named_field_classes_container() logs errors */
goto error;
}
+ BT_LIB_LOGD("Created default variant field class without selector object: "
+ "%![var-fc-]+F", var_fc);
}
BT_ASSERT(var_fc);
- BT_LIB_LOGD("Created default variant field class with selector object: "
- "%![var-fc-]+F, %![sel-fc-]+F", var_fc, selector_fc);
goto end;
error:
BT_OBJECT_PUT_REF_AND_RESET(var_fc);
+ BT_OBJECT_PUT_REF_AND_RESET(var_with_sel_fc);
end:
return (void *) var_fc;
}
if (init_array_field_class((void *) array_fc,
- BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
+ length_fc ?
+ BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD :
+ BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD,
destroy_dynamic_array_field_class, element_fc)) {
goto error;
}
}
const struct bt_field_path *
-bt_field_class_array_dynamic_borrow_length_field_path_const(
+bt_field_class_array_dynamic_with_length_field_borrow_length_field_path_const(
const struct bt_field_class *fc)
{
const struct bt_field_class_array_dynamic *seq_fc = (const void *) fc;
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
- BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
+ BT_ASSERT_PRE_DEV_FC_HAS_ID(fc,
+ BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD,
"Field class");
return seq_fc->length_field_path;
}
break;
}
case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
- case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
+ case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD:
+ case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD:
{
struct bt_field_class_array *array_fc = (void *) fc;