aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xfixes/cursor.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-10 14:56:29 +0200
committermarha <marha@users.sourceforge.net>2012-07-10 14:56:29 +0200
commitd137057fd13e83ec15ab416c7fe774741da06047 (patch)
treef4b38caa4f3ecb983f00e84f4f4d8d66699ecbc5 /xorg-server/xfixes/cursor.c
parentc29d91cfd8df084f16d0d2dfa82c3a86f7719a73 (diff)
downloadvcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.tar.gz
vcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.tar.bz2
vcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.zip
fontconfig mesa xserver git update 10 Jul 2012
Diffstat (limited to 'xorg-server/xfixes/cursor.c')
-rw-r--r--xorg-server/xfixes/cursor.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 467529a4f..4eee59246 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -172,14 +172,14 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
CursorCurrent[pDev->id] = pCursor;
for (e = cursorEvents; e; e = e->next) {
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
- xXFixesCursorNotifyEvent ev;
-
- ev.type = XFixesEventBase + XFixesCursorNotify;
- ev.subtype = XFixesDisplayCursorNotify;
- ev.window = e->pWindow->drawable.id;
- ev.cursorSerial = pCursor ? pCursor->serialNumber : 0;
- ev.timestamp = currentTime.milliseconds;
- ev.name = pCursor ? pCursor->name : None;
+ xXFixesCursorNotifyEvent ev = {
+ .type = XFixesEventBase + XFixesCursorNotify,
+ .subtype = XFixesDisplayCursorNotify,
+ .window = e->pWindow->drawable.id,
+ .cursorSerial = pCursor ? pCursor->serialNumber : 0,
+ .timestamp = currentTime.milliseconds,
+ .name = pCursor ? pCursor->name : None
+ };
WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
}
}
@@ -380,7 +380,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
width = pCursor->bits->width;
height = pCursor->bits->height;
npixels = width * height;
- rep = malloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32));
+ rep = calloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32),
+ 1);
if (!rep)
return BadAlloc;
@@ -409,8 +410,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
swapl(&rep->cursorSerial);
SwapLongs(image, npixels);
}
- WriteToClient(client, sizeof(xXFixesGetCursorImageReply) +
- (npixels << 2), (char *) rep);
+ WriteToClient(client,
+ sizeof(xXFixesGetCursorImageReply) + (npixels << 2), rep);
free(rep);
return Success;
}
@@ -473,11 +474,13 @@ ProcXFixesGetCursorName(ClientPtr client)
str = "";
len = strlen(str);
- reply.type = X_Reply;
- reply.length = bytes_to_int32(len);
- reply.sequenceNumber = client->sequence;
- reply.atom = pCursor->name;
- reply.nbytes = len;
+ reply = (xXFixesGetCursorNameReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(len),
+ .atom = pCursor->name,
+ .nbytes = len
+ };
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
@@ -529,8 +532,8 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
name = pCursor->name ? NameForAtom(pCursor->name) : "";
nbytes = strlen(name);
nbytesRound = pad_to_int32(nbytes);
- rep = malloc(sizeof(xXFixesGetCursorImageAndNameReply) +
- npixels * sizeof(CARD32) + nbytesRound);
+ rep = calloc(sizeof(xXFixesGetCursorImageAndNameReply) +
+ npixels * sizeof(CARD32) + nbytesRound, 1);
if (!rep)
return BadAlloc;
@@ -565,7 +568,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
SwapLongs(image, npixels);
}
WriteToClient(client, sizeof(xXFixesGetCursorImageAndNameReply) +
- (npixels << 2) + nbytesRound, (char *) rep);
+ (npixels << 2) + nbytesRound, rep);
free(rep);
return Success;
}