*
*/
-#include <common/dynamic-array.h>
-#include <common/error.h>
-#include <common/macros.h>
-#include <common/mi-lttng.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <lttng/action/action-internal.h>
-#include <lttng/action/list-internal.h>
-#include <lttng/action/path-internal.h>
-#include <lttng/error-query-internal.h>
+#include <common/dynamic-array.hpp>
+#include <common/error.hpp>
+#include <common/macros.hpp>
+#include <common/mi-lttng.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <lttng/action/action-internal.hpp>
+#include <lttng/action/list-internal.hpp>
+#include <lttng/action/path-internal.hpp>
+#include <lttng/error-query-internal.hpp>
#include <lttng/error-query.h>
-#include <lttng/trigger/trigger-internal.h>
+#include <lttng/trigger/trigger-internal.hpp>
#include <stddef.h>
struct lttng_error_query {
goto end;
}
- query = (lttng_error_query_trigger *) zmalloc(sizeof(*query));
+ query = zmalloc<lttng_error_query_trigger>();
if (!query) {
PERROR("Failed to allocate trigger error query");
goto error;
goto end;
}
- query = (lttng_error_query_condition *) zmalloc(sizeof(*query));
+ query = zmalloc<lttng_error_query_condition>();
if (!query) {
PERROR("Failed to allocate condition error query");
goto error;
goto end;
}
- query = (lttng_error_query_action *) zmalloc(sizeof(*query));
+ query = zmalloc<lttng_error_query_action>();
if (!query) {
PERROR("Failed to allocate action error query");
goto error;
int init_ret;
struct lttng_error_query_result_counter *counter;
- counter = (lttng_error_query_result_counter *) zmalloc(sizeof(*counter));
+ counter = zmalloc<lttng_error_query_result_counter>();
if (!counter) {
PERROR("Failed to allocate error query counter result");
goto end;
struct lttng_error_query_results *lttng_error_query_results_create(void)
{
- struct lttng_error_query_results *set = (lttng_error_query_results *) zmalloc(sizeof(*set));
+ struct lttng_error_query_results *set = zmalloc<lttng_error_query_results>();
if (!set) {
PERROR("Failed to allocate an error query result set");
const size_t result_count = lttng_dynamic_pointer_array_get_count(
&results->results);
const struct lttng_error_query_results_comm header = {
- .count = (typeof(header.count)) result_count,
+ .count = (decltype(header.count)) result_count,
};
/* Header. */
{
int ret;
const struct lttng_error_query_comm header = {
- .target_type = (typeof(header.target_type)) query->target_type,
+ .target_type = (decltype(header.target_type)) query->target_type,
};
ret = lttng_dynamic_buffer_append(