Xi: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros

Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-12-04 12:03:23 +01:00
committed by Enrico Weigelt
parent e8ec547b93
commit 4395caee14
48 changed files with 198 additions and 383 deletions

View File

@@ -38,6 +38,7 @@
#include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "Xi/handlers.h"
#include "inputstr.h" /* DeviceIntPtr */
@@ -50,18 +51,14 @@
int
ProcXISetClientPointer(ClientPtr client)
{
X_REQUEST_HEAD_STRUCT(xXISetClientPointerReq);
X_REQUEST_FIELD_CARD32(win);
X_REQUEST_FIELD_CARD16(deviceid);
DeviceIntPtr pDev;
ClientPtr targetClient;
int rc;
REQUEST(xXISetClientPointerReq);
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
if (client->swapped) {
swapl(&stuff->win);
swaps(&stuff->deviceid);
}
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess);
if (rc != Success) {
client->errorValue = stuff->deviceid;