fix: relayd: unaligned access in trace_chunk_registry_ht_key_hash
[lttng-tools.git] / src / bin / lttng-sessiond / ctf2-trace-class-visitor.cpp
index 6b6c6265b5c8e661b84fe8cc0e4ad961e113c42e..71a2e48d2190c29e0401c4876dda9322e815a456 100644 (file)
@@ -103,7 +103,8 @@ const char *get_role_name(lst::static_length_blob_type::role role)
 namespace ctf2 {
 class trace_environment_visitor : public lst::trace_class_environment_visitor {
 public:
-       trace_environment_visitor() = default;
+       trace_environment_visitor() = default; /* NOLINT clang-tidy 14 identifies this as a move
+                                                 constructor. */
 
        void visit(const lst::environment_field<int64_t>& field) override
        {
@@ -134,7 +135,7 @@ private:
 class field_visitor : public lttng::sessiond::trace::field_visitor,
                      public lttng::sessiond::trace::type_visitor {
 public:
-       field_visitor() = default;
+       field_visitor() = default; /* NOLINT clang-tidy 14 identifies this as a move constructor. */
 
        /* Only call once. */
        json::json move_fragment()
@@ -164,7 +165,7 @@ private:
                _fragment["alignment"] = type.alignment;
                _fragment["preferred-display-base"] = (unsigned int) type.base_;
 
-               if (type.roles_.size() > 0) {
+               if (!type.roles_.empty()) {
                        json::json role_array = json::json::array();
 
                        for (const auto role : type.roles_) {
@@ -200,12 +201,12 @@ private:
                _fragment["alignment"] = type.alignment;
                _fragment["preferred-display-base"] = (unsigned int) type.base_;
 
-               if (type.roles_.size() > 0) {
+               if (!type.roles_.empty()) {
                        if (std::is_signed<typename EnumerationType::mapping::range_t::
                                                   range_integer_t>::value) {
                                LTTNG_THROW_ERROR(
-                                       fmt::format("Failed to serialize {}: unexpected role",
-                                                   _fragment["type"]));
+                                       lttng::format("Failed to serialize {}: unexpected role",
+                                                     _fragment["type"]));
                        }
 
                        auto role_array = json::json::array();
@@ -218,7 +219,7 @@ private:
                }
 
                if (type.mappings_->size() < 1) {
-                       LTTNG_THROW_ERROR(fmt::format(
+                       LTTNG_THROW_ERROR(lttng::format(
                                "Failed to serialize {}: enumeration must have at least one mapping",
                                _fragment["type"]));
                }
@@ -277,7 +278,7 @@ private:
                _fragment["type"] = "static-length-blob";
                _fragment["length"] = type.length_bytes;
 
-               if (type.roles_.size() > 0) {
+               if (!type.roles_.empty()) {
                        auto role_array = json::json::array();
 
                        for (const auto role : type.roles_) {
This page took 0.024016 seconds and 4 git commands to generate.