aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/gc.c')
-rw-r--r--xorg-server/dix/gc.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/xorg-server/dix/gc.c b/xorg-server/dix/gc.c
index d39a5a76a..902f20675 100644
--- a/xorg-server/dix/gc.c
+++ b/xorg-server/dix/gc.c
@@ -479,7 +479,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
{
GCPtr pGC;
- pGC = malloc(sizeof(GC));
+ pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC);
if (!pGC)
{
*pStatus = BadAlloc;
@@ -492,7 +492,6 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
pGC->planemask = ~0;
pGC->serialNumber = GC_CHANGE_SERIAL_BIT;
pGC->funcs = 0;
- pGC->devPrivates = NULL;
pGC->fgPixel = 0;
pGC->bgPixel = 1;
pGC->lineWidth = 0;
@@ -563,7 +562,7 @@ out:
pGC = (GCPtr)NULL;
}
- return (pGC);
+ return pGC;
}
static Bool
@@ -785,9 +784,8 @@ FreeGC(pointer value, XID gid)
(*pGC->funcs->DestroyGC) (pGC);
if (pGC->dash != DefaultDash)
free(pGC->dash);
- dixFreePrivates(pGC->devPrivates);
- free(pGC);
- return(Success);
+ dixFreeObjectWithPrivates(pGC, PRIVATE_GC);
+ return Success;
}
/* CreateScratchGC(pScreen, depth)
@@ -808,7 +806,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
{
GCPtr pGC;
- pGC = malloc(sizeof(GC));
+ pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC);
if (!pGC)
return (GCPtr)NULL;
@@ -817,7 +815,6 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
pGC->alu = GXcopy; /* dst <- src */
pGC->planemask = ~0;
pGC->serialNumber = 0;
- pGC->devPrivates = NULL;
pGC->fgPixel = 0;
pGC->bgPixel = 1;
pGC->lineWidth = 0;
@@ -1069,7 +1066,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects,
newct = VerifyRectOrder(nrects, prects, ordering);
if (newct < 0)
- return(BadMatch);
+ return BadMatch;
size = nrects * sizeof(xRectangle);
prectsNew = malloc(size);
if (!prectsNew && size)