diff --git a/dix/input_priv.h b/dix/input_priv.h index ae08e8367..c91d1e72e 100644 --- a/dix/input_priv.h +++ b/dix/input_priv.h @@ -51,7 +51,8 @@ SOFTWARE. #ifndef _XSERVER_INPUT_PRIV_H #define _XSERVER_INPUT_PRIV_H -#include "input.h" +#include "include/input.h" +#include "include/inputstr.h" typedef struct _InputOption InputOption; typedef struct _XI2Mask XI2Mask; @@ -371,6 +372,13 @@ int InputThreadUnregisterDev(int fd); * @param len size of bitmask in bits (may span multiple bytes) * @return number of bits set in the given bitmask */ -int CountBits(const uint8_t * mask, int len); +static inline int CountBits(const uint8_t * mask, int len) +{ + int ret = 0; + for (int i = 0; i < len; i++) + if (BitIsOn(mask, i)) + ret++; + return ret; +} #endif /* _XSERVER_INPUT_PRIV_H */ diff --git a/dix/inpututils.c b/dix/inpututils.c index 863e78cbc..dc64d84bc 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -690,19 +690,6 @@ valuator_mask_fetch_unaccelerated(const ValuatorMask *mask, return FALSE; } -int -CountBits(const uint8_t * mask, int len) -{ - int i; - int ret = 0; - - for (i = 0; i < len; i++) - if (BitIsOn(mask, i)) - ret++; - - return ret; -} - /** * Verifies sanity of the event. If the event is not an internal event, * memdumps the first 32 bytes of event to the log, a backtrace, then kill