diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-28 09:28:25 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-28 09:28:25 -0400 |
commit | 4017d3190234e189a0bbd33193a148d4d3c7556b (patch) | |
tree | 2ab228113d410386afde50c893f137d95974b8f3 /mi/mibank.c | |
parent | 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff) |
devPrivates rework: since API is already broken, switch everything
over to new system.
Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
Diffstat (limited to 'mi/mibank.c')
-rw-r--r-- | mi/mibank.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mi/mibank.c b/mi/mibank.c index 00638a4c2..b52399cfe 100644 --- a/mi/mibank.c +++ b/mi/mibank.c @@ -177,15 +177,15 @@ typedef struct _miBankQueue #define ALLOCATE_LOCAL_ARRAY(atype, ntype) \ (atype *)ALLOCATE_LOCAL((ntype) * sizeof(atype)) -static int miBankScreenIndex; -static int miBankGCIndex; +static DevPrivateKey miBankScreenKey = &miBankScreenKey; +static DevPrivateKey miBankGCKey = &miBankGCKey; static unsigned long miBankGeneration = 0; -#define BANK_SCRPRIVLVAL pScreen->devPrivates[miBankScreenIndex].ptr +#define BANK_SCRPRIVLVAL dixLookupPrivate(&pScreen->devPrivates, miBankScreenKey) #define BANK_SCRPRIVATE ((miBankScreenPtr)(BANK_SCRPRIVLVAL)) -#define BANK_GCPRIVLVAL(pGC) (pGC)->devPrivates[miBankGCIndex].ptr +#define BANK_GCPRIVLVAL(pGC) dixLookupPrivate(&(pGC)->devPrivates, miBankGCKey) #define BANK_GCPRIVATE(pGC) ((miBankGCPtr)(BANK_GCPRIVLVAL(pGC))) @@ -2116,15 +2116,9 @@ miInitializeBanking( /* Private areas */ if (miBankGeneration != serverGeneration) - { - if (((miBankScreenIndex = AllocateScreenPrivateIndex()) < 0) || - ((miBankGCIndex = AllocateGCPrivateIndex()) < 0)) - return FALSE; - miBankGeneration = serverGeneration; - } - if (!AllocateGCPrivate(pScreen, miBankGCIndex, + if (!dixRequestPrivate(miBankGCKey, (nBanks * sizeof(RegionPtr)) + (sizeof(miBankGCRec) - sizeof(RegionPtr)))) return FALSE; @@ -2273,7 +2267,7 @@ miInitializeBanking( SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow); SCREEN_WRAP(CopyWindow, miBankCopyWindow); - BANK_SCRPRIVLVAL = (pointer)pScreenPriv; + dixSetPrivate(&pScreen->devPrivates, miBankScreenKey, pScreenPriv); return TRUE; } |