lib: make BT_ASSERT_{PRE,POST}() always on; add BT_ASSERT_{PRE,POST}_DEV()
[babeltrace.git] / src / lib / trace-ir / field.c
index 3f10d6eea28274177c905ead24f0a9db81197a32..26def356315090b30d4bd6f42ae839db53babb9e 100644 (file)
@@ -185,20 +185,20 @@ void (* const field_destroy_funcs[])(struct bt_field *) = {
 
 struct bt_field_class *bt_field_borrow_class(const struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
        return field->class;
 }
 
 const struct bt_field_class *bt_field_borrow_class_const(
                const struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
        return field->class;
 }
 
 enum bt_field_class_type bt_field_get_class_type(const struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
        return field->class->type;
 }
 
@@ -207,11 +207,11 @@ struct bt_field *bt_field_create(struct bt_field_class *fc)
 {
        struct bt_field *field = NULL;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+       BT_ASSERT(fc);
        BT_ASSERT(bt_field_class_has_known_type(fc));
        field = field_create_funcs[fc->type](fc);
        if (!field) {
-               BT_LIB_LOGE("Cannot create field object from field class: "
+               BT_LIB_LOGE_APPEND_CAUSE("Cannot create field object from field class: "
                        "%![fc-]+F", fc);
                goto end;
        }
@@ -240,7 +240,8 @@ struct bt_field *create_integer_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating integer field object: %![fc-]+F", fc);
        int_field = g_new0(struct bt_field_integer, 1);
        if (!int_field) {
-               BT_LOGE_STR("Failed to allocate one integer field.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one integer field.");
                goto end;
        }
 
@@ -259,7 +260,7 @@ struct bt_field *create_real_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating real field object: %![fc-]+F", fc);
        real_field = g_new0(struct bt_field_real, 1);
        if (!real_field) {
-               BT_LOGE_STR("Failed to allocate one real field.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one real field.");
                goto end;
        }
 
@@ -278,7 +279,8 @@ struct bt_field *create_string_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating string field object: %![fc-]+F", fc);
        string_field = g_new0(struct bt_field_string, 1);
        if (!string_field) {
-               BT_LOGE_STR("Failed to allocate one string field.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one string field.");
                goto end;
        }
 
@@ -286,7 +288,7 @@ struct bt_field *create_string_field(struct bt_field_class *fc)
        string_field->buf = g_array_sized_new(FALSE, FALSE,
                sizeof(char), 1);
        if (!string_field->buf) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                BT_OBJECT_PUT_REF_AND_RESET(string_field);
                goto end;
        }
@@ -309,7 +311,7 @@ int create_fields_from_named_field_classes(
        *fields = g_ptr_array_new_with_free_func(
                (GDestroyNotify) bt_field_destroy);
        if (!*fields) {
-               BT_LOGE_STR("Failed to allocate a GPtrArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GPtrArray.");
                ret = -1;
                goto end;
        }
@@ -323,7 +325,8 @@ int create_fields_from_named_field_classes(
 
                field = bt_field_create(named_fc->fc);
                if (!field) {
-                       BT_LIB_LOGE("Failed to create structure member or variant option field: "
+                       BT_LIB_LOGE_APPEND_CAUSE(
+                               "Failed to create structure member or variant option field: "
                                "name=\"%s\", %![fc-]+F",
                                named_fc->name->str, named_fc->fc);
                        ret = -1;
@@ -345,7 +348,8 @@ struct bt_field *create_structure_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating structure field object: %![fc-]+F", fc);
        struct_field = g_new0(struct bt_field_structure, 1);
        if (!struct_field) {
-               BT_LOGE_STR("Failed to allocate one structure field.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one structure field.");
                goto end;
        }
 
@@ -353,8 +357,8 @@ struct bt_field *create_structure_field(struct bt_field_class *fc)
 
        if (create_fields_from_named_field_classes((void *) fc,
                        &struct_field->fields)) {
-               BT_LIB_LOGE("Cannot create structure member fields: "
-                       "%![fc-]+F", fc);
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Cannot create structure member fields: %![fc-]+F", fc);
                BT_OBJECT_PUT_REF_AND_RESET(struct_field);
                goto end;
        }
@@ -373,7 +377,8 @@ struct bt_field *create_variant_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating variant field object: %![fc-]+F", fc);
        var_field = g_new0(struct bt_field_variant, 1);
        if (!var_field) {
-               BT_LOGE_STR("Failed to allocate one variant field.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one variant field.");
                goto end;
        }
 
@@ -381,7 +386,7 @@ struct bt_field *create_variant_field(struct bt_field_class *fc)
 
        if (create_fields_from_named_field_classes((void *) fc,
                        &var_field->fields)) {
-               BT_LIB_LOGE("Cannot create variant member fields: "
+               BT_LIB_LOGE_APPEND_CAUSE("Cannot create variant member fields: "
                        "%![fc-]+F", fc);
                BT_OBJECT_PUT_REF_AND_RESET(var_field);
                goto end;
@@ -404,7 +409,7 @@ int init_array_field_fields(struct bt_field_array *array_field)
        array_fc = (void *) array_field->common.class;
        array_field->fields = g_ptr_array_sized_new(array_field->length);
        if (!array_field->fields) {
-               BT_LOGE_STR("Failed to allocate a GPtrArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GPtrArray.");
                ret = -1;
                goto end;
        }
@@ -417,7 +422,8 @@ int init_array_field_fields(struct bt_field_array *array_field)
                array_field->fields->pdata[i] = bt_field_create(
                        array_fc->element_fc);
                if (!array_field->fields->pdata[i]) {
-                       BT_LIB_LOGE("Cannot create array field's element field: "
+                       BT_LIB_LOGE_APPEND_CAUSE(
+                               "Cannot create array field's element field: "
                                "index=%" PRIu64 ", %![fc-]+F", i, array_fc);
                        ret = -1;
                        goto end;
@@ -437,7 +443,8 @@ struct bt_field *create_static_array_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating static array field object: %![fc-]+F", fc);
        array_field = g_new0(struct bt_field_array, 1);
        if (!array_field) {
-               BT_LOGE_STR("Failed to allocate one static array field.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one static array field.");
                goto end;
        }
 
@@ -445,7 +452,7 @@ struct bt_field *create_static_array_field(struct bt_field_class *fc)
        array_field->length = array_fc->length;
 
        if (init_array_field_fields(array_field)) {
-               BT_LIB_LOGE("Cannot create static array fields: "
+               BT_LIB_LOGE_APPEND_CAUSE("Cannot create static array fields: "
                        "%![fc-]+F", fc);
                BT_OBJECT_PUT_REF_AND_RESET(array_field);
                goto end;
@@ -465,14 +472,15 @@ struct bt_field *create_dynamic_array_field(struct bt_field_class *fc)
        BT_LIB_LOGD("Creating dynamic array field object: %![fc-]+F", fc);
        array_field = g_new0(struct bt_field_array, 1);
        if (!array_field) {
-               BT_LOGE_STR("Failed to allocate one dynamic array field.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one dynamic array field.");
                goto end;
        }
 
        init_field((void *) array_field, fc, &array_field_methods);
 
        if (init_array_field_fields(array_field)) {
-               BT_LIB_LOGE("Cannot create dynamic array fields: "
+               BT_LIB_LOGE_APPEND_CAUSE("Cannot create dynamic array fields: "
                        "%![fc-]+F", fc);
                BT_OBJECT_PUT_REF_AND_RESET(array_field);
                goto end;
@@ -488,9 +496,9 @@ int64_t bt_field_signed_integer_get_value(const struct bt_field *field)
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
        return int_field->value.i;
 }
 
@@ -498,10 +506,10 @@ void bt_field_signed_integer_set_value(struct bt_field *field, int64_t value)
 {
        struct bt_field_integer *int_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SIGNED_INT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE(bt_util_value_is_in_range_signed(
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_signed(
                ((struct bt_field_class_integer *) field->class)->range, value),
                "Value is out of bounds: value=%" PRId64 ", %![field-]+f, "
                "%![fc-]+F", value, field, field->class);
@@ -513,9 +521,9 @@ uint64_t bt_field_unsigned_integer_get_value(const struct bt_field *field)
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_UNSIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
        return int_field->value.u;
 }
 
@@ -523,10 +531,10 @@ void bt_field_unsigned_integer_set_value(struct bt_field *field, uint64_t value)
 {
        struct bt_field_integer *int_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_UNSIGNED_INT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE(bt_util_value_is_in_range_unsigned(
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_unsigned(
                ((struct bt_field_class_integer *) field->class)->range, value),
                "Value is out of bounds: value=%" PRIu64 ", %![field-]+f, "
                "%![fc-]+F", value, field, field->class);
@@ -538,9 +546,9 @@ double bt_field_real_get_value(const struct bt_field *field)
 {
        const struct bt_field_real *real_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
        return real_field->value;
 }
 
@@ -548,10 +556,10 @@ void bt_field_real_set_value(struct bt_field *field, double value)
 {
        struct bt_field_real *real_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE(
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV(
                !((struct bt_field_class_real *) field->class)->is_single_precision ||
                (double) (float) value == value,
                "Invalid value for a single-precision real number: value=%f, "
@@ -568,14 +576,14 @@ bt_field_unsigned_enumeration_get_mapping_labels(
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Count (output)");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field");
        return (int)
-               bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
+               bt_field_class_unsigned_enumeration_get_mapping_labels_for_value(
                        field->class, int_field->value.u, label_array, count);
 }
 
@@ -587,14 +595,14 @@ bt_field_signed_enumeration_get_mapping_labels(
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Count (output)");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field");
        return (int)
-               bt_field_class_signed_enumeration_get_mapping_labels_by_value(
+               bt_field_class_signed_enumeration_get_mapping_labels_for_value(
                        field->class, int_field->value.i, label_array, count);
 }
 
@@ -602,9 +610,9 @@ const char *bt_field_string_get_value(const struct bt_field *field)
 {
        const struct bt_field_string *string_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        return (const char *) string_field->buf->data;
 }
@@ -613,9 +621,9 @@ uint64_t bt_field_string_get_length(const struct bt_field *field)
 {
        const struct bt_field_string *string_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        return string_field->length;
 }
@@ -633,10 +641,10 @@ void clear_string_field(struct bt_field *field)
 enum bt_field_string_set_value_status bt_field_string_set_value(
                struct bt_field *field, const char *value)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(value, "Value");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        clear_string_field(field);
        return (int) bt_field_string_append_with_length(field, value,
@@ -657,14 +665,14 @@ enum bt_field_string_append_status bt_field_string_append_with_length(
        char *data;
        uint64_t new_length;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(value, "Value");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRING, "Field");
 
        /* Make sure no null bytes are appended */
-       BT_ASSERT_PRE(memchr(value, '\0', length) == NULL,
+       BT_ASSERT_PRE_DEV(memchr(value, '\0', length) == NULL,
                "String value to append contains a null character: "
                "partial-value=\"%.32s\", length=%" PRIu64, value, length);
 
@@ -684,9 +692,9 @@ enum bt_field_string_append_status bt_field_string_append_with_length(
 
 void bt_field_string_clear(struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRING, "Field");
        clear_string_field(field);
 }
@@ -695,8 +703,8 @@ uint64_t bt_field_array_get_length(const struct bt_field *field)
 {
        const struct bt_field_array *array_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_ARRAY(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
        return array_field->length;
 }
 
@@ -706,10 +714,10 @@ enum bt_field_dynamic_array_set_length_status bt_field_dynamic_array_set_length(
        int ret = BT_FUNC_STATUS_OK;
        struct bt_field_array *array_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
 
        if (G_UNLIKELY(length > array_field->fields->len)) {
                /* Make more room */
@@ -725,7 +733,8 @@ enum bt_field_dynamic_array_set_length_status bt_field_dynamic_array_set_length(
                                array_fc->element_fc);
 
                        if (!elem_field) {
-                               BT_LIB_LOGE("Cannot create element field for "
+                               BT_LIB_LOGE_APPEND_CAUSE(
+                                       "Cannot create element field for "
                                        "dynamic array field: "
                                        "index=%" PRIu64 ", "
                                        "%![array-field-]+f", i, field);
@@ -750,9 +759,9 @@ struct bt_field *borrow_array_field_element_field_by_index(
 {
        struct bt_field_array *array_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_ARRAY(field, "Field");
-       BT_ASSERT_PRE_VALID_INDEX(index, array_field->length);
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, array_field->length);
        return array_field->fields->pdata[index];
 }
 
@@ -775,10 +784,10 @@ struct bt_field *borrow_structure_field_member_field_by_index(
 {
        struct bt_field_structure *struct_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
-       BT_ASSERT_PRE_VALID_INDEX(index, struct_field->fields->len);
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, struct_field->fields->len);
        return struct_field->fields->pdata[index];
 }
 
@@ -807,9 +816,9 @@ struct bt_field *borrow_structure_field_member_field_by_name(
        gpointer orig_key;
        gpointer index;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(name, "Field name");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Field name");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
        struct_fc = (void *) field->class;
 
@@ -844,10 +853,10 @@ struct bt_field *borrow_variant_field_selected_option_field(
 {
        struct bt_field_variant *var_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_VARIANT, "Field");
-       BT_ASSERT_PRE(var_field->selected_field,
+       BT_ASSERT_PRE_DEV(var_field->selected_field,
                "Variant field has no selected field: %!+f", field);
        return var_field->selected_field;
 }
@@ -870,11 +879,11 @@ bt_field_variant_select_option_field(
 {
        struct bt_field_variant *var_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_VARIANT, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_VALID_INDEX(index, var_field->fields->len);
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, var_field->fields->len);
        var_field->selected_field = var_field->fields->pdata[index];
        var_field->selected_index = index;
        return BT_FUNC_STATUS_OK;
@@ -885,10 +894,10 @@ uint64_t bt_field_variant_get_selected_option_field_index(
 {
        const struct bt_field_variant *var_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_VARIANT, "Field");
-       BT_ASSERT_PRE(var_field->selected_field,
+       BT_ASSERT_PRE_DEV(var_field->selected_field,
                "Variant field has no selected field: %!+f", field);
        return var_field->selected_index;
 }
This page took 0.033328 seconds and 4 git commands to generate.