common: replace container_of with a C++ safe implementation
[lttng-tools.git] / src / common / actions / rate-policy.cpp
index c9c7a05197c2cbea1d8f8be4c8d30c8f2f07b1a1..303b4a781765ab71f4a739073c0ac168b95b71c0 100644 (file)
@@ -348,7 +348,7 @@ static struct lttng_rate_policy_every_n *rate_policy_every_n_from_rate_policy(
 {
        LTTNG_ASSERT(policy);
 
-       return container_of(policy, struct lttng_rate_policy_every_n, parent);
+       return lttng::utils::container_of(policy, &lttng_rate_policy_every_n::parent);
 }
 
 static const struct lttng_rate_policy_every_n *
@@ -357,7 +357,7 @@ rate_policy_every_n_from_rate_policy_const(
 {
        LTTNG_ASSERT(policy);
 
-       return container_of(policy, struct lttng_rate_policy_every_n, parent);
+       return lttng::utils::container_of(policy, &lttng_rate_policy_every_n::parent);
 }
 
 static int lttng_rate_policy_every_n_serialize(
@@ -560,8 +560,8 @@ rate_policy_once_after_n_from_rate_policy(struct lttng_rate_policy *policy)
 {
        LTTNG_ASSERT(policy);
 
-       return container_of(
-                       policy, struct lttng_rate_policy_once_after_n, parent);
+       return lttng::utils::container_of(
+                       policy, &lttng_rate_policy_once_after_n::parent);
 }
 
 static const struct lttng_rate_policy_once_after_n *
@@ -570,8 +570,8 @@ rate_policy_once_after_n_from_rate_policy_const(
 {
        LTTNG_ASSERT(policy);
 
-       return container_of(
-                       policy, struct lttng_rate_policy_once_after_n, parent);
+       return lttng::utils::container_of(
+                       policy, &lttng_rate_policy_once_after_n::parent);
 }
 static int lttng_rate_policy_once_after_n_serialize(
                struct lttng_rate_policy *policy, struct lttng_payload *payload)
This page took 0.024342 seconds and 4 git commands to generate.