From 8957eb485bb4d777f075109f6c658b842352aa68 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 15 Dec 2021 14:23:05 -0500 Subject: [PATCH] Clean-up: Remove remaining max_t macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/ust-metadata.cpp | 6 +----- src/common/filter/filter-visitor-generate-bytecode.cpp | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) 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); -- 2.34.1