Xi: inline SProcXChangeDeviceControl()

No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-09-16 19:28:55 +02:00 committed by Enrico Weigelt
parent 88ed85dffc
commit 4fa442b6eb
4 changed files with 12 additions and 37 deletions

View File

@ -66,37 +66,6 @@ SOFTWARE.
#include "XIstubs.h"
#include "exglobals.h"
/***********************************************************************
*
* This procedure changes the control attributes for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXChangeDeviceControl(ClientPtr client)
{
xDeviceCtl *ctl;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control);
ctl = (xDeviceCtl *) &stuff[1];
swaps(&ctl->control);
swaps(&ctl->length);
switch (stuff->control) {
case DEVICE_ABS_CALIB:
case DEVICE_ABS_AREA:
case DEVICE_CORE:
case DEVICE_ENABLE:
case DEVICE_RESOLUTION:
/* hmm. beer. *drool* */
break;
}
return (ProcXChangeDeviceControl(client));
}
/***********************************************************************
*
* Change the control attributes.
@ -106,6 +75,16 @@ SProcXChangeDeviceControl(ClientPtr client)
int
ProcXChangeDeviceControl(ClientPtr client)
{
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
if (client->swapped) {
swaps(&stuff->control);
xDeviceCtl *ctl = (xDeviceCtl *) &stuff[1];
swaps(&ctl->control);
swaps(&ctl->length);
}
unsigned len;
int i, status, ret = BadValue;
DeviceIntPtr dev;
@ -114,9 +93,6 @@ ProcXChangeDeviceControl(ClientPtr client)
CARD32 *resolution;
xDeviceEnableCtl *e;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq));
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)

View File

@ -420,7 +420,7 @@ SProcIDispatch(ClientPtr client)
case X_GetDeviceControl:
return ProcXGetDeviceControl(client);
case X_ChangeDeviceControl:
return SProcXChangeDeviceControl(client);
return ProcXChangeDeviceControl(client);
/* XI 1.5 */
case X_ListDeviceProperties:
return ProcXListDeviceProperties(client);

View File

@ -69,7 +69,6 @@ int ProcXUngrabDeviceButton(ClientPtr client);
int ProcXUngrabDevice(ClientPtr client);
int ProcXUngrabDeviceKey(ClientPtr client);
int SProcXChangeDeviceControl(ClientPtr client);
int SProcXChangeDeviceDontPropagateList(ClientPtr client);
int SProcXGetDeviceDontPropagateList(ClientPtr client);
int SProcXGetDeviceMotionEvents(ClientPtr client);

View File

@ -78,7 +78,7 @@ request_ChangeDeviceControl(ClientPtr client, xChangeDeviceControlReq * req,
swaps(&ctl->length);
swaps(&ctl->control);
/* XXX: swap other contents of ctl, depending on type */
rc = SProcXChangeDeviceControl(&client_request);
rc = ProcXChangeDeviceControl(&client_request);
assert(rc == error);
}