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(
#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))
};
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:
#include <stdbool.h>
+#include <type_traits>
+
struct process_attr_tracker_values_comm_header {
uint32_t count;
};
};
#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)
*
*/
+#include <type_traits>
+
#include "lttng-ctl-helper.h"
#include "lttng/domain.h"
#include "lttng/lttng-error.h"
.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 { \