From 57308bbc9bf8b60f09d1003e44fd7bcb4af1ef2e Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 28 Mar 2008 16:01:29 -0700 Subject: [PATCH] Small changes to damage to match 1.4 Mostly just code cleanup... nothing "really" changing here... --- damageext/damageext.c | 22 ++++++++++------------ damageext/damageext.h | 2 -- damageext/damageextint.h | 16 ---------------- miext/damage/damage.c | 30 +++++++++--------------------- miext/damage/damage.h | 2 -- miext/damage/damagestr.h | 8 +------- 6 files changed, 20 insertions(+), 60 deletions(-) diff --git a/damageext/damageext.c b/damageext/damageext.c index a27ca2250..b7f613bc6 100755 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -28,12 +26,12 @@ #include "damageextint.h" -unsigned char DamageReqCode; -int DamageEventBase; -int DamageErrorBase; -int DamageClientPrivateIndex; -RESTYPE DamageExtType; -RESTYPE DamageExtWinType; +static unsigned char DamageReqCode; +static int DamageEventBase; +static int DamageErrorBase; +static int DamageClientPrivateIndex; +static RESTYPE DamageExtType; +static RESTYPE DamageExtWinType; /* Version of the damage extension supported by the server, as opposed to the * DAMAGE_* defines from damageproto for what version the proto header @@ -186,7 +184,7 @@ ProcDamageCreate (ClientPtr client) REQUEST_SIZE_MATCH(xDamageCreateReq); LEGAL_NEW_RESOURCE(stuff->damage, client); SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client, - SecurityReadAccess); + SecurityReadAccess); switch (stuff->level) { case XDamageReportRawRectangles: level = DamageReportRawRegion; @@ -311,7 +309,7 @@ static const int version_requests[] = { #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) -int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = { +static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = { /*************** Version 1 ******************/ ProcDamageQueryVersion, ProcDamageCreate, @@ -400,7 +398,7 @@ SProcDamageAdd (ClientPtr client) return (*ProcDamageVector[stuff->damageReqType]) (client); } -int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = { +static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = { /*************** Version 1 ******************/ SProcDamageQueryVersion, SProcDamageCreate, @@ -470,7 +468,7 @@ FreeDamageExtWin (pointer value, XID wid) return Success; } -void +static void SDamageNotifyEvent (xDamageNotifyEvent *from, xDamageNotifyEvent *to) { diff --git a/damageext/damageext.h b/damageext/damageext.h index fb58483a0..642800bd2 100644 --- a/damageext/damageext.h +++ b/damageext/damageext.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/damageext/damageextint.h b/damageext/damageextint.h index 6f14e4e97..dfafc9319 100644 --- a/damageext/damageextint.h +++ b/damageext/damageextint.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -44,13 +42,6 @@ #include "damage.h" #include "xfixes.h" -extern unsigned char DamageReqCode; -extern int DamageEventBase; -extern int DamageErrorBase; -extern int DamageClientPrivateIndex; -extern RESTYPE DamageExtType; -extern RESTYPE DamageExtWinType; - typedef struct _DamageClient { CARD32 major_version; CARD32 minor_version; @@ -67,9 +58,6 @@ typedef struct _DamageExt { XID id; } DamageExtRec, *DamageExtPtr; -extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr); -extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr); - #define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \ pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \ if (!pDamageExt) { \ @@ -78,10 +66,6 @@ extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr); } \ } -void -SDamageNotifyEvent (xDamageNotifyEvent *from, - xDamageNotifyEvent *to); - void DamageExtSetCritical (ClientPtr pClient, Bool critical); diff --git a/miext/damage/damage.c b/miext/damage/damage.c index cd66b5473..2acff11e8 100755 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2003 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -72,6 +70,12 @@ #define pixmapDamage(pPixmap) damagePixPriv(pPixmap) +static int damageScrPrivateIndex; +static int damagePixPrivateIndex; +static int damageGCPrivateIndex; +static int damageWinPrivateIndex; +static int damageGeneration; + static DamagePtr * getDrawableDamageRef (DrawablePtr pDrawable) { @@ -368,12 +372,12 @@ static void damageChangeClip(GCPtr, int, pointer, int); static void damageDestroyClip(GCPtr); static void damageCopyClip(GCPtr, GCPtr); -GCFuncs damageGCFuncs = { +static GCFuncs damageGCFuncs = { damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC, damageChangeClip, damageDestroyClip, damageCopyClip }; -extern GCOps damageGCOps; +static GCOps damageGCOps; static Bool damageCreateGC(GCPtr pGC) @@ -1686,7 +1690,7 @@ damageCopyWindow(WindowPtr pWindow, wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); } -GCOps damageGCOps = { +static GCOps damageGCOps = { damageFillSpans, damageSetSpans, damagePutImage, damageCopyArea, damageCopyPlane, damagePolyPoint, @@ -1787,12 +1791,6 @@ damageCloseScreen (int i, ScreenPtr pScreen) return (*pScreen->CloseScreen) (i, pScreen); } -int damageScrPrivateIndex; -int damagePixPrivateIndex; -int damageGCPrivateIndex; -int damageWinPrivateIndex; -int damageGeneration; - Bool DamageSetup (ScreenPtr pScreen) { @@ -1831,16 +1829,6 @@ DamageSetup (ScreenPtr pScreen) if (!pScrPriv) return FALSE; -#ifdef COMPOSITE - /* This is a kludge to ensure wrapping order with the composite wrapper. - * If it's done from compinit.c, then DamageSetup may be called before the - * extension init phase, so that cw will be higher in the wrapping chain and - * rewrite drawables before damage gets to it, causing confusion. - */ - if (!noCompositeExtension) - miInitializeCompositeWrapper (pScreen); -#endif - pScrPriv->internalLevel = 0; pScrPriv->pScreenDamage = 0; diff --git a/miext/damage/damage.h b/miext/damage/damage.h index 36a06545f..4cfc8127d 100755 --- a/miext/damage/damage.h +++ b/miext/damage/damage.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2003 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h index 93e213fd1..58ee2bb38 100755 --- a/miext/damage/damagestr.h +++ b/miext/damage/damagestr.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2003 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -82,11 +80,7 @@ typedef struct _damageGCPriv { GCFuncs *funcs; } DamageGCPrivRec, *DamageGCPrivPtr; -extern int damageScrPrivateIndex; -extern int damagePixPrivateIndex; -extern int damageGCPrivateIndex; -extern int damageWinPrivateIndex; - +/* XXX should move these into damage.c, damageScrPrivateIndex is static */ #define damageGetScrPriv(pScr) \ ((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr)