aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/render/animcur.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
commitd1e4f4b8546c7955c66dd023bfd6ef437db9d21d (patch)
tree529985e77bfc95aa95fe5b540e8f42b0ef041206 /xorg-server/render/animcur.c
parent13919cf85a6ca41d97238de13344aba59e0f7680 (diff)
parent4c61bf84b11e26e6f22648668c95ea760a379163 (diff)
downloadvcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.gz
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.bz2
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/render/animcur.c')
-rw-r--r--xorg-server/render/animcur.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/xorg-server/render/animcur.c b/xorg-server/render/animcur.c
index 13f09d387..505c65c18 100644
--- a/xorg-server/render/animcur.c
+++ b/xorg-server/render/animcur.c
@@ -76,11 +76,11 @@ static CursorBits animCursorBits = {
empty, empty, 2, 1, 1, 0, 0, 1
};
-static int AnimCurScreenPrivateKeyIndex;
-static DevPrivateKey AnimCurScreenPrivateKey = &AnimCurScreenPrivateKeyIndex;
+static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
+#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)
#define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits))
-#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
+#define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE))))
#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey))
#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p)
@@ -322,6 +322,9 @@ AnimCurInit (ScreenPtr pScreen)
{
AnimCurScreenPtr as;
+ if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
as = (AnimCurScreenPtr) malloc(sizeof (AnimCurScreenRec));
if (!as)
return FALSE;
@@ -354,11 +357,12 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
if (IsAnimCur (cursors[i]))
return BadMatch;
- pCursor = (CursorPtr) malloc(sizeof (CursorRec) +
- sizeof (AnimCurRec) +
- ncursor * sizeof (AnimCurElt));
+ pCursor = (CursorPtr) calloc(CURSOR_REC_SIZE +
+ sizeof (AnimCurRec) +
+ ncursor * sizeof (AnimCurElt), 1);
if (!pCursor)
return BadAlloc;
+ dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR);
pCursor->bits = &animCursorBits;
pCursor->refcnt = 1;
@@ -371,13 +375,12 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
pCursor->backBlue = cursors[0]->backBlue;
pCursor->id = cid;
- pCursor->devPrivates = NULL;
/* security creation/labeling check */
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
RT_NONE, NULL, DixCreateAccess);
if (rc != Success) {
- dixFreePrivates(pCursor->devPrivates);
+ dixFiniPrivates(pCursor, PRIVATE_CURSOR);
free(pCursor);
return rc;
}