From: Michael Jeanson Date: Tue, 8 Mar 2022 16:33:30 +0000 (-0500) Subject: Prepare for '-Wignored-qualifiers' X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c10f9cdd994258358bb3766c2e92dab71e4ceef2;p=lttng-tools.git Prepare for '-Wignored-qualifiers' In preparation for '-Wextra' Change-Id: I6734a105170da2d57480fb5e15cae839adc38e62 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/error-query.cpp b/src/common/error-query.cpp index 5d369c9e0..8072b26bd 100644 --- a/src/common/error-query.cpp +++ b/src/common/error-query.cpp @@ -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( diff --git a/src/common/macros.h b/src/common/macros.h index 3e1757350..6b8eaf711 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -69,8 +69,6 @@ void *zmalloc(size_t len) #endif #endif -#define is_signed(type) (((type) -1) < (type) 1) - #define member_sizeof(type, field) sizeof(((type *) 0)->field) #define ASSERT_LOCKED(lock) LTTNG_ASSERT(pthread_mutex_trylock(&lock)) diff --git a/src/common/trace-chunk.cpp b/src/common/trace-chunk.cpp index ecf8ea803..3ae804781 100644 --- a/src/common/trace-chunk.cpp +++ b/src/common/trace-chunk.cpp @@ -171,7 +171,7 @@ const char *lttng_trace_chunk_command_type_str( }; static -const chunk_command close_command_get_post_release_func( +chunk_command close_command_get_post_release_func( lttng_trace_chunk_command_type type) { switch (type) { case LTTNG_TRACE_CHUNK_COMMAND_TYPE_MOVE_TO_COMPLETED: diff --git a/src/common/tracker.cpp b/src/common/tracker.cpp index 84b6c6b8f..c5efaa319 100644 --- a/src/common/tracker.cpp +++ b/src/common/tracker.cpp @@ -18,6 +18,8 @@ #include +#include + struct process_attr_tracker_values_comm_header { uint32_t count; }; @@ -33,16 +35,16 @@ struct process_attr_tracker_value_comm { }; #define GET_INTEGRAL_COMM_VALUE(value_ptr, as_type) \ - ((as_type)(is_signed(as_type) ? (value_ptr)->u._signed : \ + ((as_type)(std::is_signed::value ? (value_ptr)->u._signed : \ (value_ptr)->u._unsigned)) -#define SET_INTEGRAL_COMM_VALUE(comm_value, value) \ - if (is_signed(typeof(value))) { \ +#define SET_INTEGRAL_COMM_VALUE(comm_value, val) \ + if (std::is_signed::value) { \ (comm_value)->u._signed = \ - (typeof((comm_value)->u._signed)) value; \ + (typeof((comm_value)->u._signed)) val; \ } else { \ (comm_value)->u._unsigned = \ - (typeof((comm_value)->u._unsigned)) value; \ + (typeof((comm_value)->u._unsigned)) val; \ } static inline bool is_virtual_process_attr(enum lttng_process_attr process_attr) diff --git a/src/lib/lttng-ctl/tracker.cpp b/src/lib/lttng-ctl/tracker.cpp index b9c8ed8c3..40af23cd1 100644 --- a/src/lib/lttng-ctl/tracker.cpp +++ b/src/lib/lttng-ctl/tracker.cpp @@ -5,6 +5,8 @@ * */ +#include + #include "lttng-ctl-helper.h" #include "lttng/domain.h" #include "lttng/lttng-error.h" @@ -217,7 +219,7 @@ end: .value_type = (uint32_t) \ LTTNG_PROCESS_ATTR_VALUE_TYPE_##value_type_enum; \ \ - if (is_signed(value_type_c)) { \ + if (std::is_signed::value) { \ lsm.u.process_attr_tracker_add_remove_include_value \ .integral_value.u._signed = value; \ } else { \