sink.ctf.fs: initialize structure fields
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-trace.cpp
index e9dddc7b45150798ef92b7b5ac21760a633d8fda..295ec2bc936ee3326c022b7ecaac7b96c56ea87a 100644 (file)
@@ -4,23 +4,24 @@
  * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
  */
 
+#include <glib.h>
+#include <stdio.h>
+
+#include <babeltrace2/babeltrace.h>
+
 #define BT_COMP_LOG_SELF_COMP (trace->fs_sink->self_comp)
 #define BT_LOG_OUTPUT_LEVEL   (trace->log_level)
 #define BT_LOG_TAG            "PLUGIN/SINK.CTF.FS/TRACE"
 #include "logging/comp-logging.h"
 
-#include <babeltrace2/babeltrace.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <glib.h>
 #include "common/assert.h"
-#include "ctfser/ctfser.h"
 
-#include "translate-trace-ir-to-ctf-ir.hpp"
-#include "translate-ctf-ir-to-tsdl.hpp"
-#include "fs-sink.hpp"
-#include "fs-sink-trace.hpp"
+#include "fs-sink-ctf-meta.hpp"
 #include "fs-sink-stream.hpp"
+#include "fs-sink-trace.hpp"
+#include "fs-sink.hpp"
+#include "translate-ctf-ir-to-tsdl.hpp"
+#include "translate-trace-ir-to-ctf-ir.hpp"
 
 /*
  * Sanitizes `path` so as to:
@@ -454,7 +455,6 @@ end:
     return unique_full_path;
 }
 
-BT_HIDDEN
 void fs_sink_trace_destroy(struct fs_sink_trace *trace)
 {
     GString *tsdl = NULL;
@@ -526,7 +526,7 @@ void fs_sink_trace_destroy(struct fs_sink_trace *trace)
 
     fs_sink_ctf_trace_destroy(trace->trace);
     trace->trace = NULL;
-    g_free(trace);
+    delete trace;
 
     g_string_free(tsdl, TRUE);
 
@@ -547,17 +547,12 @@ static void ir_trace_destruction_listener(const bt_trace *ir_trace, void *data)
     g_hash_table_remove(trace->fs_sink->traces, ir_trace);
 }
 
-BT_HIDDEN
 struct fs_sink_trace *fs_sink_trace_create(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace)
 {
     int ret;
-    struct fs_sink_trace *trace = g_new0(struct fs_sink_trace, 1);
+    fs_sink_trace *trace = new fs_sink_trace;
     bt_trace_add_listener_status trace_status;
 
-    if (!trace) {
-        goto end;
-    }
-
     trace->log_level = fs_sink->log_level;
     trace->fs_sink = fs_sink;
     trace->ir_trace = ir_trace;
This page took 0.029299 seconds and 4 git commands to generate.