On Wed, 19 Jan 2011 19:58:01 -0500, Adam Jackson <a...@redhat.com> wrote:

> -    id &= RESOURCE_ID_MASK;
> -    switch (clientTable[client].hashsize)
> -    {
> -     case 6:
> -         return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12))));
> -     case 7:
> -         return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13))));
> -     case 8:
> -         return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16))));
> -     case 9:
> -         return ((int)(0x1FF & (id ^ (id>>9))));
> -     case 10:
> -         return ((int)(0x3FF & (id ^ (id>>10))));
> -     case 11:
> -         return ((int)(0x7FF & (id ^ (id>>11))));
> -    }
> -    return -1;
> +    return id & (clientTable[client].hashsize - 1);

This makes no sense to me. Did you meak (id & ((1 << hashsize) - 1) ?

(in which case, hashsize might want to be precomputed as 'hashmask' or
some such.

-- 
keith.pack...@intel.com

Attachment: pgpb5PN0tQe8Z.pgp
Description: PGP signature

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to