From 1ded81981ef625e193ce9a44e7bfce7f021b230d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 2 Dec 2025 19:21:05 +0100 Subject: [PATCH] [PR #1520] dix: inline SProcCreateGlyphCursor() PR: https://github.com/X11Libre/xserver/pull/1520 --- dix/dispatch.c | 20 +++++++++++++++++--- dix/swapreq.c | 19 ------------------- dix/swapreq.h | 1 - dix/tables.c | 2 +- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/dix/dispatch.c b/dix/dispatch.c index 9709ebf742..c3af81b338 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3197,12 +3197,26 @@ ProcCreateCursor(ClientPtr client) int ProcCreateGlyphCursor(ClientPtr client) { + REQUEST(xCreateGlyphCursorReq); + REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); + + if (client->swapped) { + swapl(&stuff->cid); + swapl(&stuff->source); + swapl(&stuff->mask); + swaps(&stuff->sourceChar); + swaps(&stuff->maskChar); + swaps(&stuff->foreRed); + swaps(&stuff->foreGreen); + swaps(&stuff->foreBlue); + swaps(&stuff->backRed); + swaps(&stuff->backGreen); + swaps(&stuff->backBlue); + } + CursorPtr pCursor; int res; - REQUEST(xCreateGlyphCursorReq); - - REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); res = AllocGlyphCursor(stuff->source, stuff->sourceChar, diff --git a/dix/swapreq.c b/dix/swapreq.c index de9f1399eb..a969a3f05c 100644 --- a/dix/swapreq.c +++ b/dix/swapreq.c @@ -702,25 +702,6 @@ SProcCreateCursor(ClientPtr client) return ((*ProcVector[X_CreateCursor]) (client)); } -int _X_COLD -SProcCreateGlyphCursor(ClientPtr client) -{ - REQUEST(xCreateGlyphCursorReq); - REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); - swapl(&stuff->cid); - swapl(&stuff->source); - swapl(&stuff->mask); - swaps(&stuff->sourceChar); - swaps(&stuff->maskChar); - swaps(&stuff->foreRed); - swaps(&stuff->foreGreen); - swaps(&stuff->foreBlue); - swaps(&stuff->backRed); - swaps(&stuff->backGreen); - swaps(&stuff->backBlue); - return ((*ProcVector[X_CreateGlyphCursor]) (client)); -} - int _X_COLD SProcRecolorCursor(ClientPtr client) { diff --git a/dix/swapreq.h b/dix/swapreq.h index 8b10d536ed..94d84b96b1 100644 --- a/dix/swapreq.h +++ b/dix/swapreq.h @@ -49,7 +49,6 @@ int SProcCopyPlane(ClientPtr client); int SProcCreateColormap(ClientPtr client); int SProcCreateCursor(ClientPtr client); int SProcCreateGC(ClientPtr client); -int SProcCreateGlyphCursor(ClientPtr client); int SProcCreatePixmap(ClientPtr client); int SProcCreateWindow(ClientPtr client); int SProcFillPoly(ClientPtr client); diff --git a/dix/tables.c b/dix/tables.c index 5f1c14b1bd..b161fc4dff 100644 --- a/dix/tables.c +++ b/dix/tables.c @@ -426,7 +426,7 @@ int (*SwappedProcVector[256]) (ClientPtr /* client */) = { SProcQueryColors, SProcLookupColor, SProcCreateCursor, - SProcCreateGlyphCursor, + ProcCreateGlyphCursor, ProcFreeCursor, /* 95 */ SProcRecolorCursor, SProcQueryBestSize,