aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-18 22:32:07 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 14:57:15 +0200
commit91925d70d901b180fffa1f40e0afafbc4b6c560e (patch)
tree9e63f6bc81018edede1f9b97fecabaa8d67e369b /nx-X11
parentcf461c367d9e2f77896a485f3f6ad5b89a2fc7e2 (diff)
downloadnx-libs-91925d70d901b180fffa1f40e0afafbc4b6c560e.tar.gz
nx-libs-91925d70d901b180fffa1f40e0afafbc4b6c560e.tar.bz2
nx-libs-91925d70d901b180fffa1f40e0afafbc4b6c560e.zip
Clarify use of and need for mffs vs. ffs
Backport of this xorg-xserver commit: commit 75c51c67b340548286efd41a53882e2acaf74ab5 Author: Alan Coopersmith <alan.coopersmith@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@sun.com>
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/os/WaitFor.c4
-rw-r--r--nx-X11/programs/Xserver/os/connection.c2
-rw-r--r--nx-X11/programs/Xserver/os/osdep.h2
3 files changed, 5 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c
index 3d53335b3..82462b926 100644
--- a/nx-X11/programs/Xserver/os/WaitFor.c
+++ b/nx-X11/programs/Xserver/os/WaitFor.c
@@ -106,6 +106,8 @@ static unsigned long startTimeInMillis;
Windows in the code */
#define GetErrno() errno
+/* 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)
@@ -480,7 +482,7 @@ WaitForSomething(int *pClientsReady)
{
int 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))];
pClientsReady[nready++] = client_index;
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index 8ebef9c33..4d30dd86f 100644
--- a/nx-X11/programs/Xserver/os/connection.c
+++ b/nx-X11/programs/Xserver/os/connection.c
@@ -908,7 +908,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/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h
index 5985cfef2..e106c5544 100644
--- a/nx-X11/programs/Xserver/os/osdep.h
+++ b/nx-X11/programs/Xserver/os/osdep.h
@@ -218,7 +218,7 @@ extern OsCommPtr AvailableInput;
extern WorkQueuePtr workQueue;
-/* added by raphael */
+/* in WaitFor.c */
#define ffs mffs
extern int mffs(fd_mask);