From 349618c21473e5ef04d01d42142d40271c02ea76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Wed, 19 Jul 2017 06:54:22 +0200 Subject: [PATCH] Move bitCount from utils to GlxBackend Only used in GlxBackend. Differential Revision: https://phabricator.kde.org/D6784 --- plugins/platforms/x11/standalone/glxbackend.cpp | 16 ++++++++++++++++ utils.h | 17 ----------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/plugins/platforms/x11/standalone/glxbackend.cpp b/plugins/platforms/x11/standalone/glxbackend.cpp index b509c09398..438052fb40 100644 --- a/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/plugins/platforms/x11/standalone/glxbackend.cpp @@ -509,6 +509,22 @@ int GlxBackend::visualDepth(xcb_visualid_t visual) const return m_visualDepthHash.value(visual); } +static inline int bitCount(uint32_t mask) +{ +#if defined(__GNUC__) + return __builtin_popcount(mask); +#else + int count = 0; + + while (mask) { + count += (mask & 1); + mask >>= 1; + } + + return count; +#endif +} + FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual) { auto it = m_fbconfigHash.constFind(visual); diff --git a/utils.h b/utils.h index 76ed228763..ff9e6e0f62 100644 --- a/utils.h +++ b/utils.h @@ -196,23 +196,6 @@ Qt::KeyboardModifiers KWIN_EXPORT x11ToQtKeyboardModifiers(int state); void checkNonExistentClients(); -static inline int bitCount(uint32_t mask) -{ -#if defined(__GNUC__) - return __builtin_popcount(mask); -#else - int count = 0; - - while (mask) { - count += (mask & 1); - mask >>= 1; - } - - return count; -#endif -} - - /** * Separate the concept of an unet QPoint and 0,0 */