summaryrefslogtreecommitdiff
path: root/dix/ffs.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/ffs.c')
-rw-r--r--dix/ffs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dix/ffs.c b/dix/ffs.c
index 8d0954689..b75657d29 100644
--- a/dix/ffs.c
+++ b/dix/ffs.c
@@ -1,4 +1,3 @@
-/* $Xorg: ffs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
/*
Copyright 1996, 1998 The Open Group
@@ -27,10 +26,18 @@ The Open Group.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "dix.h"
+
int
ffs(int i)
{
int j;
+ if (i == 0)
+ return 0;
for (j = 1; (i & 1) == 0; j++)
i >>= 1;
return j;