common: replace container_of with a C++ safe implementation
[lttng-tools.git] / src / bin / lttng-sessiond / condition-internal.cpp
index 7daa53625190769284ecb0586387cba9d7bc5044..d932fac13bd139c723c3b1ef4aca1a3866245045 100644 (file)
@@ -27,8 +27,8 @@ unsigned long lttng_condition_buffer_usage_hash(
        unsigned long condition_type;
        struct lttng_condition_buffer_usage *condition;
 
-       condition = container_of(_condition,
-                       struct lttng_condition_buffer_usage, parent);
+       condition = lttng::utils::container_of(_condition,
+                       &lttng_condition_buffer_usage::parent);
 
        condition_type = (unsigned long) condition->parent.type;
        hash = hash_key_ulong((void *) condition_type, lttng_ht_seed);
@@ -64,8 +64,8 @@ unsigned long lttng_condition_session_consumed_size_hash(
        struct lttng_condition_session_consumed_size *condition;
        uint64_t val;
 
-       condition = container_of(_condition,
-                       struct lttng_condition_session_consumed_size, parent);
+       condition = lttng::utils::container_of(_condition,
+                       &lttng_condition_session_consumed_size::parent);
 
        hash = hash_key_ulong((void *) condition_type, lttng_ht_seed);
        if (condition->session_name) {
@@ -83,8 +83,8 @@ unsigned long lttng_condition_session_rotation_hash(
        unsigned long hash, condition_type;
        struct lttng_condition_session_rotation *condition;
 
-       condition = container_of(_condition,
-                       struct lttng_condition_session_rotation, parent);
+       condition = lttng::utils::container_of(_condition,
+                       &lttng_condition_session_rotation::parent);
        condition_type = (unsigned long) condition->parent.type;
        hash = hash_key_ulong((void *) condition_type, lttng_ht_seed);
        LTTNG_ASSERT(condition->session_name);
This page took 0.023857 seconds and 4 git commands to generate.