Replace assert() -> BT_ASSERT() and some preconditions with BT_ASSERT_PRE()
[babeltrace.git] / lib / ctf-ir / resolve.c
index 2a6ba2b2f7b39b8ddc69425e11a8a933517c8d28..049ddda73c391065c859b538c9d733c943d3a8e8 100644 (file)
@@ -42,6 +42,7 @@
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/values.h>
 #include <babeltrace/types.h>
+#include <babeltrace/assert-internal.h>
 #include <limits.h>
 #include <inttypes.h>
 #include <stdlib.h>
@@ -257,7 +258,7 @@ static
 struct bt_field_type *get_type_from_ctx(struct resolve_context *ctx,
                enum bt_scope scope)
 {
-       assert(scope >= BT_SCOPE_TRACE_PACKET_HEADER &&
+       BT_ASSERT(scope >= BT_SCOPE_TRACE_PACKET_HEADER &&
                scope <= BT_SCOPE_EVENT_FIELDS);
 
        return ctx->scopes[scope - BT_SCOPE_TRACE_PACKET_HEADER];
@@ -833,7 +834,7 @@ int get_field_paths_lca_index(struct bt_field_path *field_path1,
        /*
         * Start from both roots and find the first mismatch.
         */
-       assert(field_path1->root == field_path2->root);
+       BT_ASSERT(field_path1->root == field_path2->root);
        field_path1_len = field_path1->indexes->len;
        field_path2_len = field_path2->indexes->len;
 
@@ -1218,7 +1219,7 @@ int resolve_root_type(enum bt_scope root_scope, struct resolve_context *ctx)
 {
        int ret;
 
-       assert(type_stack_size(ctx->type_stack) == 0);
+       BT_ASSERT(type_stack_size(ctx->type_stack) == 0);
        ctx->root_scope = root_scope;
        ret = resolve_type(get_type_from_ctx(ctx, root_scope), ctx);
        ctx->root_scope = BT_SCOPE_UNKNOWN;
This page took 0.025139 seconds and 4 git commands to generate.