xserver: Branch 'master'

Alan Coopersmith alanc at kemper.freedesktop.org
Thu Jun 18 10:56:53 PDT 2009


 os/WaitFor.c    |    4 +++-
 os/connection.c |    4 ++--
 os/osdep.h      |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 75c51c67b340548286efd41a53882e2acaf74ab5
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Thu Jun 18 09:49:12 2009 -0700

    Clarify use of and need for mffs vs. ffs
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 9a204c7..4b59525 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -92,6 +92,8 @@ SOFTWARE.
 #define GetErrno() errno
 #endif
 
+/* like ffs, but uses fd_mask instead of int as argument, so it works
+   when fd_mask is longer than an int, such as common 64-bit platforms */
 /* modifications by raphael */
 int
 mffs(fd_mask mask)
@@ -336,7 +338,7 @@ WaitForSomething(int *pClientsReady)
 	    {
 	        int client_priority, client_index;
 
-		curclient = ffs (clientsReadable.fds_bits[i]) - 1;
+		curclient = mffs (clientsReadable.fds_bits[i]) - 1;
 		client_index = /* raphael: modified */
 			ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))];
 #else
diff --git a/os/connection.c b/os/connection.c
index 0c72b67..3ff93bb 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -827,7 +827,7 @@ EstablishNewConnections(ClientPtr clientUnused, pointer closure)
 	int status;
 
 #ifndef WIN32
-	curconn = ffs (readyconnections.fds_bits[i]) - 1;
+	curconn = mffs (readyconnections.fds_bits[i]) - 1;
 	readyconnections.fds_bits[i] &= ~((fd_mask)1 << curconn);
 	curconn += (i * (sizeof(fd_mask)*8));
 #else
@@ -992,7 +992,7 @@ CheckConnections(void)
 	mask = AllClients.fds_bits[i];
         while (mask)
     	{
-	    curoff = ffs (mask) - 1;
+	    curoff = mffs (mask) - 1;
 	    curclient = curoff + (i * (sizeof(fd_mask)*8));
             FD_ZERO(&tmask);
             FD_SET(curclient, &tmask);
diff --git a/os/osdep.h b/os/osdep.h
index e719f9a..b0d30e9 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -204,7 +204,7 @@ extern Bool AnyClientsWriteBlocked;
 
 extern WorkQueuePtr workQueue;
 
-/* added by raphael */
+/* in WaitFor.c */
 #ifdef WIN32
 typedef long int fd_mask;
 #endif


More information about the xorg-commit mailing list