Define GCAllBits as the union of all valid CreateGC masks.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Jamey Sharp 2010-05-08 19:08:47 -07:00
parent 6a84cd9434
commit 5193f25ea3
3 changed files with 7 additions and 5 deletions

View File

@ -424,7 +424,7 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32)
{ {
ChangeGCVal vals[GCLastBit + 1]; ChangeGCVal vals[GCLastBit + 1];
int i; int i;
if (mask & ~((1 << (GCLastBit + 1)) - 1)) if (mask & ~GCAllBits)
{ {
clientErrorValue = mask; clientErrorValue = mask;
return BadValue; return BadValue;
@ -534,7 +534,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
if (*pStatus != Success) if (*pStatus != Success)
goto out; goto out;
pGC->stateChanges = (1 << (GCLastBit+1)) - 1; pGC->stateChanges = GCAllBits;
if (!(*pGC->pScreen->CreateGC)(pGC)) if (!(*pGC->pScreen->CreateGC)(pGC))
*pStatus = BadAlloc; *pStatus = BadAlloc;
else if (mask) else if (mask)
@ -837,7 +837,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
pGC->lastWinOrg.x = 0; pGC->lastWinOrg.x = 0;
pGC->lastWinOrg.y = 0; pGC->lastWinOrg.y = 0;
pGC->stateChanges = (1 << (GCLastBit+1)) - 1; pGC->stateChanges = GCAllBits;
if (!(*pScreen->CreateGC)(pGC)) if (!(*pScreen->CreateGC)(pGC))
{ {
FreeGC(pGC, (XID)0); FreeGC(pGC, (XID)0);
@ -1118,7 +1118,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen)
pGC->clipOrg.y = 0; pGC->clipOrg.y = 0;
if (pGC->clientClipType != CT_NONE) if (pGC->clientClipType != CT_NONE)
(*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0); (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0);
pGC->stateChanges = (1 << (GCLastBit+1)) - 1; pGC->stateChanges = GCAllBits;
return pGC; return pGC;
} }
/* if we make it this far, need to roll our own */ /* if we make it this far, need to roll our own */

View File

@ -59,6 +59,8 @@ SOFTWARE.
#include "privates.h" #include "privates.h"
#include <X11/Xprotostr.h> #include <X11/Xprotostr.h>
#define GCAllBits ((1 << (GCLastBit + 1)) - 1)
/* /*
* functions which modify the state of the GC * functions which modify the state of the GC
*/ */

View File

@ -129,7 +129,7 @@ cwCreateBackingGC(GCPtr pGC, DrawablePtr pDrawable)
return FALSE; return FALSE;
pPriv->serialNumber = 0; pPriv->serialNumber = 0;
pPriv->stateChanges = (1 << (GCLastBit + 1)) - 1; pPriv->stateChanges = GCAllBits;
return TRUE; return TRUE;
} }