Add bt_common_abort() and use it instead of abort() directly
[babeltrace.git] / src / plugins / ctf / common / metadata / visitor-generate-ir.c
index 22379aa9d4ee3cc1f4a2cb232684bdd5f51a5f59..604388b4cf2e17cf005a05ca9b9ab60911280f8f 100644 (file)
@@ -49,7 +49,6 @@
 
 #include "logging.h"
 #include "scanner.h"
-#include "parser.h"
 #include "ast.h"
 #include "decoder.h"
 #include "ctf-meta.h"
@@ -869,6 +868,7 @@ end:
        return ret;
 }
 
+static
 int get_unary_uuid(struct ctx *ctx, struct bt_list_head *head,
                bt_uuid_t uuid)
 {
@@ -3494,6 +3494,8 @@ int auto_map_fields_to_trace_clock_class(struct ctx *ctx,
                } else if (root_fc->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
                        named_fc = ctf_field_class_variant_borrow_option_by_index(
                                var_fc, i);
+               } else {
+                       bt_common_abort();
                }
 
                if (strcmp(named_fc->name->str, field_name) == 0) {
@@ -4674,7 +4676,7 @@ bt_trace_class *ctf_visitor_generate_ir_get_ir_trace_class(
 {
        struct ctx *ctx = (void *) visitor;
 
-       BT_ASSERT(ctx);
+       BT_ASSERT_DBG(ctx);
 
        if (ctx->trace_class) {
                bt_trace_class_get_ref(ctx->trace_class);
@@ -4689,8 +4691,8 @@ struct ctf_trace_class *ctf_visitor_generate_ir_borrow_ctf_trace_class(
 {
        struct ctx *ctx = (void *) visitor;
 
-       BT_ASSERT(ctx);
-       BT_ASSERT(ctx->ctf_tc);
+       BT_ASSERT_DBG(ctx);
+       BT_ASSERT_DBG(ctx->ctf_tc);
        return ctx->ctf_tc;
 }
 
This page took 0.024718 seconds and 4 git commands to generate.