X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Ftrace-ir%2Ffield-class.c;h=78e30f4dc0109e916a921b5f24e07e2832418c2e;hb=c6fe8c4012c19ba7ab7fc16853a464e0381d6290;hp=fb2e99ec75b095556f6035ae543755e72cdef229;hpb=45c51519900e100d9acda4acb9516ef69bc2d045;p=babeltrace.git diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index fb2e99ec..78e30f4d 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -64,6 +64,88 @@ void init_field_class(struct bt_field_class *fc, enum bt_field_class_type type, fc->type = type; } +static +void destroy_bit_array_field_class(struct bt_object *obj) +{ + BT_ASSERT(obj); + BT_LIB_LOGD("Destroying bit array field class object: %!+F", obj); + g_free(obj); +} + +struct bt_field_class *bt_field_class_bit_array_create( + struct bt_trace_class *trace_class, uint64_t length) +{ + struct bt_field_class_bit_array *ba_fc = NULL; + + BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); + BT_ASSERT_PRE(length > 0 && length <= 64, + "Unsupported length for bit array field class " + "(minimum is 1, maximum is 64): length=%" PRIu64, length); + BT_LOGD("Creating default bit array field class object."); + ba_fc = g_new0(struct bt_field_class_bit_array, 1); + if (!ba_fc) { + BT_LIB_LOGE_APPEND_CAUSE( + "Failed to allocate one bit array field class."); + goto error; + } + + init_field_class((void *) ba_fc, BT_FIELD_CLASS_TYPE_BIT_ARRAY, + destroy_bit_array_field_class); + ba_fc->length = length; + BT_LIB_LOGD("Created bit array field class object: %!+F", ba_fc); + goto end; + +error: + BT_OBJECT_PUT_REF_AND_RESET(ba_fc); + +end: + return (void *) ba_fc; +} + +uint64_t bt_field_class_bit_array_get_length(const struct bt_field_class *fc) +{ + const struct bt_field_class_bit_array *ba_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_BIT_ARRAY, + "Field class"); + return ba_fc->length; +} + +static +void destroy_bool_field_class(struct bt_object *obj) +{ + BT_ASSERT(obj); + BT_LIB_LOGD("Destroying boolean field class object: %!+F", obj); + g_free(obj); +} + +struct bt_field_class *bt_field_class_bool_create( + bt_trace_class *trace_class) +{ + struct bt_field_class_bool *bool_fc = NULL; + + BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); + BT_LOGD("Creating default boolean field class object."); + bool_fc = g_new0(struct bt_field_class_bool, 1); + if (!bool_fc) { + BT_LIB_LOGE_APPEND_CAUSE( + "Failed to allocate one boolean field class."); + goto error; + } + + init_field_class((void *) bool_fc, BT_FIELD_CLASS_TYPE_BOOL, + destroy_bool_field_class); + BT_LIB_LOGD("Created boolean field class object: %!+F", bool_fc); + goto end; + +error: + BT_OBJECT_PUT_REF_AND_RESET(bool_fc); + +end: + return (void *) bool_fc; +} + static void init_integer_field_class(struct bt_field_class_integer *fc, enum bt_field_class_type type, @@ -109,14 +191,14 @@ end: return (void *) int_fc; } -struct bt_field_class *bt_field_class_unsigned_integer_create( +struct bt_field_class *bt_field_class_integer_unsigned_create( bt_trace_class *trace_class) { return create_integer_field_class(trace_class, BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER); } -struct bt_field_class *bt_field_class_signed_integer_create( +struct bt_field_class *bt_field_class_integer_signed_create( bt_trace_class *trace_class) { return create_integer_field_class(trace_class, @@ -133,7 +215,6 @@ uint64_t bt_field_class_integer_get_field_value_range( return int_fc->range; } -BT_ASSERT_PRE_FUNC static bool size_is_valid_for_enumeration_field_class(struct bt_field_class *fc, uint64_t size) @@ -270,14 +351,14 @@ end: return (void *) enum_fc; } -struct bt_field_class *bt_field_class_unsigned_enumeration_create( +struct bt_field_class *bt_field_class_enumeration_unsigned_create( bt_trace_class *trace_class) { return create_enumeration_field_class(trace_class, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION); } -struct bt_field_class *bt_field_class_signed_enumeration_create( +struct bt_field_class *bt_field_class_enumeration_signed_create( bt_trace_class *trace_class) { return create_enumeration_field_class(trace_class, @@ -294,8 +375,8 @@ uint64_t bt_field_class_enumeration_get_mapping_count( return (uint64_t) enum_fc->mappings->len; } -const struct bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( +const struct bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( const struct bt_field_class *fc, uint64_t index) { const struct bt_field_class_enumeration *enum_fc = (const void *) fc; @@ -307,8 +388,8 @@ bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index); } -const struct bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_index_const( +const struct bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_index_const( const struct bt_field_class *fc, uint64_t index) { const struct bt_field_class_enumeration *enum_fc = (const void *) fc; @@ -345,8 +426,8 @@ end: return mapping; } -const struct bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_label_const( +const struct bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_label_const( const struct bt_field_class *fc, const char *label) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -356,8 +437,8 @@ bt_field_class_signed_enumeration_borrow_mapping_by_label_const( (const void *) fc, label); } -const struct bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_label_const( +const struct bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( const struct bt_field_class *fc, const char *label) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -375,8 +456,8 @@ const char *bt_field_class_enumeration_mapping_get_label( } const struct bt_integer_range_set_unsigned * -bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( - const struct bt_field_class_unsigned_enumeration_mapping *u_mapping) +bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( + const struct bt_field_class_enumeration_unsigned_mapping *u_mapping) { const struct bt_field_class_enumeration_mapping *mapping = (const void *) u_mapping; @@ -386,8 +467,8 @@ bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( } const struct bt_integer_range_set_signed * -bt_field_class_signed_enumeration_mapping_borrow_ranges_const( - const struct bt_field_class_signed_enumeration_mapping *s_mapping) +bt_field_class_enumeration_signed_mapping_borrow_ranges_const( + const struct bt_field_class_enumeration_signed_mapping *s_mapping) { const struct bt_field_class_enumeration_mapping *mapping = (const void *) s_mapping; @@ -397,7 +478,7 @@ bt_field_class_signed_enumeration_mapping_borrow_ranges_const( } enum bt_field_class_enumeration_get_mapping_labels_for_value_status -bt_field_class_unsigned_enumeration_get_mapping_labels_for_value( +bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( const struct bt_field_class *fc, uint64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count) @@ -437,7 +518,7 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_for_value( } enum bt_field_class_enumeration_get_mapping_labels_for_value_status -bt_field_class_signed_enumeration_get_mapping_labels_for_value( +bt_field_class_enumeration_signed_get_mapping_labels_for_value( const struct bt_field_class *fc, int64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count) @@ -513,7 +594,7 @@ add_mapping_to_enumeration_field_class(struct bt_field_class *fc, BT_ASSERT(fc); BT_ASSERT_PRE_NON_NULL(label, "Label"); - BT_ASSERT_PRE_NON_NULL(range_set, "Range set"); + BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set"); BT_ASSERT_PRE(!enumeration_field_class_has_mapping_with_label( enum_fc, label), "Duplicate mapping name in enumeration field class: " @@ -536,7 +617,7 @@ end: } enum bt_field_class_enumeration_add_mapping_status -bt_field_class_unsigned_enumeration_add_mapping( +bt_field_class_enumeration_unsigned_add_mapping( struct bt_field_class *fc, const char *label, const struct bt_integer_range_set_unsigned *range_set) { @@ -548,7 +629,7 @@ bt_field_class_unsigned_enumeration_add_mapping( } enum bt_field_class_enumeration_add_mapping_status -bt_field_class_signed_enumeration_add_mapping( +bt_field_class_enumeration_signed_add_mapping( struct bt_field_class *fc, const char *label, const struct bt_integer_range_set_signed *range_set) { @@ -986,6 +1067,86 @@ bt_field_class_structure_member_borrow_field_class_const( return named_fc->fc; } +static +void destroy_option_field_class(struct bt_object *obj) +{ + struct bt_field_class_option *fc = (void *) obj; + + BT_ASSERT(fc); + BT_LIB_LOGD("Destroying option field class object: %!+F", fc); + BT_LOGD_STR("Putting content field class."); + BT_OBJECT_PUT_REF_AND_RESET(fc->content_fc); + BT_LOGD_STR("Putting selector field path."); + BT_OBJECT_PUT_REF_AND_RESET(fc->selector_field_path); + BT_LOGD_STR("Putting selector field class."); + BT_OBJECT_PUT_REF_AND_RESET(fc->selector_fc); + g_free(fc); +} + +struct bt_field_class *bt_field_class_option_create(bt_trace_class *trace_class, + bt_field_class *content_fc, bt_field_class *selector_fc) +{ + struct bt_field_class_option *opt_fc = NULL; + + BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); + BT_ASSERT_PRE_NON_NULL(content_fc, "Content field class"); + BT_LIB_LOGD("Creating option field class: " + "%![content-fc-]+F, %![sel-fc-]+F", content_fc, selector_fc); + opt_fc = g_new0(struct bt_field_class_option, 1); + if (!opt_fc) { + BT_LIB_LOGE_APPEND_CAUSE( + "Failed to allocate one option field class."); + goto error; + } + + init_field_class((void *) opt_fc, BT_FIELD_CLASS_TYPE_OPTION, + destroy_option_field_class); + opt_fc->content_fc = content_fc; + bt_object_get_no_null_check(opt_fc->content_fc); + bt_field_class_freeze(opt_fc->content_fc); + + if (selector_fc) { + BT_ASSERT_PRE_FC_HAS_ID(selector_fc, BT_FIELD_CLASS_TYPE_BOOL, + "Selector field class"); + opt_fc->selector_fc = selector_fc; + bt_object_get_no_null_check(opt_fc->selector_fc); + bt_field_class_freeze(selector_fc); + } + + BT_LIB_LOGD("Created option field class object: " + "%![opt-fc-]+F, %![sel-fc-]+F", opt_fc, selector_fc); + goto end; + +error: + BT_OBJECT_PUT_REF_AND_RESET(opt_fc); + +end: + return (void *) opt_fc; +} + +const struct bt_field_class *bt_field_class_option_borrow_field_class_const( + const struct bt_field_class *fc) +{ + struct bt_field_class_option *opt_fc = (void *) fc; + + BT_ASSERT_PRE_NON_NULL(fc, "Field class"); + BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_OPTION, + "Field class"); + return opt_fc->content_fc; +} + +const struct bt_field_path * +bt_field_class_option_borrow_selector_field_path_const( + const struct bt_field_class *fc) +{ + struct bt_field_class_option *opt_fc = (void *) fc; + + BT_ASSERT_PRE_NON_NULL(fc, "Field class"); + BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_OPTION, + "Field class"); + return opt_fc->selector_field_path; +} + static void finalize_variant_field_class(struct bt_field_class_variant *var_fc) { @@ -1227,10 +1388,10 @@ int append_option_to_variant_with_selector_field_class( BT_ASSERT_PRE_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_NON_NULL(name, "Name"); BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class"); - BT_ASSERT_PRE_NON_NULL(range_set, "Range set"); + BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set"); BT_ASSERT_PRE_FC_HAS_ID(fc, expected_type, "Field class"); BT_ASSERT_PRE(range_set->ranges->len > 0, - "Range set is empty: addr=%p", range_set); + "Integer range set is empty: %!+R", range_set); status = ranges_overlap(var_fc->common.common.named_fcs, range_set, expected_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR, &has_overlap); @@ -1240,8 +1401,8 @@ int append_option_to_variant_with_selector_field_class( } BT_ASSERT_PRE(!has_overlap, - "Range set's ranges and existing ranges have an overlap: " - "addr=%p", range_set); + "Integer range set's ranges and existing ranges have an overlap: " + "%!+R", range_set); opt = create_variant_with_selector_option(name, option_fc, range_set); if (!opt) { /* create_variant_with_selector_option() logs errors */ @@ -1265,7 +1426,7 @@ end: } enum bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_unsigned_selector_append_option( +bt_field_class_variant_with_selector_unsigned_append_option( struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc, const struct bt_integer_range_set_unsigned *range_set) @@ -1276,7 +1437,7 @@ bt_field_class_variant_with_unsigned_selector_append_option( } enum bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_signed_selector_append_option( +bt_field_class_variant_with_selector_signed_append_option( struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc, const struct bt_integer_range_set_signed *range_set) @@ -1317,8 +1478,30 @@ bt_field_class_variant_borrow_option_by_index_const( (void *) fc, index); } -const struct bt_field_class_variant_with_unsigned_selector_option * -bt_field_class_variant_with_unsigned_selector_borrow_option_by_name_const( +struct bt_field_class_variant_option * +bt_field_class_variant_borrow_option_by_name( + struct bt_field_class *fc, const char *name) +{ + BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); + BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class"); + return (void *) + borrow_named_field_class_from_container_field_class_by_name( + (void *) fc, name); +} + +struct bt_field_class_variant_option * +bt_field_class_variant_borrow_option_by_index( + struct bt_field_class *fc, uint64_t index) +{ + BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); + BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class"); + return (void *) + borrow_named_field_class_from_container_field_class_at_index( + (void *) fc, index); +} + +const struct bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1330,8 +1513,8 @@ bt_field_class_variant_with_unsigned_selector_borrow_option_by_name_const( (void *) fc, name); } -const struct bt_field_class_variant_with_unsigned_selector_option * -bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( +const struct bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1343,8 +1526,8 @@ bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( (void *) fc, index); } -const struct bt_field_class_variant_with_signed_selector_option * -bt_field_class_variant_with_signed_selector_borrow_option_by_name_const( +const struct bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1356,8 +1539,8 @@ bt_field_class_variant_with_signed_selector_borrow_option_by_name_const( (void *) fc, name); } -const struct bt_field_class_variant_with_signed_selector_option * -bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( +const struct bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1389,8 +1572,8 @@ bt_field_class_variant_option_borrow_field_class_const( } const struct bt_integer_range_set_unsigned * -bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( - const struct bt_field_class_variant_with_unsigned_selector_option *option) +bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + const struct bt_field_class_variant_with_selector_unsigned_option *option) { const struct bt_field_class_variant_with_selector_option *opt = (const void *) option; @@ -1400,8 +1583,8 @@ bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( } const struct bt_integer_range_set_signed * -bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( - const struct bt_field_class_variant_with_signed_selector_option *option) +bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + const struct bt_field_class_variant_with_selector_signed_option *option) { const struct bt_field_class_variant_with_selector_option *opt = (const void *) option; @@ -1452,15 +1635,15 @@ void destroy_static_array_field_class(struct bt_object *obj) } struct bt_field_class * -bt_field_class_static_array_create(bt_trace_class *trace_class, +bt_field_class_array_static_create(bt_trace_class *trace_class, struct bt_field_class *element_fc, uint64_t length) { - struct bt_field_class_static_array *array_fc = NULL; + struct bt_field_class_array_static *array_fc = NULL; BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class"); BT_LOGD_STR("Creating default static array field class object."); - array_fc = g_new0(struct bt_field_class_static_array, 1); + array_fc = g_new0(struct bt_field_class_array_static, 1); if (!array_fc) { BT_LIB_LOGE_APPEND_CAUSE( "Failed to allocate one static array field class."); @@ -1501,9 +1684,9 @@ bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc) return array_fc->element_fc; } -uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc) +uint64_t bt_field_class_array_static_get_length(const struct bt_field_class *fc) { - const struct bt_field_class_static_array *array_fc = (const void *) fc; + const struct bt_field_class_array_static *array_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_STATIC_ARRAY, @@ -1514,7 +1697,7 @@ uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc) static void destroy_dynamic_array_field_class(struct bt_object *obj) { - struct bt_field_class_dynamic_array *fc = (void *) obj; + struct bt_field_class_array_dynamic *fc = (void *) obj; BT_ASSERT(fc); BT_LIB_LOGD("Destroying dynamic array field class object: %!+F", fc); @@ -1526,16 +1709,17 @@ void destroy_dynamic_array_field_class(struct bt_object *obj) g_free(fc); } -struct bt_field_class *bt_field_class_dynamic_array_create( - bt_trace_class *trace_class, - struct bt_field_class *element_fc) +struct bt_field_class *bt_field_class_array_dynamic_create( + struct bt_trace_class *trace_class, + struct bt_field_class *element_fc, + struct bt_field_class *length_fc) { - struct bt_field_class_dynamic_array *array_fc = NULL; + struct bt_field_class_array_dynamic *array_fc = NULL; BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class"); BT_LOGD_STR("Creating default dynamic array field class object."); - array_fc = g_new0(struct bt_field_class_dynamic_array, 1); + array_fc = g_new0(struct bt_field_class_array_dynamic, 1); if (!array_fc) { BT_LIB_LOGE_APPEND_CAUSE( "Failed to allocate one dynamic array field class."); @@ -1545,6 +1729,15 @@ struct bt_field_class *bt_field_class_dynamic_array_create( init_array_field_class((void *) array_fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, destroy_dynamic_array_field_class, element_fc); + + if (length_fc) { + BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, + "Length field class"); + array_fc->length_fc = length_fc; + bt_object_get_no_null_check(array_fc->length_fc); + bt_field_class_freeze(length_fc); + } + BT_LIB_LOGD("Created dynamic array field class object: %!+F", array_fc); goto end; @@ -1555,30 +1748,11 @@ end: return (void *) array_fc; } -enum bt_field_class_dynamic_array_set_length_field_class_status -bt_field_class_dynamic_array_set_length_field_class( - struct bt_field_class *fc, - struct bt_field_class *length_fc) -{ - struct bt_field_class_dynamic_array *array_fc = (void *) fc; - - BT_ASSERT_PRE_NON_NULL(fc, "Dynamic array field class"); - BT_ASSERT_PRE_NON_NULL(length_fc, "Length field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, - "Field class"); - BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field class"); - BT_ASSERT_PRE_DEV_FC_HOT(fc, "Dynamic array field class"); - array_fc->length_fc = length_fc; - bt_object_get_no_null_check(array_fc->length_fc); - bt_field_class_freeze(length_fc); - return BT_FUNC_STATUS_OK; -} - const struct bt_field_path * -bt_field_class_dynamic_array_borrow_length_field_path_const( +bt_field_class_array_dynamic_borrow_length_field_path_const( const struct bt_field_class *fc) { - const struct bt_field_class_dynamic_array *seq_fc = (const void *) 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,