tap-driver.sh: flush stdout after each test result
[babeltrace.git] / plugins / ctf / fs-sink / translate-trace-ir-to-ctf-ir.c
index 72f5e4a877db00f766f08224ad3a2c49d48fc735..d398f6593591dac9ea501700e1355aa80ed787b9 100644 (file)
 #define BT_LOG_TAG "PLUGIN-CTF-FS-SINK-TRANSLATE-TRACE-IR-TO-CTF-IR"
 #include "logging.h"
 
-#include <babeltrace/babeltrace.h>
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/common-internal.h>
-#include <babeltrace/assert-internal.h>
+#include <babeltrace2/babeltrace.h>
+#include <babeltrace2/babeltrace-internal.h>
+#include <babeltrace2/common-internal.h>
+#include <babeltrace2/assert-internal.h>
 #include <stdio.h>
 #include <stdbool.h>
 #include <string.h>
@@ -172,7 +172,6 @@ int create_relative_field_ref(struct ctx *ctx,
 {
        int ret = 0;
        struct fs_sink_ctf_field_class *tgt_fc = NULL;
-       enum fs_sink_ctf_field_class_type tgt_fc_type;
        uint64_t i;
        int64_t si;
        const char *tgt_fc_name = NULL;
@@ -201,7 +200,6 @@ int create_relative_field_ref(struct ctx *ctx,
        }
 
        i = 0;
-       tgt_fc_type = tgt_fc->type;
 
        while (i < bt_field_path_get_item_count(tgt_ir_field_path)) {
                const bt_field_path_item *fp_item =
@@ -212,7 +210,7 @@ int create_relative_field_ref(struct ctx *ctx,
                BT_ASSERT(tgt_fc);
                BT_ASSERT(fp_item);
 
-               switch (tgt_fc_type) {
+               switch (tgt_fc->type) {
                case FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT:
                        BT_ASSERT(bt_field_path_item_get_type(fp_item) ==
                                BT_FIELD_PATH_ITEM_TYPE_INDEX);
@@ -250,7 +248,7 @@ int create_relative_field_ref(struct ctx *ctx,
        }
 
        BT_ASSERT(tgt_fc);
-       BT_ASSERT(tgt_fc_type == FS_SINK_CTF_FIELD_CLASS_TYPE_INT);
+       BT_ASSERT(tgt_fc->type == FS_SINK_CTF_FIELD_CLASS_TYPE_INT);
        BT_ASSERT(tgt_fc_name);
 
        /* Find target field class having this name in current context */
@@ -898,8 +896,8 @@ end:
  * sequence field class.
  */
 static
-int set_field_refs(struct fs_sink_ctf_field_class *fc, const char *fc_name,
-               struct fs_sink_ctf_field_class *parent_fc)
+int set_field_refs(struct fs_sink_ctf_field_class * const fc,
+               const char *fc_name, struct fs_sink_ctf_field_class *parent_fc)
 {
        int ret = 0;
        enum fs_sink_ctf_field_class_type fc_type;
@@ -914,7 +912,7 @@ int set_field_refs(struct fs_sink_ctf_field_class *fc, const char *fc_name,
                uint64_t i;
                uint64_t len;
                struct fs_sink_ctf_field_class_struct *struct_fc;
-               struct fs_sink_ctf_field_class_variant *var_fc;
+               struct fs_sink_ctf_field_class_variant *var_fc = NULL;
                struct fs_sink_ctf_named_field_class *named_fc;
 
                if (fc_type == FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT) {
@@ -1168,13 +1166,6 @@ int translate_stream_class(struct fs_sink_ctf_trace_class *tc,
                const char *name = bt_clock_class_get_name(
                        (*out_sc)->default_clock_class);
 
-               if (!bt_stream_class_default_clock_is_always_known(ir_sc)) {
-                       BT_LOGE("Unsupported stream clock which can have an unknown value: "
-                               "sc-name=\"%s\"",
-                               bt_stream_class_get_name(ir_sc));
-                       goto error;
-               }
-
                if (name) {
                        /* Try original name, protected */
                        g_string_assign((*out_sc)->default_clock_class_name,
@@ -1279,7 +1270,7 @@ struct fs_sink_ctf_trace_class *translate_trace_class_trace_ir_to_ctf_ir(
                }
 
                switch (bt_value_get_type(val)) {
-               case BT_VALUE_TYPE_INTEGER:
+               case BT_VALUE_TYPE_SIGNED_INTEGER:
                case BT_VALUE_TYPE_STRING:
                        break;
                default:
This page took 0.025503 seconds and 4 git commands to generate.