enum lttng_event_expr_type type,
const char *name)
{
- struct lttng_event_expr_field *expr =
- container_of(
- create_empty_expr(type, sizeof(*expr)),
- struct lttng_event_expr_field, parent);
+ struct lttng_event_expr_field *expr = lttng::utils::container_of(
+ create_empty_expr(type, sizeof(*expr)), <tng_event_expr_field::parent);
if (!expr) {
goto error;
goto error;
}
- expr = container_of(create_empty_expr(
+ expr = lttng::utils::container_of(create_empty_expr(
LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD,
sizeof(*expr)),
- struct lttng_event_expr_app_specific_context_field,
- parent);
+ <tng_event_expr_app_specific_context_field::parent);
if (!expr) {
goto error;
}
goto error;
}
- expr = container_of(create_empty_expr(
+ expr = lttng::utils::container_of(create_empty_expr(
LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT,
sizeof(*expr)),
- struct lttng_event_expr_array_field_element,
- parent);
+ <tng_event_expr_array_field_element::parent);
if (!expr) {
goto error;
}
goto end;
}
- ret = container_of(expr,
- const struct lttng_event_expr_field, parent)->name;
+ ret = lttng::utils::container_of(expr,
+ <tng_event_expr_field::parent)->name;
end:
return ret;
goto end;
}
- ret = container_of(expr,
- const struct lttng_event_expr_field, parent)->name;
+ ret = lttng::utils::container_of(expr,
+ <tng_event_expr_field::parent)->name;
end:
return ret;
goto end;
}
- ret = container_of(expr,
- const struct lttng_event_expr_app_specific_context_field,
- parent)->provider_name;
+ ret = lttng::utils::container_of(expr,
+ <tng_event_expr_app_specific_context_field::parent)->provider_name;
end:
return ret;
goto end;
}
- ret = container_of(expr,
- const struct lttng_event_expr_app_specific_context_field,
- parent)->type_name;
+ ret = lttng::utils::container_of(expr,
+ <tng_event_expr_app_specific_context_field::parent)->type_name;
end:
return ret;
goto end;
}
- ret = container_of(expr,
- const struct lttng_event_expr_array_field_element,
- parent)->array_field_expr;
+ ret = lttng::utils::container_of(expr,
+ <tng_event_expr_array_field_element::parent)->array_field_expr;
end:
return ret;
goto end;
}
- *index = container_of(expr,
- const struct lttng_event_expr_array_field_element,
- parent)->index;
+ *index = lttng::utils::container_of(expr,
+ <tng_event_expr_array_field_element::parent)->index;
end:
return ret;
case LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD:
{
const struct lttng_event_expr_field *field_expr_a =
- container_of(expr_a,
- const struct lttng_event_expr_field,
- parent);
+ lttng::utils::container_of(expr_a,
+ <tng_event_expr_field::parent);
const struct lttng_event_expr_field *field_expr_b =
- container_of(expr_b,
- const struct lttng_event_expr_field,
- parent);
+ lttng::utils::container_of(expr_b,
+ <tng_event_expr_field::parent);
if (strcmp(field_expr_a->name, field_expr_b->name) != 0) {
goto not_equal;
case LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD:
{
const struct lttng_event_expr_app_specific_context_field *field_expr_a =
- container_of(expr_a,
- const struct lttng_event_expr_app_specific_context_field,
- parent);
+ lttng::utils::container_of(expr_a,
+ <tng_event_expr_app_specific_context_field::parent);
const struct lttng_event_expr_app_specific_context_field *field_expr_b =
- container_of(expr_b,
- const struct lttng_event_expr_app_specific_context_field,
- parent);
+ lttng::utils::container_of(expr_b,
+ <tng_event_expr_app_specific_context_field::parent);
if (strcmp(field_expr_a->provider_name,
field_expr_b->provider_name) != 0) {
case LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT:
{
const struct lttng_event_expr_array_field_element *elem_expr_a =
- container_of(expr_a,
- const struct lttng_event_expr_array_field_element,
- parent);
+ lttng::utils::container_of(expr_a,
+ <tng_event_expr_array_field_element::parent);
const struct lttng_event_expr_array_field_element *elem_expr_b =
- container_of(expr_b,
- const struct lttng_event_expr_array_field_element,
- parent);
+ lttng::utils::container_of(expr_b,
+ <tng_event_expr_array_field_element::parent);
if (!lttng_event_expr_is_equal(elem_expr_a->array_field_expr,
elem_expr_b->array_field_expr)) {
case LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD:
{
struct lttng_event_expr_field *field_expr =
- container_of(expr,
- struct lttng_event_expr_field, parent);
+ lttng::utils::container_of(expr,
+ <tng_event_expr_field::parent);
free(field_expr->name);
break;
case LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD:
{
struct lttng_event_expr_app_specific_context_field *field_expr =
- container_of(expr,
- struct lttng_event_expr_app_specific_context_field,
- parent);
+ lttng::utils::container_of(expr,
+ <tng_event_expr_app_specific_context_field::parent);
free(field_expr->provider_name);
free(field_expr->type_name);
case LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT:
{
struct lttng_event_expr_array_field_element *elem_expr =
- container_of(expr,
- struct lttng_event_expr_array_field_element,
- parent);
+ lttng::utils::container_of(expr,
+ <tng_event_expr_array_field_element::parent);
lttng_event_expr_destroy(elem_expr->array_field_expr);
break;