Sort includes in C++ files
[babeltrace.git] / src / plugins / ctf / fs-sink / translate-trace-ir-to-ctf-ir.cpp
index d7ff260f271d8b49e5d006b72fcf53ea6d2e26d6..88bff0bf7c0806de89c0afe340328ad9b67b22fb 100644 (file)
@@ -4,24 +4,27 @@
  * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
  */
 
+#include <string>
+
+#include <glib.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <babeltrace2/babeltrace.h>
+
 #define BT_COMP_LOG_SELF_COMP (ctx->self_comp)
 #define BT_LOG_OUTPUT_LEVEL   (ctx->log_level)
 #define BT_LOG_TAG            "PLUGIN/SINK.CTF.FS/TRANSLATE-TRACE-IR-TO-CTF-IR"
 #include "logging/comp-logging.h"
 
-#include "translate-trace-ir-to-ctf-ir.hpp"
-
-#include <babeltrace2/babeltrace.h>
-#include "common/macros.h"
-#include "common/common.h"
 #include "common/assert.h"
-#include <stdio.h>
-#include <stdbool.h>
-#include <string.h>
-#include <glib.h>
+#include "common/common.h"
+#include "common/macros.h"
 
-#include "fs-sink.hpp"
 #include "fs-sink-ctf-meta.hpp"
+#include "fs-sink.hpp"
+#include "translate-trace-ir-to-ctf-ir.hpp"
 
 struct field_path_elem
 {
@@ -56,7 +59,7 @@ struct ctx
 static inline struct field_path_elem *cur_path_stack_at(struct ctx *ctx, uint64_t i)
 {
     BT_ASSERT(i < ctx->cur_path->len);
-    return &g_array_index(ctx->cur_path, struct field_path_elem, i);
+    return &bt_g_array_index(ctx->cur_path, struct field_path_elem, i);
 }
 
 static inline struct field_path_elem *cur_path_stack_top(struct ctx *ctx)
@@ -1512,7 +1515,6 @@ end:
     return ret;
 }
 
-BT_HIDDEN
 int try_translate_event_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink,
                                                  struct fs_sink_ctf_stream_class *sc,
                                                  const bt_event_class *ir_ec,
@@ -1562,17 +1564,15 @@ end:
 static void make_unique_default_clock_class_name(struct fs_sink_ctf_stream_class *sc)
 {
     unsigned int suffix = 0;
-    char buf[16];
 
-    g_string_assign(sc->default_clock_class_name, "");
-    sprintf(buf, "default");
+    std::string name = "default";
 
-    while (default_clock_class_name_exists(sc->trace, buf)) {
-        sprintf(buf, "default%u", suffix);
+    while (default_clock_class_name_exists(sc->trace, name.c_str())) {
+        name = "default" + std::to_string(suffix);
         suffix++;
     }
 
-    g_string_assign(sc->default_clock_class_name, buf);
+    g_string_assign(sc->default_clock_class_name, name.c_str());
 }
 
 static int translate_stream_class(struct fs_sink_comp *fs_sink, struct fs_sink_ctf_trace *trace,
@@ -1647,7 +1647,6 @@ end:
     return ret;
 }
 
-BT_HIDDEN
 int try_translate_stream_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink,
                                                   struct fs_sink_ctf_trace *trace,
                                                   const bt_stream_class *ir_sc,
@@ -1673,7 +1672,6 @@ end:
     return ret;
 }
 
-BT_HIDDEN
 struct fs_sink_ctf_trace *translate_trace_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink,
                                                              const bt_trace *ir_trace)
 {
This page took 0.024981 seconds and 4 git commands to generate.