diff options
| author | Jan Beich <jbeich@FreeBSD.org> | 2025-03-28 22:25:49 +0100 |
|---|---|---|
| committer | Jan Beich <jbeich@FreeBSD.org> | 2025-03-29 01:23:37 +0100 |
| commit | 43a57966722604d4717e1f08b343176b78c13456 (patch) | |
| tree | b4013d873a75c9a936382a83f95243f4d0dca408 | |
| parent | 57edd6d4982f3570199e2305de66b878de4bc991 (diff) | |
x11/hypridle: avoid casting integer to string
src/core/Hypridle.cpp:508:131: error: non-constant-expression cannot be narrowed from type 'pid_t' (aka 'int') to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
508 | proxy->callMethod("GetSessionByPID").onInterface("org.freedesktop.ConsoleKit.Manager").withArguments(std::string{uint32_t{getpid()}}).storeResultsTo(path);
| ^~~~~~~~
src/core/Hypridle.cpp:508:131: note: insert an explicit cast to silence this issue
508 | proxy->callMethod("GetSessionByPID").onInterface("org.freedesktop.ConsoleKit.Manager").withArguments(std::string{uint32_t{getpid()}}).storeResultsTo(path);
| ^~~~~~~~
| static_cast<uint32_t>( )
src/core/Hypridle.cpp:508:122: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'char' in initializer list [-Wc++11-narrowing]
508 | proxy->callMethod("GetSessionByPID").onInterface("org.freedesktop.ConsoleKit.Manager").withArguments(std::string{uint32_t{getpid()}}).storeResultsTo(path);
| ^~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:508:122: note: insert an explicit cast to silence this issue
508 | proxy->callMethod("GetSessionByPID").onInterface("org.freedesktop.ConsoleKit.Manager").withArguments(std::string{uint32_t{getpid()}}).storeResultsTo(path);
| ^~~~~~~~~~~~~~~~~~
| static_cast<char>()
Exposed by -Wno-narrowing removal in v0.1.6.
(cherry picked from commit 054bf3111cfe945baee5bd84f37023b1e9afb607)
| -rw-r--r-- | x11/hypridle/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/x11/hypridle/Makefile b/x11/hypridle/Makefile index 626a4bc0dd51..a62f2659f36a 100644 --- a/x11/hypridle/Makefile +++ b/x11/hypridle/Makefile @@ -1,7 +1,7 @@ PORTNAME= hypridle DISTVERSIONPREFIX= v DISTVERSION= 0.1.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11 wayland MAINTAINER= jbeich@FreeBSD.org @@ -32,7 +32,7 @@ post-patch: -e 's,login1,ConsoleKit,' \ -e 's,logind,consolekit2,' \ -e 's,GetSession,&ByPID,' \ - -e 's,"auto",uint32_t{getpid()},' \ + -e 's,string{"auto"},to_string(getpid()),' \ ${WRKSRC}/src/core/Hypridle.cpp .include <bsd.port.mk> |
