summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-07-11 20:35:43 -0700
committerJamey Sharp <jamey@minilop.net>2010-09-13 15:55:17 -0700
commit2e8069dd36c2f5caf868937405fc03328004a85d (patch)
tree5ae0c84c8818b97935f72c36e01e4835ba0389d7
parent34d6492436c0f4a81822769b24d8c7816d0226ad (diff)
xnest: Replace use of Colormap->devPriv with standard devPrivates.
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r--hw/xnest/Color.c5
-rw-r--r--hw/xnest/Color.h3
-rw-r--r--hw/xnest/Screen.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c
index 883b77cb2..0aae8e9c9 100644
--- a/hw/xnest/Color.c
+++ b/hw/xnest/Color.c
@@ -34,6 +34,8 @@ is" without express or implied warranty.
#include "XNWindow.h"
#include "Args.h"
+DevPrivateKeyRec xnestColormapPrivateKeyRec;
+
static DevPrivateKeyRec cmapScrPrivateKeyRec;
#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
@@ -52,8 +54,6 @@ xnestCreateColormap(ColormapPtr pCmap)
pVisual = pCmap->pVisual;
ncolors = pVisual->ColormapEntries;
- pCmap->devPriv = (pointer)malloc(sizeof(xnestPrivColormap));
-
xnestColormapPriv(pCmap)->colormap =
XCreateColormap(xnestDisplay,
xnestDefaultWindows[pCmap->pScreen->myNum],
@@ -130,7 +130,6 @@ void
xnestDestroyColormap(ColormapPtr pCmap)
{
XFreeColormap(xnestDisplay, xnestColormap(pCmap));
- free(pCmap->devPriv);
}
#define SEARCH_PREDICATE \
diff --git a/hw/xnest/Color.h b/hw/xnest/Color.h
index f00bde47f..d39c638f9 100644
--- a/hw/xnest/Color.h
+++ b/hw/xnest/Color.h
@@ -32,8 +32,9 @@ typedef struct {
int index;
} xnestInstalledColormapWindows;
+extern DevPrivateKeyRec xnestColormapPrivateKeyRec;
#define xnestColormapPriv(pCmap) \
- ((xnestPrivColormap *)((pCmap)->devPriv))
+ ((xnestPrivColormap *) dixLookupPrivate(&(pCmap)->devPrivates, &xnestColormapPrivateKeyRec))
#define xnestColormap(pCmap) (xnestColormapPriv(pCmap)->colormap)
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 957fe4cdb..0a6cab687 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -151,6 +151,8 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
return FALSE;
if (!dixRegisterPrivateKey(&xnestPixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof (xnestPrivPixmap)))
return FALSE;
+ if (!dixRegisterPrivateKey(&xnestColormapPrivateKeyRec, PRIVATE_COLORMAP, sizeof (xnestPrivColormap)))
+ return FALSE;
if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0))
return FALSE;