X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Ferror-query.cpp;h=13efbbfd7d03f6154ceca9dcc8f9b7b2e8fb69fb;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=5d369c9e07563bfdba794694b69b22e1c74bb9a0;hpb=a6bc4ca9d659caf016ef932fcd944029737ac57c;p=lttng-tools.git diff --git a/src/common/error-query.cpp b/src/common/error-query.cpp index 5d369c9e0..13efbbfd7 100644 --- a/src/common/error-query.cpp +++ b/src/common/error-query.cpp @@ -7,17 +7,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include struct lttng_error_query { @@ -111,7 +111,7 @@ struct lttng_error_query *lttng_error_query_trigger_create( goto end; } - query = (lttng_error_query_trigger *) zmalloc(sizeof(*query)); + query = zmalloc(); if (!query) { PERROR("Failed to allocate trigger error query"); goto error; @@ -142,7 +142,7 @@ struct lttng_error_query *lttng_error_query_condition_create( goto end; } - query = (lttng_error_query_condition *) zmalloc(sizeof(*query)); + query = zmalloc(); if (!query) { PERROR("Failed to allocate condition error query"); goto error; @@ -221,7 +221,7 @@ struct lttng_error_query *lttng_error_query_action_create( goto end; } - query = (lttng_error_query_action *) zmalloc(sizeof(*query)); + query = zmalloc(); if (!query) { PERROR("Failed to allocate action error query"); goto error; @@ -388,7 +388,7 @@ lttng_error_query_result_counter_create( int init_ret; struct lttng_error_query_result_counter *counter; - counter = (lttng_error_query_result_counter *) zmalloc(sizeof(*counter)); + counter = zmalloc(); if (!counter) { PERROR("Failed to allocate error query counter result"); goto end; @@ -419,7 +419,7 @@ void destroy_result(void *ptr) 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(); if (!set) { PERROR("Failed to allocate an error query result set"); @@ -536,7 +536,7 @@ int lttng_error_query_results_serialize( 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. */ @@ -744,7 +744,7 @@ int lttng_error_query_serialize(const struct lttng_error_query *query, { 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(