From 7533ef096249a4e9331e5fb7dabb707186075e77 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 30 Dec 2025 10:13:52 +0100 Subject: [PATCH] Fix ignored-qualifiers warning Original warning: src/timefunc.hxx:418:30: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] The function 'get_msec' was declared to return 'const long' but the const on return by value is meaningless (the return value is a prvalue, not an lvalue). Changed to 'long get_msec()' and also changed implementation to access value.tv_nsec directly to avoid calling non-const get_nsec from const method. --- src/timefunc.hxx | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timefunc.hxx b/src/timefunc.hxx index 1a8911e..765443d 100644 --- a/src/timefunc.hxx +++ b/src/timefunc.hxx @@ -415,8 +415,8 @@ namespace clock { inline CONSTEXPR const long &get_nsec (void) const NOEXCEPT { return this->value.tv_nsec; } - inline CONSTEXPR const long get_msec (void) const NOEXCEPT - { return this->get_nsec () / 1000000; } + inline CONSTEXPR long get_msec (void) const NOEXCEPT + { return this->value.tv_nsec / 1000000; } int64_t as_nanosec (void) const NOEXCEPT; -- 1.7.1