From: Simon Marchi Date: Wed, 15 Dec 2021 19:23:05 +0000 (-0500) Subject: Clean-up: Remove remaining max_t macros X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8957eb485bb4d777f075109f6c658b842352aa68;p=lttng-tools.git Clean-up: Remove remaining max_t macros I found two remaining max_t macros. Remove them, and adjust one call site that was still using that. Change-Id: Icaedcaea1a88e87262bfa544691db398a1bfd203 Signed-off-by: Simon Marchi Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/ust-metadata.cpp b/src/bin/lttng-sessiond/ust-metadata.cpp index f5c5e7a21..b507f7870 100644 --- a/src/bin/lttng-sessiond/ust-metadata.cpp +++ b/src/bin/lttng-sessiond/ust-metadata.cpp @@ -20,10 +20,6 @@ #include "ust-clock.hpp" #include "ust-app.hpp" -#ifndef max_t -#define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b))) -#endif - #define NR_CLOCK_OFFSET_SAMPLES 10 struct offset_sample { @@ -69,7 +65,7 @@ ssize_t metadata_reserve(struct ust_registry_session *session, size_t len) char *newptr; new_alloc_len = - max_t(size_t, 1U << get_count_order(new_alloc_len), old_alloc_len << 1); + std::max(1U << get_count_order(new_alloc_len), old_alloc_len << 1); newptr = (char *) realloc(session->metadata, new_alloc_len); if (!newptr) return -ENOMEM; diff --git a/src/common/filter/filter-visitor-generate-bytecode.cpp b/src/common/filter/filter-visitor-generate-bytecode.cpp index d7f775775..252a83870 100644 --- a/src/common/filter/filter-visitor-generate-bytecode.cpp +++ b/src/common/filter/filter-visitor-generate-bytecode.cpp @@ -23,10 +23,6 @@ #include "filter-ast.hpp" #include "filter-ir.hpp" -#ifndef max_t -#define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b))) -#endif - static int recursive_visit_gen_bytecode(struct filter_parser_ctx *ctx, struct ir_op *node);