On Mon, 14 Dec 2009 15:19:47 -0500, Adam Jackson <[email protected]> wrote: > Use the wrapper functions consistently instead of hardcoding unix > knowledge everywhere directly.
I like the general plan, but this looks quite broken to me as it appears to not include the index within the fds_bits array in the computation of the appropriate client translation id. > Signed-off-by: Adam Jackson <[email protected]> > --- > os/WaitFor.c | 3 +-- > os/connection.c | 44 ++++++++++++++++++++------------------------ > os/io.c | 2 +- > os/osdep.h | 6 +----- > 4 files changed, 23 insertions(+), 32 deletions(-) > > diff --git a/os/WaitFor.c b/os/WaitFor.c > index dfe85e5..7d10183 100644 > --- a/os/WaitFor.c > +++ b/os/WaitFor.c > @@ -338,8 +338,7 @@ WaitForSomething(int *pClientsReady) > int client_priority, client_index; > > curclient = mffs (clientsReadable.fds_bits[i]) - 1; > - client_index = /* raphael: modified */ > - ConnectionTranslation[curclient + (i * (sizeof(fd_mask) > * 8))]; > + client_index = GetConnectionTranslation(curclient); Perhaps curclient = mffs() - 1 + (i * sizeof (fd_mask) * 8)? > void ClearConnectionTranslation(void) > { > +#ifndef WIN32 > + for (i=0; i<MaxClients; i++) ConnectionTranslation[i] = 0; memset please > index = ffs(mask) - 1; > mask &= ~lowbit(mask); > - if ((index = ConnectionTranslation[(base * (sizeof(fd_mask)*8)) + > index]) == 0) > + if ((index = GetConnectionTranslation(index)) == 0) Misses 'base' here too. -- [email protected]
pgpgZjWCypj6T.pgp
Description: PGP signature
_______________________________________________ xorg-devel mailing list [email protected] http://lists.x.org/mailman/listinfo/xorg-devel
