summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorTomas Carnecky <tom@dbservice.com>2008-08-28 18:05:40 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2008-08-28 18:05:40 -0400
commitebea78cdba0ff14a397239ee1936bd254c181e1b (patch)
tree3937720753cc112aaf9eb71ba0dcb39674362b98 /mi
parentec7907f8fa04dcff2649cc4846975844314f737e (diff)
Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices can be combined.
Diffstat (limited to 'mi')
-rw-r--r--mi/mibank.c7
-rw-r--r--mi/midispcur.c7
-rw-r--r--mi/mioverlay.c6
-rw-r--r--mi/mipointer.c6
-rw-r--r--mi/miscrinit.c6
-rw-r--r--mi/misprite.c6
6 files changed, 25 insertions, 13 deletions
diff --git a/mi/mibank.c b/mi/mibank.c
index ea79e9d36..92288abef 100644
--- a/mi/mibank.c
+++ b/mi/mibank.c
@@ -175,8 +175,11 @@ typedef struct _miBankQueue
#define xalloc_ARRAY(atype, ntype) \
(atype *)xalloc((ntype) * sizeof(atype))
-static DevPrivateKey miBankScreenKey = &miBankScreenKey;
-static DevPrivateKey miBankGCKey = &miBankGCKey;
+static int miBankScreenKeyIndex;
+static DevPrivateKey miBankScreenKey = &miBankScreenKeyIndex;
+static int miBankGCKeyIndex;
+static DevPrivateKey miBankGCKey = &miBankGCKeyIndex;
+
static unsigned long miBankGeneration = 0;
#define BANK_SCRPRIVLVAL dixLookupPrivate(&pScreen->devPrivates, miBankScreenKey)
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 1f2d8cf03..05352fc89 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -55,13 +55,14 @@ in this Software without prior written authorization from The Open Group.
# include "inputstr.h" /* for MAX_DEVICES */
/* per-screen private data */
-
-static DevPrivateKey miDCScreenKey = &miDCScreenKey;
+static int miDCScreenKeyIndex;
+static DevPrivateKey miDCScreenKey = &miDCScreenKeyIndex;
static Bool miDCCloseScreen(int index, ScreenPtr pScreen);
/* per device private data */
-static DevPrivateKey miDCSpriteKey = &miDCSpriteKey;
+static int miDCSpriteKeyIndex;
+static DevPrivateKey miDCSpriteKey = &miDCSpriteKeyIndex;
typedef struct {
GCPtr pSourceGC, pMaskGC;
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 2fc583ed4..395b1aab2 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -54,8 +54,10 @@ typedef struct {
Bool copyUnderlay;
} miOverlayScreenRec, *miOverlayScreenPtr;
-static DevPrivateKey miOverlayWindowKey = &miOverlayWindowKey;
-static DevPrivateKey miOverlayScreenKey = &miOverlayScreenKey;
+static int miOverlayWindowKeyKeyIndex;
+static DevPrivateKey miOverlayWindowKey = &miOverlayWindowKeyKeyIndex;
+static int miOverlayScreenKeyIndex;
+static DevPrivateKey miOverlayScreenKey = &miOverlayScreenKeyIndex;
static void RebuildTree(WindowPtr);
static Bool HasUnderlayChildren(WindowPtr);
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 809ce5e8b..8293e9b4f 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -41,13 +41,15 @@ in this Software without prior written authorization from The Open Group.
# include "dixstruct.h"
# include "inputstr.h"
-_X_EXPORT DevPrivateKey miPointerScreenKey = &miPointerScreenKey;
+static int miPointerScreenKeyIndex;
+_X_EXPORT DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex;
#define GetScreenPrivate(s) ((miPointerScreenPtr) \
dixLookupPrivate(&(s)->devPrivates, miPointerScreenKey))
#define SetupScreen(s) miPointerScreenPtr pScreenPriv = GetScreenPrivate(s)
-static DevPrivateKey miPointerPrivKey = &miPointerPrivKey;
+static int miPointerPrivKeyIndex;
+static DevPrivateKey miPointerPrivKey = &miPointerPrivKeyIndex;
#define MIPOINTER(dev) \
((DevHasCursor((dev)) || (!dev->isMaster && !dev->u.master)) ? \
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 6cd4df3a8..df969939e 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -280,7 +280,8 @@ miScreenInit(
return miScreenDevPrivateInit(pScreen, width, pbits);
}
-static DevPrivateKey privateKey = &privateKey;
+static int privateKeyIndex;
+static DevPrivateKey privateKey = &privateKeyIndex;
_X_EXPORT DevPrivateKey
miAllocateGCPrivateIndex()
@@ -288,7 +289,8 @@ miAllocateGCPrivateIndex()
return privateKey;
}
-_X_EXPORT DevPrivateKey miZeroLineScreenKey = &miZeroLineScreenKey;
+static int miZeroLineScreenKeyIndex;
+_X_EXPORT DevPrivateKey miZeroLineScreenKey = &miZeroLineScreenKeyIndex;
_X_EXPORT void
miSetZeroLineBias(ScreenPtr pScreen, unsigned int bias)
diff --git a/mi/misprite.c b/mi/misprite.c
index 85755b75a..692e6c97a 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -109,8 +109,10 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
* screen wrappers
*/
-static DevPrivateKey miSpriteScreenKey = &miSpriteScreenKey;
-static DevPrivateKey miSpriteDevPrivatesKey = &miSpriteDevPrivatesKey;
+static int miSpriteScreenKeyIndex;
+static DevPrivateKey miSpriteScreenKey = &miSpriteScreenKeyIndex;
+static int mmiSpriteDevPrivatesKeyIndex;
+static DevPrivateKey miSpriteDevPrivatesKey = &mmiSpriteDevPrivatesKeyIndex;
static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,