dix: Fix undefined shift in HashResourceID
Again, we need all of the bits of an unsigned int to make this work.
This commit is contained in:
parent
3671a3ee88
commit
1e5f478b7e
|
@ -671,7 +671,7 @@ InitClientResources(ClientPtr client)
|
|||
}
|
||||
|
||||
int
|
||||
HashResourceID(XID id, int numBits)
|
||||
HashResourceID(XID id, unsigned int numBits)
|
||||
{
|
||||
static XID mask;
|
||||
|
||||
|
@ -679,7 +679,7 @@ HashResourceID(XID id, int numBits)
|
|||
mask = RESOURCE_ID_MASK;
|
||||
id &= mask;
|
||||
if (numBits < 9)
|
||||
return (id ^ (id >> numBits) ^ (id >> (numBits<<1))) & ~((~0) << numBits);
|
||||
return (id ^ (id >> numBits) ^ (id >> (numBits<<1))) & ~((~0U) << numBits);
|
||||
return (id ^ (id >> numBits)) & ~((~0) << numBits);
|
||||
}
|
||||
|
||||
|
|
|
@ -270,7 +270,6 @@ extern _X_EXPORT RESTYPE TypeMask;
|
|||
of bits by either masking numBits lower bits of the ID or by
|
||||
providing at most MAXHASHSIZE hashes.
|
||||
*/
|
||||
extern _X_EXPORT int HashResourceID(XID id,
|
||||
int numBits);
|
||||
extern _X_EXPORT int HashResourceID(XID id, unsigned int numBits);
|
||||
|
||||
#endif /* RESOURCE_H */
|
||||
|
|
Loading…
Reference in New Issue