From: Thomas Jarosch Date: Tue, 30 Dec 2025 09:13:52 +0000 (+0100) Subject: Fix ignored-qualifiers warning X-Git-Tag: v2.13~1^2 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=7533ef096249a4e9331e5fb7dabb707186075e77;p=libi2ncommon 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. --- 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;