[plasma/kwin] /: Fix some unused warnings with clang

Vlad Zahorodnii <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit afef38477046c6b760f17d1cc1508b60d99be7b1 by Vlad Zahorodnii.
Committed on 23/07/2026 at 08:27.
Pushed by vladz into branch 'master'.

Fix some unused warnings with clang

M  +1    -1    autotests/integration/activation/activation_test.cpp
M  +0    -49   src/opengl/gltexture.cpp
M  +0    -5    src/plugins/mousemark/mousemark.cpp
M  +0    -1    src/plugins/slide/slide.h
M  +1    -1    src/wayland/keyboard.cpp

https://invent.kde.org/plasma/kwin/-/commit/afef38477046c6b760f17d1cc1508b60d99be7b1

diff --git a/autotests/integration/activation/activation_test.cpp b/autotests/integration/activation/activation_test.cpp
index 656fb95f9e4..34688ae51d0 100644
--- a/autotests/integration/activation/activation_test.cpp
+++ b/autotests/integration/activation/activation_test.cpp
@@ -727,7 +727,7 @@ void ActivationTest::testXdgActivation()
     token->set_app_id("test_app_id_2");
     result = token->commitAndWait();
     {
-        Test::XdgToplevelWindow window{[&result](Test::XdgToplevel *toplevel) {
+        Test::XdgToplevelWindow window{[](Test::XdgToplevel *toplevel) {
             toplevel->set_app_id("test_app_id_2");
         }};
         QVERIFY(window.show());
diff --git a/src/opengl/gltexture.cpp b/src/opengl/gltexture.cpp
index d28dd6901ae..99602830eb3 100644
--- a/src/opengl/gltexture.cpp
+++ b/src/opengl/gltexture.cpp
@@ -24,55 +24,6 @@
 namespace KWin
 {
 
-// Table of GL formats/types associated with different values of QImage::Format.
-// Zero values indicate a direct upload is not feasible.
-//
-// Note: Blending is set up to expect premultiplied data, so the non-premultiplied
-// Format_ARGB32 must be converted to Format_ARGB32_Premultiplied ahead of time.
-struct
-{
-    GLenum internalFormat;
-    GLenum format;
-    GLenum type;
-} static const formatTable[] = {
-    {0, 0, 0}, // QImage::Format_Invalid
-    {0, 0, 0}, // QImage::Format_Mono
-    {0, 0, 0}, // QImage::Format_MonoLSB
-    {0, 0, 0}, // QImage::Format_Indexed8
-    {GL_RGB8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, // QImage::Format_RGB32
-    {0, 0, 0}, // QImage::Format_ARGB32
-    {GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, // QImage::Format_ARGB32_Premultiplied
-    {GL_RGB8, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, // QImage::Format_RGB16
-    {0, 0, 0}, // QImage::Format_ARGB8565_Premultiplied
-    {0, 0, 0}, // QImage::Format_RGB666
-    {0, 0, 0}, // QImage::Format_ARGB6666_Premultiplied
-    {GL_RGB5, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, // QImage::Format_RGB555
-    {0, 0, 0}, // QImage::Format_ARGB8555_Premultiplied
-    {GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE}, // QImage::Format_RGB888
-    {GL_RGB4, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV}, // QImage::Format_RGB444
-    {GL_RGBA4, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV}, // QImage::Format_ARGB4444_Premultiplied
-    {GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE}, // QImage::Format_RGBX8888
-    {0, 0, 0}, // QImage::Format_RGBA8888
-    {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE}, // QImage::Format_RGBA8888_Premultiplied
-    {GL_RGB10, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV}, // QImage::Format_BGR30
-    {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV}, // QImage::Format_A2BGR30_Premultiplied
-    {GL_RGB10, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV}, // QImage::Format_RGB30
-    {GL_RGB10_A2, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV}, // QImage::Format_A2RGB30_Premultiplied
-    {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, // QImage::Format_Alpha8
-    {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, // QImage::Format_Grayscale8
-    {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // QImage::Format_RGBX64
-    {0, 0, 0}, // QImage::Format_RGBA64
-    {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // QImage::Format_RGBA64_Premultiplied
-    {GL_R16, GL_RED, GL_UNSIGNED_SHORT}, // QImage::Format_Grayscale16
-    {0, 0, 0}, // QImage::Format_BGR888
-    {GL_RGB16F, GL_RGBA, GL_HALF_FLOAT}, // QImage::Format_RGBX16FPx4,
-    {0, 0, 0}, // QImage::Format_RGBA16FPx4
-    {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // QImage::Format_RGBA16FPx4_Premultiplied
-    {GL_RGB32F, GL_RGBA, GL_FLOAT}, // QImage::Format_RGBX32FPx4,
-    {0, 0, 0}, // QImage::Format_RGBA32FPx4
-    {GL_RGBA32F, GL_RGBA, GL_FLOAT}, // QImage::Format_RGBA32FPx4_Premultiplied
-};
-
 GLTexture::GLTexture(GLenum target)
     : d(std::make_unique<GLTexturePrivate>())
 {
diff --git a/src/plugins/mousemark/mousemark.cpp b/src/plugins/mousemark/mousemark.cpp
index 80194f7f0fb..6fe9e67d46b 100644
--- a/src/plugins/mousemark/mousemark.cpp
+++ b/src/plugins/mousemark/mousemark.cpp
@@ -28,11 +28,6 @@
 namespace KWin
 {
 
-static consteval QPoint nullPoint()
-{
-    return QPoint(-1, -1);
-}
-
 MouseMarkEffect::MouseMarkEffect()
 {
     MouseMarkConfig::instance(effects->config());
diff --git a/src/plugins/slide/slide.h b/src/plugins/slide/slide.h
index d22dcade187..251335088d2 100644
--- a/src/plugins/slide/slide.h
+++ b/src/plugins/slide/slide.h
@@ -115,7 +115,6 @@ private:
 
     QList<EffectWindow *> m_elevatedWindows;
     QHash<EffectWindow *, WindowData> m_windowData;
-    bool m_switchingActivity = false;
     SlideEffect *m_parent;
     LogicalOutput *m_screen;
 };
diff --git a/src/wayland/keyboard.cpp b/src/wayland/keyboard.cpp
index 4262fde5bea..af6e019c40e 100644
--- a/src/wayland/keyboard.cpp
+++ b/src/wayland/keyboard.cpp
@@ -300,7 +300,7 @@ qint32 KeyboardInterface::keyRepeatRate() const
 
 bool KeyboardInterface::clientUseCompositorRepetition(ClientConnection *client) const
 {
-    return std::ranges::any_of(d->keyboardsForClient(client), [client](KeyboardInterfacePrivate::Resource *keyboardResource) {
+    return std::ranges::any_of(d->keyboardsForClient(client), [](KeyboardInterfacePrivate::Resource *keyboardResource) {
         return keyboardResource->version() >= WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION;
     });
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.