Prepare for '-Wignored-qualifiers'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 8 Mar 2022 16:33:30 +0000 (11:33 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 15 Mar 2022 21:00:30 +0000 (17:00 -0400)
In preparation for '-Wextra'

Change-Id: I6734a105170da2d57480fb5e15cae839adc38e62
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/error-query.cpp
src/common/macros.h
src/common/trace-chunk.cpp
src/common/tracker.cpp
src/lib/lttng-ctl/tracker.cpp

index 5d369c9e07563bfdba794694b69b22e1c74bb9a0..8072b26bdcdcaef9f97c85f5c2b05339f3998736 100644 (file)
@@ -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(
index 3e175735083a9df7d390cdad5cc5fa43a20c4c26..6b8eaf711df21e99612956d1723606bca01c1dff 100644 (file)
@@ -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))
index ecf8ea80312503437c5c57d2ad8f508f2066f473..3ae804781021ae97595203d922dc9ffc18ec0961 100644 (file)
@@ -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:
index 84b6c6b8f11c33f31039f711ddb0061f5d6ae568..c5efaa3198b6aa5cfaea5c038e491ccfee92cc89 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <stdbool.h>
 
+#include <type_traits>
+
 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<as_type>::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<typeof(val)>::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)
index b9c8ed8c38d63195bdb0693dfeff28bc41ce42e0..40af23cd1214008ed0d11f3798fac905a0cbb2b9 100644 (file)
@@ -5,6 +5,8 @@
  *
  */
 
+#include <type_traits>
+
 #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_type_c>::value) {                                                                       \
                        lsm.u.process_attr_tracker_add_remove_include_value                                          \
                                        .integral_value.u._signed = value;                                           \
                } else {                                                                                             \
This page took 0.03058 seconds and 5 git commands to generate.