dix: switch grab checking from unsigned shorts to unsigned ints

XIAnyModifier is outside of the unsigned short range.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-01 12:06:55 +10:00
parent 080b0331b3
commit 80ea32ad4f
2 changed files with 17 additions and 17 deletions

View File

@ -154,7 +154,7 @@ DeletePassiveGrab(pointer value, XID id)
} }
static Mask * static Mask *
DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail) DeleteDetailFromMask(Mask *pDetailMask, unsigned int detail)
{ {
Mask *mask; Mask *mask;
int i; int i;
@ -177,7 +177,7 @@ static Bool
IsInGrabMask( IsInGrabMask(
DetailRec firstDetail, DetailRec firstDetail,
DetailRec secondDetail, DetailRec secondDetail,
unsigned short exception) unsigned int exception)
{ {
if (firstDetail.exact == exception) if (firstDetail.exact == exception)
{ {
@ -197,9 +197,9 @@ IsInGrabMask(
static Bool static Bool
IdenticalExactDetails( IdenticalExactDetails(
unsigned short firstExact, unsigned int firstExact,
unsigned short secondExact, unsigned int secondExact,
unsigned short exception) unsigned int exception)
{ {
if ((firstExact == exception) || (secondExact == exception)) if ((firstExact == exception) || (secondExact == exception))
return FALSE; return FALSE;
@ -214,7 +214,7 @@ static Bool
DetailSupersedesSecond( DetailSupersedesSecond(
DetailRec firstDetail, DetailRec firstDetail,
DetailRec secondDetail, DetailRec secondDetail,
unsigned short exception) unsigned int exception)
{ {
if (IsInGrabMask(firstDetail, secondDetail, exception)) if (IsInGrabMask(firstDetail, secondDetail, exception))
return TRUE; return TRUE;
@ -231,11 +231,11 @@ GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
{ {
if (!DetailSupersedesSecond(pFirstGrab->modifiersDetail, if (!DetailSupersedesSecond(pFirstGrab->modifiersDetail,
pSecondGrab->modifiersDetail, pSecondGrab->modifiersDetail,
(unsigned short)AnyModifier)) (unsigned int)AnyModifier))
return FALSE; return FALSE;
if (DetailSupersedesSecond(pFirstGrab->detail, if (DetailSupersedesSecond(pFirstGrab->detail,
pSecondGrab->detail, (unsigned short)AnyKey)) pSecondGrab->detail, (unsigned int)AnyKey))
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -274,19 +274,19 @@ GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab, Bool ignoreDevice)
return TRUE; return TRUE;
if (DetailSupersedesSecond(pSecondGrab->detail, pFirstGrab->detail, if (DetailSupersedesSecond(pSecondGrab->detail, pFirstGrab->detail,
(unsigned short)AnyKey) (unsigned int)AnyKey)
&& &&
DetailSupersedesSecond(pFirstGrab->modifiersDetail, DetailSupersedesSecond(pFirstGrab->modifiersDetail,
pSecondGrab->modifiersDetail, pSecondGrab->modifiersDetail,
(unsigned short)AnyModifier)) (unsigned int)AnyModifier))
return TRUE; return TRUE;
if (DetailSupersedesSecond(pFirstGrab->detail, pSecondGrab->detail, if (DetailSupersedesSecond(pFirstGrab->detail, pSecondGrab->detail,
(unsigned short)AnyKey) (unsigned int)AnyKey)
&& &&
DetailSupersedesSecond(pSecondGrab->modifiersDetail, DetailSupersedesSecond(pSecondGrab->modifiersDetail,
pFirstGrab->modifiersDetail, pFirstGrab->modifiersDetail,
(unsigned short)AnyModifier)) (unsigned int)AnyModifier))
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -305,18 +305,18 @@ GrabsAreIdentical(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
if (!(DetailSupersedesSecond(pFirstGrab->detail, if (!(DetailSupersedesSecond(pFirstGrab->detail,
pSecondGrab->detail, pSecondGrab->detail,
(unsigned short)AnyKey) && (unsigned int)AnyKey) &&
DetailSupersedesSecond(pSecondGrab->detail, DetailSupersedesSecond(pSecondGrab->detail,
pFirstGrab->detail, pFirstGrab->detail,
(unsigned short)AnyKey))) (unsigned int)AnyKey)))
return FALSE; return FALSE;
if (!(DetailSupersedesSecond(pFirstGrab->modifiersDetail, if (!(DetailSupersedesSecond(pFirstGrab->modifiersDetail,
pSecondGrab->modifiersDetail, pSecondGrab->modifiersDetail,
(unsigned short)AnyModifier) && (unsigned int)AnyModifier) &&
DetailSupersedesSecond(pSecondGrab->modifiersDetail, DetailSupersedesSecond(pSecondGrab->modifiersDetail,
pFirstGrab->modifiersDetail, pFirstGrab->modifiersDetail,
(unsigned short)AnyModifier))) (unsigned int)AnyModifier)))
return FALSE; return FALSE;
return TRUE; return TRUE;

View File

@ -146,7 +146,7 @@ typedef struct _OtherInputMasks {
3 buttons. */ 3 buttons. */
typedef struct _DetailRec { /* Grab details may be bit masks */ typedef struct _DetailRec { /* Grab details may be bit masks */
unsigned short exact; unsigned int exact;
Mask *pMask; Mask *pMask;
} DetailRec; } DetailRec;