sink.ctf.fs: initialize structure fields
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-stream.cpp
index a72e71b9c2a59d0f45c7d9262eed00f0612ed345..9ab71b257aecd2c51d6a3845ba61482cc67a09c2 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 #include <glib.h>
-#include <stdbool.h>
 #include <stdio.h>
 
 #include <babeltrace2/babeltrace.h>
 #include "logging/comp-logging.h"
 
 #include "common/assert.h"
-#include "compat/endian.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
 #include "ctfser/ctfser.h"
 
+#include "fs-sink-ctf-meta.hpp"
 #include "fs-sink-stream.hpp"
 #include "fs-sink-trace.hpp"
 #include "fs-sink.hpp"
@@ -38,7 +38,7 @@ void fs_sink_stream_destroy(struct fs_sink_stream *stream)
     }
 
     bt_packet_put_ref(stream->packet_state.packet);
-    g_free(stream);
+    delete stream;
 
 end:
     return;
@@ -124,14 +124,10 @@ static void set_stream_file_name(struct fs_sink_stream *stream)
 struct fs_sink_stream *fs_sink_stream_create(struct fs_sink_trace *trace,
                                              const bt_stream *ir_stream)
 {
-    struct fs_sink_stream *stream = g_new0(struct fs_sink_stream, 1);
+    fs_sink_stream *stream = new fs_sink_stream;
     int ret;
     GString *path = g_string_new(trace->path->str);
 
-    if (!stream) {
-        goto end;
-    }
-
     stream->log_level = trace->log_level;
     stream->trace = trace;
     stream->ir_stream = ir_stream;
This page took 0.024486 seconds and 4 git commands to generate.