From 4c61bf84b11e26e6f22648668c95ea760a379163 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 11 Jun 2010 12:14:52 +0000 Subject: xserver git update 11/6/2010 --- xorg-server/dix/gc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'xorg-server/dix/gc.c') 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) -- cgit v1.2.3