From 416f69eb88e2b6c6615c1541aa6f53a31a51e992 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 10 Nov 2025 20:07:17 +0100 Subject: [PATCH] include: misc.h: unexport lowbit() macro Not used by any drivers. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/window.c | 1 + hw/kdrive/fbdev/fbdev.c | 9 ++++++--- hw/xnest/Color.c | 1 + include/misc.h | 8 -------- os/osdep.h | 9 +++++++++ 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dix/window.c b/dix/window.c index a2431c5380..4c12322585 100644 --- a/dix/window.c +++ b/dix/window.c @@ -117,6 +117,7 @@ Equipment Corporation. #include "mi/mi_priv.h" /* miPaintWindow */ #include "os/auth.h" #include "os/client_priv.h" +#include "os/osdep.h" #include "os/screensaver.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c index d55486a118..66b0c58d56 100644 --- a/hw/kdrive/fbdev/fbdev.c +++ b/hw/kdrive/fbdev/fbdev.c @@ -21,12 +21,15 @@ */ #include -#include "fbdev.h" -#include "fb/fb_priv.h" -#include +#include #include +#include "fb/fb_priv.h" +#include "os/osdep.h" + +#include "fbdev.h" + #ifndef xallocarray #define xallocarray(num, size) reallocarray(NULL, (num), (size)) #endif diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c index ae20d009d9..bb7fddf537 100644 --- a/hw/xnest/Color.c +++ b/hw/xnest/Color.c @@ -20,6 +20,7 @@ is" without express or implied warranty. #include #include "dix/colormap_priv.h" +#include "os/osdep.h" #include "scrnintstr.h" #include "window.h" diff --git a/include/misc.h b/include/misc.h index d6c8dc9e52..84a5fa8bb1 100644 --- a/include/misc.h +++ b/include/misc.h @@ -136,14 +136,6 @@ typedef struct _xReq *xReqPtr; #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0)) /* this assumes b > 0 */ #define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b) -/* - * return the least significant bit in x which is set - * - * This works on 1's complement and 2's complement machines. - * If you care about the extra instruction on 2's complement - * machines, change to ((x) & (-(x))) - */ -#define lowbit(x) ((x) & (~(x) + 1)) /* XXX Not for modules */ #include diff --git a/os/osdep.h b/os/osdep.h index 158a4ed1cf..9d2a001bbd 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -57,6 +57,15 @@ SOFTWARE. #include #include +/* + * return the least significant bit in x which is set + * + * This works on 1's complement and 2's complement machines. + * If you care about the extra instruction on 2's complement + * machines, change to ((x) & (-(x))) + */ +#define lowbit(x) ((x) & (~(x) + 1)) + #ifndef __has_builtin # define __has_builtin(x) 0 /* Compatibility with older compilers */ #endif