lib: make BT_ASSERT_{PRE,POST}() always on; add BT_ASSERT_{PRE,POST}_DEV()
[babeltrace.git] / src / lib / trace-ir / field-class.c
index 30a1444c67685ee7afba152f46fb060f0617e994..30f85dbf4ed8adf8c80e8eef12a1895c6d20ae56 100644 (file)
@@ -49,7 +49,7 @@
 enum bt_field_class_type bt_field_class_get_type(
                const struct bt_field_class *fc)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
        return fc->type;
 }
 
@@ -93,7 +93,8 @@ struct bt_field_class *create_integer_field_class(bt_trace_class *trace_class,
                bt_common_field_class_type_string(type));
        int_fc = g_new0(struct bt_field_class_integer, 1);
        if (!int_fc) {
-               BT_LOGE_STR("Failed to allocate one integer field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one integer field class.");
                goto error;
        }
 
@@ -127,8 +128,8 @@ uint64_t bt_field_class_integer_get_field_value_range(
 {
        const struct bt_field_class_integer *int_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
        return int_fc->range;
 }
 
@@ -148,7 +149,7 @@ void bt_field_class_integer_set_field_value_range(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        BT_ASSERT_PRE(size <= 64,
                "Unsupported size for integer field class's field value range "
                "(maximum is 64): size=%" PRIu64, size);
@@ -168,8 +169,8 @@ bt_field_class_integer_get_preferred_display_base(const struct bt_field_class *f
 {
        const struct bt_field_class_integer *int_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
        return int_fc->base;
 }
 
@@ -181,7 +182,7 @@ void bt_field_class_integer_set_preferred_display_base(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        int_fc->base = base;
        BT_LIB_LOGD("Set integer field class's preferred display base: %!+F", fc);
 }
@@ -240,7 +241,8 @@ struct bt_field_class *create_enumeration_field_class(
                bt_common_field_class_type_string(type));
        enum_fc = g_new0(struct bt_field_class_enumeration, 1);
        if (!enum_fc) {
-               BT_LOGE_STR("Failed to allocate one enumeration field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one enumeration field class.");
                goto error;
        }
 
@@ -249,13 +251,13 @@ struct bt_field_class *create_enumeration_field_class(
        enum_fc->mappings = g_array_new(FALSE, TRUE,
                sizeof(struct bt_field_class_enumeration_mapping));
        if (!enum_fc->mappings) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                goto error;
        }
 
        enum_fc->label_buf = g_ptr_array_new();
        if (!enum_fc->label_buf) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                goto error;
        }
 
@@ -288,8 +290,8 @@ uint64_t bt_field_class_enumeration_get_mapping_count(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ENUM(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ENUM(fc, "Field class");
        return (uint64_t) enum_fc->mappings->len;
 }
 
@@ -299,9 +301,9 @@ bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
 }
@@ -312,9 +314,9 @@ bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
 }
@@ -322,14 +324,14 @@ bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
 const char *bt_field_class_enumeration_mapping_get_label(
                const struct bt_field_class_enumeration_mapping *mapping)
 {
-       BT_ASSERT_PRE_NON_NULL(mapping, "Enumeration field class mapping");
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Enumeration field class mapping");
        return mapping->label->str;
 }
 
 uint64_t bt_field_class_enumeration_mapping_get_range_count(
                const struct bt_field_class_enumeration_mapping *mapping)
 {
-       BT_ASSERT_PRE_NON_NULL(mapping, "Enumeration field class mapping");
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Enumeration field class mapping");
        return (uint64_t) mapping->ranges->len;
 }
 
@@ -340,10 +342,10 @@ void get_enumeration_field_class_mapping_range_at_index(
 {
        const struct bt_field_class_enumeration_mapping_range *range;
 
-       BT_ASSERT_PRE_NON_NULL(mapping, "Ranges");
-       BT_ASSERT_PRE_NON_NULL(lower, "Range's lower (output)");
-       BT_ASSERT_PRE_NON_NULL(upper, "Range's upper (output)");
-       BT_ASSERT_PRE_VALID_INDEX(index, mapping->ranges->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Ranges");
+       BT_ASSERT_PRE_DEV_NON_NULL(lower, "Range's lower (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(upper, "Range's upper (output)");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, mapping->ranges->len);
        range = BT_FIELD_CLASS_ENUM_MAPPING_RANGE_AT_INDEX(mapping, index);
        *lower = range->lower.u;
        *upper = range->upper.u;
@@ -366,8 +368,8 @@ void bt_field_class_signed_enumeration_mapping_get_range_by_index(
                (uint64_t *) lower, (uint64_t *) upper);
 }
 
-enum bt_field_class_enumeration_get_mapping_labels_by_value_status
-bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
+enum bt_field_class_enumeration_get_mapping_labels_for_value_status
+bt_field_class_unsigned_enumeration_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)
@@ -375,10 +377,10 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -406,8 +408,8 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
        return BT_FUNC_STATUS_OK;
 }
 
-enum bt_field_class_enumeration_get_mapping_labels_by_value_status
-bt_field_class_signed_enumeration_get_mapping_labels_by_value(
+enum bt_field_class_enumeration_get_mapping_labels_for_value_status
+bt_field_class_signed_enumeration_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)
@@ -415,10 +417,10 @@ bt_field_class_signed_enumeration_get_mapping_labels_by_value(
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -512,7 +514,8 @@ end:
        return ret;
 }
 
-enum bt_field_class_enumeration_map_range_status bt_field_class_unsigned_enumeration_map_range(
+enum bt_field_class_enumeration_map_range_status
+bt_field_class_unsigned_enumeration_map_range(
                struct bt_field_class *fc, const char *label,
                uint64_t range_lower, uint64_t range_upper)
 {
@@ -537,7 +540,8 @@ enum bt_field_class_enumeration_map_range_status bt_field_class_unsigned_enumera
                range_upper);
 }
 
-enum bt_field_class_enumeration_map_range_status bt_field_class_signed_enumeration_map_range(
+enum bt_field_class_enumeration_map_range_status
+bt_field_class_signed_enumeration_map_range(
                struct bt_field_class *fc, const char *label,
                int64_t range_lower, int64_t range_upper)
 {
@@ -578,7 +582,7 @@ struct bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class)
        BT_LOGD_STR("Creating default real field class object.");
        real_fc = g_new0(struct bt_field_class_real, 1);
        if (!real_fc) {
-               BT_LOGE_STR("Failed to allocate one real field class.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one real field class.");
                goto error;
        }
 
@@ -598,8 +602,8 @@ bt_bool bt_field_class_real_is_single_precision(const struct bt_field_class *fc)
 {
        const struct bt_field_class_real *real_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
        return real_fc->is_single_precision;
 }
 
@@ -610,7 +614,7 @@ void bt_field_class_real_set_is_single_precision(struct bt_field_class *fc,
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        real_fc->is_single_precision = (bool) is_single_precision;
        BT_LIB_LOGD("Set real field class's \"is single precision\" property: "
                "%!+F", fc);
@@ -628,14 +632,14 @@ int init_named_field_classes_container(
        fc->named_fcs = g_array_new(FALSE, TRUE,
                sizeof(struct bt_named_field_class));
        if (!fc->named_fcs) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                ret = -1;
                goto end;
        }
 
        fc->name_to_index = g_hash_table_new(g_str_hash, g_str_equal);
        if (!fc->name_to_index) {
-               BT_LOGE_STR("Failed to allocate a GHashTable.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GHashTable.");
                ret = -1;
                goto end;
        }
@@ -703,7 +707,8 @@ struct bt_field_class *bt_field_class_structure_create(
        BT_LOGD_STR("Creating default structure field class object.");
        struct_fc = g_new0(struct bt_field_class_structure, 1);
        if (!struct_fc) {
-               BT_LOGE_STR("Failed to allocate one structure field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one structure field class.");
                goto error;
        }
 
@@ -733,7 +738,7 @@ int append_named_field_class_to_container_field_class(
        GString *name_str;
 
        BT_ASSERT(container_fc);
-       BT_ASSERT_PRE_FC_HOT(container_fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(container_fc, "Field class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE(!bt_g_hash_table_contains(container_fc->name_to_index,
@@ -742,7 +747,7 @@ int append_named_field_class_to_container_field_class(
                "%![container-fc-]+F, name=\"%s\"", container_fc, name);
        name_str = g_string_new(name);
        if (!name_str) {
-               BT_LOGE_STR("Failed to allocate a GString.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
                ret = BT_FUNC_STATUS_MEMORY_ERROR;
                goto end;
        }
@@ -786,8 +791,8 @@ uint64_t bt_field_class_structure_get_member_count(
 {
        struct bt_field_class_structure *struct_fc = (void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (uint64_t) struct_fc->common.named_fcs->len;
 }
@@ -799,7 +804,7 @@ borrow_named_field_class_from_container_field_class_at_index(
                uint64_t index)
 {
        BT_ASSERT(fc);
-       BT_ASSERT_PRE_VALID_INDEX(index, fc->named_fcs->len);
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, fc->named_fcs->len);
        return BT_FIELD_CLASS_NAMED_FC_AT_INDEX(fc, index);
 }
 
@@ -807,8 +812,8 @@ const struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_index_const(
                const struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_at_index(
@@ -819,8 +824,8 @@ struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_index(
                struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_at_index(
@@ -838,7 +843,7 @@ borrow_named_field_class_from_container_field_class_by_name(
        gpointer value;
 
        BT_ASSERT(fc);
-       BT_ASSERT_PRE_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
        if (!g_hash_table_lookup_extended(fc->name_to_index, name, &orig_key,
                        &value)) {
                goto end;
@@ -855,8 +860,8 @@ const struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_name_const(
                const struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_by_name(
@@ -867,8 +872,8 @@ struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_name(
                struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_by_name(
@@ -880,7 +885,7 @@ const char *bt_field_class_structure_member_get_name(
 {
        const struct bt_named_field_class *named_fc = (const void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->name->str;
 }
 
@@ -890,7 +895,7 @@ bt_field_class_structure_member_borrow_field_class_const(
 {
        const struct bt_named_field_class *named_fc = (const void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->fc;
 }
 
@@ -900,7 +905,7 @@ bt_field_class_structure_member_borrow_field_class(
 {
        struct bt_named_field_class *named_fc = (void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->fc;
 }
 
@@ -929,7 +934,8 @@ struct bt_field_class *bt_field_class_variant_create(
        BT_LOGD_STR("Creating default variant field class object.");
        var_fc = g_new0(struct bt_field_class_variant, 1);
        if (!var_fc) {
-               BT_LOGE_STR("Failed to allocate one variant field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one variant field class.");
                goto error;
        }
 
@@ -960,7 +966,7 @@ bt_field_class_variant_set_selector_field_class(
        BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field class");
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Variant field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Variant field class");
        var_fc->selector_fc = selector_fc;
        bt_object_get_no_null_check(selector_fc);
        bt_field_class_freeze(selector_fc);
@@ -983,8 +989,9 @@ const struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_name_const(
                const struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
+               "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_by_name(
                        (void *) fc, name);
@@ -994,8 +1001,8 @@ 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_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_by_name(
                        (void *) fc, name);
@@ -1005,8 +1012,8 @@ uint64_t bt_field_class_variant_get_option_count(const struct bt_field_class *fc
 {
        const struct bt_field_class_variant *var_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (uint64_t) var_fc->common.named_fcs->len;
 }
 
@@ -1014,8 +1021,8 @@ const struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_index_const(
                const struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_at_index(
                        (void *) fc, index);
@@ -1025,8 +1032,8 @@ 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_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_at_index(
                        (void *) fc, index);
@@ -1037,7 +1044,7 @@ const char *bt_field_class_variant_option_get_name(
 {
        const struct bt_named_field_class *named_fc = (const void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->name->str;
 }
 
@@ -1047,7 +1054,7 @@ bt_field_class_variant_option_borrow_field_class_const(
 {
        const struct bt_named_field_class *named_fc = (const void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->fc;
 }
 
@@ -1057,7 +1064,7 @@ bt_field_class_variant_option_borrow_field_class(
 {
        struct bt_named_field_class *named_fc = (void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->fc;
 }
 
@@ -1067,8 +1074,8 @@ bt_field_class_variant_borrow_selector_field_path_const(
 {
        const struct bt_field_class_variant *var_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
                "Field class");
        return var_fc->selector_field_path;
 }
@@ -1113,7 +1120,8 @@ bt_field_class_static_array_create(bt_trace_class *trace_class,
        BT_LOGD_STR("Creating default static array field class object.");
        array_fc = g_new0(struct bt_field_class_static_array, 1);
        if (!array_fc) {
-               BT_LOGE_STR("Failed to allocate one static array field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one static array field class.");
                goto error;
        }
 
@@ -1136,8 +1144,8 @@ bt_field_class_array_borrow_element_field_class_const(
 {
        const struct bt_field_class_array *array_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ARRAY(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
        return array_fc->element_fc;
 }
 
@@ -1146,8 +1154,8 @@ bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc)
 {
        struct bt_field_class_array *array_fc = (void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ARRAY(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
        return array_fc->element_fc;
 }
 
@@ -1155,8 +1163,8 @@ uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc)
 {
        const struct bt_field_class_static_array *array_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
                "Field class");
        return (uint64_t) array_fc->length;
 }
@@ -1187,7 +1195,8 @@ struct bt_field_class *bt_field_class_dynamic_array_create(
        BT_LOGD_STR("Creating default dynamic array field class object.");
        array_fc = g_new0(struct bt_field_class_dynamic_array, 1);
        if (!array_fc) {
-               BT_LOGE_STR("Failed to allocate one dynamic array field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one dynamic array field class.");
                goto error;
        }
 
@@ -1216,7 +1225,7 @@ bt_field_class_dynamic_array_set_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_FC_HOT(fc, "Dynamic array 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(length_fc);
        bt_field_class_freeze(length_fc);
@@ -1229,8 +1238,8 @@ bt_field_class_dynamic_array_borrow_length_field_path_const(
 {
        const struct bt_field_class_dynamic_array *seq_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        return seq_fc->length_field_path;
 }
@@ -1251,7 +1260,8 @@ struct bt_field_class *bt_field_class_string_create(bt_trace_class *trace_class)
        BT_LOGD_STR("Creating default string field class object.");
        string_fc = g_new0(struct bt_field_class_string, 1);
        if (!string_fc) {
-               BT_LOGE_STR("Failed to allocate one string field class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one string field class.");
                goto error;
        }
 
@@ -1311,7 +1321,7 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc)
 }
 
 BT_HIDDEN
-void _bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc)
+void bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc)
 {
        struct bt_field_class *fc = (void *) c_fc;
 
This page took 0.033366 seconds and 4 git commands to generate.