From 20f5a9aeb6d1128823cc87023e1dada534baa1af Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 28 Feb 2023 12:44:55 -0500 Subject: [PATCH] Clean-up: coding style fix and missing method in lttng::ctl::error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Methods must not contain get/set for trivial accessors. get_code() is renamed to code() to follow this guideline. Moreover, the method was not implemented. It is marked as noexcept and the _error_code member is made `const` as there is no reason for it to be mutated. Signed-off-by: Jérémie Galarneau Change-Id: If0fca5cc91c1cb72fff183ee6d29588ff4b5c030 --- src/common/exception.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/exception.hpp b/src/common/exception.hpp index 30a403470..1efd80359 100644 --- a/src/common/exception.hpp +++ b/src/common/exception.hpp @@ -54,10 +54,14 @@ public: const char *file_name, const char *function_name, unsigned int line_number); - lttng_error_code get_code() const; + + lttng_error_code code() const noexcept + { + return _error_code; + } private: - lttng_error_code _error_code; + const lttng_error_code _error_code; }; } /* namespace ctl */ -- 2.34.1