XI: canonicalize reply struct declarations and naming
* name all of them "rep", as throughout most of the Xserver codebase * always declare them where initialized Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
7ea43bd5e9
commit
62863427a3
|
@ -108,7 +108,6 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
int i, status, ret = BadValue;
|
int i, status, ret = BadValue;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xDeviceResolutionCtl *r;
|
xDeviceResolutionCtl *r;
|
||||||
xChangeDeviceControlReply rep;
|
|
||||||
AxisInfoPtr a;
|
AxisInfoPtr a;
|
||||||
CARD32 *resolution;
|
CARD32 *resolution;
|
||||||
xDeviceEnableCtl *e;
|
xDeviceEnableCtl *e;
|
||||||
|
@ -127,7 +126,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xChangeDeviceControlReply) {
|
xChangeDeviceControlReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_ChangeDeviceControl,
|
.RepType = X_ChangeDeviceControl,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
19
Xi/getbmap.c
19
Xi/getbmap.c
|
@ -69,21 +69,12 @@ int
|
||||||
ProcXGetDeviceButtonMapping(ClientPtr client)
|
ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceButtonMappingReply rep;
|
|
||||||
ButtonClassPtr b;
|
ButtonClassPtr b;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceButtonMappingReq);
|
REQUEST(xGetDeviceButtonMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
||||||
|
|
||||||
rep = (xGetDeviceButtonMappingReply) {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceButtonMapping,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.nElts = 0,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -92,8 +83,14 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
if (b == NULL)
|
if (b == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
rep.nElts = b->numButtons;
|
xGetDeviceButtonMappingReply rep = {
|
||||||
rep.length = bytes_to_int32(rep.nElts);
|
.repType = X_Reply,
|
||||||
|
.RepType = X_GetDeviceButtonMapping,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.nElts = b->numButtons,
|
||||||
|
.length = bytes_to_int32(b->numButtons),
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
||||||
WriteToClient(client, rep.nElts, &b->map[1]);
|
WriteToClient(client, rep.nElts, &b->map[1]);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
16
Xi/getdctl.c
16
Xi/getdctl.c
|
@ -170,7 +170,6 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
int rc, total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *savbuf;
|
char *savbuf;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceControlReply rep;
|
|
||||||
|
|
||||||
REQUEST(xGetDeviceControlReq);
|
REQUEST(xGetDeviceControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||||
|
@ -179,13 +178,6 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGetDeviceControlReply) {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceControl,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
switch (stuff->control) {
|
switch (stuff->control) {
|
||||||
case DEVICE_RESOLUTION:
|
case DEVICE_RESOLUTION:
|
||||||
if (!dev->valuator)
|
if (!dev->valuator)
|
||||||
|
@ -225,7 +217,13 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.length = bytes_to_int32(total_length);
|
xGetDeviceControlReply rep = {
|
||||||
|
.repType = X_Reply,
|
||||||
|
.RepType = X_GetDeviceControl,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = bytes_to_int32(total_length),
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
|
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
|
||||||
WriteToClient(client, total_length, savbuf);
|
WriteToClient(client, total_length, savbuf);
|
||||||
free(savbuf);
|
free(savbuf);
|
||||||
|
|
|
@ -269,7 +269,6 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
StringFeedbackPtr s;
|
StringFeedbackPtr s;
|
||||||
BellFeedbackPtr b;
|
BellFeedbackPtr b;
|
||||||
LedFeedbackPtr l;
|
LedFeedbackPtr l;
|
||||||
xGetFeedbackControlReply rep;
|
|
||||||
|
|
||||||
REQUEST(xGetFeedbackControlReq);
|
REQUEST(xGetFeedbackControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
||||||
|
@ -278,7 +277,7 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGetFeedbackControlReply) {
|
xGetFeedbackControlReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetFeedbackControl,
|
.RepType = X_GetFeedbackControl,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -71,7 +71,6 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
FocusClassPtr focus;
|
FocusClassPtr focus;
|
||||||
xGetDeviceFocusReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceFocusReq);
|
REQUEST(xGetDeviceFocusReq);
|
||||||
|
@ -83,7 +82,7 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
if (!dev->focus)
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep = (xGetDeviceFocusReply) {
|
xGetDeviceFocusReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetDeviceFocus,
|
.RepType = X_GetDeviceFocus,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -71,7 +71,6 @@ SOFTWARE.
|
||||||
int
|
int
|
||||||
ProcXGetDeviceKeyMapping(ClientPtr client)
|
ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetDeviceKeyMappingReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
KeySymsPtr syms;
|
KeySymsPtr syms;
|
||||||
|
@ -102,7 +101,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
if (!syms)
|
if (!syms)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
rep = (xGetDeviceKeyMappingReply) {
|
xGetDeviceKeyMappingReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetDeviceKeyMapping,
|
.RepType = X_GetDeviceKeyMapping,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -69,7 +69,6 @@ int
|
||||||
ProcXGetDeviceModifierMapping(ClientPtr client)
|
ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceModifierMappingReply rep;
|
|
||||||
KeyCode *modkeymap = NULL;
|
KeyCode *modkeymap = NULL;
|
||||||
int ret, max_keys_per_mod;
|
int ret, max_keys_per_mod;
|
||||||
|
|
||||||
|
@ -84,7 +83,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rep = (xGetDeviceModifierMappingReply) {
|
xGetDeviceModifierMappingReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetDeviceModifierMapping,
|
.RepType = X_GetDeviceModifierMapping,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -94,13 +94,12 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
int i, rc;
|
int i, rc;
|
||||||
XEventClass *buf = NULL, *tbuf;
|
XEventClass *buf = NULL, *tbuf;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xGetDeviceDontPropagateListReply rep;
|
|
||||||
OtherInputMasks *others;
|
OtherInputMasks *others;
|
||||||
|
|
||||||
REQUEST(xGetDeviceDontPropagateListReq);
|
REQUEST(xGetDeviceDontPropagateListReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||||
|
|
||||||
rep = (xGetDeviceDontPropagateListReply) {
|
xGetDeviceDontPropagateListReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetDeviceDontPropagateList,
|
.RepType = X_GetDeviceDontPropagateList,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -90,7 +90,6 @@ int
|
||||||
ProcXGetSelectedExtensionEvents(ClientPtr client)
|
ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
int i, rc, total_length = 0;
|
int i, rc, total_length = 0;
|
||||||
xGetSelectedExtensionEventsReply rep;
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
XEventClass *buf = NULL;
|
XEventClass *buf = NULL;
|
||||||
XEventClass *tclient;
|
XEventClass *tclient;
|
||||||
|
@ -101,7 +100,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
REQUEST(xGetSelectedExtensionEventsReq);
|
REQUEST(xGetSelectedExtensionEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
||||||
|
|
||||||
rep = (xGetSelectedExtensionEventsReply) {
|
xGetSelectedExtensionEventsReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetSelectedExtensionEvents,
|
.RepType = X_GetSelectedExtensionEvents,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -86,8 +86,6 @@ SProcXGetExtensionVersion(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXGetExtensionVersion(ClientPtr client)
|
ProcXGetExtensionVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetExtensionVersionReply rep;
|
|
||||||
|
|
||||||
REQUEST(xGetExtensionVersionReq);
|
REQUEST(xGetExtensionVersionReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||||
|
|
||||||
|
@ -95,7 +93,7 @@ ProcXGetExtensionVersion(ClientPtr client)
|
||||||
stuff->nbytes))
|
stuff->nbytes))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep = (xGetExtensionVersionReply) {
|
xGetExtensionVersionReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetExtensionVersion,
|
.RepType = X_GetExtensionVersion,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -100,7 +100,6 @@ int
|
||||||
ProcXGrabDevice(ClientPtr client)
|
ProcXGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
xGrabDeviceReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
GrabMask mask;
|
GrabMask mask;
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
|
@ -112,7 +111,7 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep = (xGrabDeviceReply) {
|
xGrabDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GrabDevice,
|
.RepType = X_GrabDevice,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -87,7 +87,6 @@ int
|
||||||
ProcXGetDeviceMotionEvents(ClientPtr client)
|
ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
INT32 *coords = NULL, *bufptr;
|
INT32 *coords = NULL, *bufptr;
|
||||||
xGetDeviceMotionEventsReply rep;
|
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
int rc, num_events, axes, size = 0;
|
int rc, num_events, axes, size = 0;
|
||||||
unsigned long nEvents;
|
unsigned long nEvents;
|
||||||
|
@ -97,8 +96,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
ValuatorClassPtr v;
|
ValuatorClassPtr v;
|
||||||
|
|
||||||
REQUEST(xGetDeviceMotionEventsReq);
|
REQUEST(xGetDeviceMotionEventsReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -108,7 +107,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
if (dev->valuator->motionHintWindow)
|
if (dev->valuator->motionHintWindow)
|
||||||
MaybeStopDeviceHint(dev, client);
|
MaybeStopDeviceHint(dev, client);
|
||||||
axes = v->numAxes;
|
axes = v->numAxes;
|
||||||
rep = (xGetDeviceMotionEventsReply) {
|
|
||||||
|
xGetDeviceMotionEventsReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetDeviceMotionEvents,
|
.RepType = X_GetDeviceMotionEvents,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -117,6 +117,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
.axes = axes,
|
.axes = axes,
|
||||||
.mode = Absolute /* XXX we don't do relative at the moment */
|
.mode = Absolute /* XXX we don't do relative at the moment */
|
||||||
};
|
};
|
||||||
|
|
||||||
start = ClientTimeToServerTime(stuff->start);
|
start = ClientTimeToServerTime(stuff->start);
|
||||||
stop = ClientTimeToServerTime(stuff->stop);
|
stop = ClientTimeToServerTime(stuff->stop);
|
||||||
if (CompareTimeStamps(start, stop) == LATER ||
|
if (CompareTimeStamps(start, stop) == LATER ||
|
||||||
|
|
|
@ -316,7 +316,6 @@ ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
|
||||||
int
|
int
|
||||||
ProcXListInputDevices(ClientPtr client)
|
ProcXListInputDevices(ClientPtr client)
|
||||||
{
|
{
|
||||||
xListInputDevicesReply rep;
|
|
||||||
int numdevs = 0;
|
int numdevs = 0;
|
||||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||||
int i = 0, size = 0;
|
int i = 0, size = 0;
|
||||||
|
@ -328,7 +327,7 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xListInputDevicesReq);
|
REQUEST_SIZE_MATCH(xListInputDevicesReq);
|
||||||
|
|
||||||
rep = (xListInputDevicesReply) {
|
xListInputDevicesReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_ListInputDevices,
|
.RepType = X_ListInputDevices,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -79,7 +79,6 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
xInputClassInfo evbase[numInputClasses];
|
xInputClassInfo evbase[numInputClasses];
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int status = Success;
|
int status = Success;
|
||||||
xOpenDeviceReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xOpenDeviceReq);
|
REQUEST(xOpenDeviceReq);
|
||||||
|
@ -130,7 +129,8 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
}
|
}
|
||||||
evbase[j].class = OtherClass;
|
evbase[j].class = OtherClass;
|
||||||
evbase[j++].event_type_base = event_base[OtherClass];
|
evbase[j++].event_type_base = event_base[OtherClass];
|
||||||
rep = (xOpenDeviceReply) {
|
|
||||||
|
xOpenDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_OpenDevice,
|
.RepType = X_OpenDevice,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -66,7 +66,6 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
xButtonState *tb;
|
xButtonState *tb;
|
||||||
ValuatorClassPtr v;
|
ValuatorClassPtr v;
|
||||||
xValuatorState *tv;
|
xValuatorState *tv;
|
||||||
xQueryDeviceStateReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
double *values;
|
double *values;
|
||||||
|
|
||||||
|
@ -144,7 +143,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xQueryDeviceStateReply) {
|
xQueryDeviceStateReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_QueryDeviceState,
|
.RepType = X_QueryDeviceState,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -72,7 +72,6 @@ int
|
||||||
ProcXSetDeviceButtonMapping(ClientPtr client)
|
ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
xSetDeviceButtonMappingReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xSetDeviceButtonMappingReq);
|
REQUEST(xSetDeviceButtonMappingReq);
|
||||||
|
@ -86,7 +85,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rep = (xSetDeviceButtonMappingReply) {
|
xSetDeviceButtonMappingReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_SetDeviceButtonMapping,
|
.RepType = X_SetDeviceButtonMapping,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -73,13 +73,12 @@ int
|
||||||
ProcXSetDeviceValuators(ClientPtr client)
|
ProcXSetDeviceValuators(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xSetDeviceValuatorsReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceValuatorsReq);
|
REQUEST(xSetDeviceValuatorsReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
||||||
|
|
||||||
rep = (xSetDeviceValuatorsReply) {
|
xSetDeviceValuatorsReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_SetDeviceValuators,
|
.RepType = X_SetDeviceValuators,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
15
Xi/setmmap.c
15
Xi/setmmap.c
|
@ -73,7 +73,6 @@ int
|
||||||
ProcXSetDeviceModifierMapping(ClientPtr client)
|
ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
xSetDeviceModifierMappingReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xSetDeviceModifierMappingReq);
|
REQUEST(xSetDeviceModifierMappingReq);
|
||||||
|
@ -83,13 +82,6 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
(stuff->numKeyPerModifier << 1))
|
(stuff->numKeyPerModifier << 1))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep = (xSetDeviceModifierMappingReply) {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_SetDeviceModifierMapping,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -99,6 +91,13 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
if (ret == Success)
|
if (ret == Success)
|
||||||
ret = MappingSuccess;
|
ret = MappingSuccess;
|
||||||
|
|
||||||
|
xSetDeviceModifierMappingReply rep = {
|
||||||
|
.repType = X_Reply,
|
||||||
|
.RepType = X_SetDeviceModifierMapping,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
|
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
|
||||||
rep.success = ret;
|
rep.success = ret;
|
||||||
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
|
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
|
||||||
|
|
|
@ -73,13 +73,12 @@ int
|
||||||
ProcXSetDeviceMode(ClientPtr client)
|
ProcXSetDeviceMode(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xSetDeviceModeReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceModeReq);
|
REQUEST(xSetDeviceModeReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
||||||
|
|
||||||
rep = (xSetDeviceModeReply) {
|
xSetDeviceModeReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_SetDeviceMode,
|
.RepType = X_SetDeviceMode,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -61,7 +61,6 @@ ProcXIGetClientPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
ClientPtr winclient;
|
ClientPtr winclient;
|
||||||
xXIGetClientPointerReply rep;
|
|
||||||
|
|
||||||
REQUEST(xXIGetClientPointerReq);
|
REQUEST(xXIGetClientPointerReq);
|
||||||
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
|
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
|
||||||
|
@ -75,7 +74,7 @@ ProcXIGetClientPointer(ClientPtr client)
|
||||||
else
|
else
|
||||||
winclient = client;
|
winclient = client;
|
||||||
|
|
||||||
rep = (xXIGetClientPointerReply) {
|
xXIGetClientPointerReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIGetClientPointer,
|
.RepType = X_XIGetClientPointer,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -67,7 +67,6 @@ int
|
||||||
ProcXIGrabDevice(ClientPtr client)
|
ProcXIGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xXIGrabDeviceReply rep;
|
|
||||||
int ret = Success;
|
int ret = Success;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
GrabMask mask = { 0 };
|
GrabMask mask = { 0 };
|
||||||
|
@ -123,7 +122,7 @@ ProcXIGrabDevice(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rep = (xXIGrabDeviceReply) {
|
xXIGrabDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIGrabDevice,
|
.RepType = X_XIGrabDevice,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -849,7 +849,6 @@ int
|
||||||
ProcXListDeviceProperties(ClientPtr client)
|
ProcXListDeviceProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
Atom *atoms;
|
Atom *atoms;
|
||||||
xListDevicePropertiesReply rep;
|
|
||||||
int natoms;
|
int natoms;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
@ -865,7 +864,7 @@ ProcXListDeviceProperties(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xListDevicePropertiesReply) {
|
xListDevicePropertiesReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_ListDeviceProperties,
|
.RepType = X_ListDeviceProperties,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -946,7 +945,6 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
int rc, format, nitems, bytes_after;
|
int rc, format, nitems, bytes_after;
|
||||||
char *data;
|
char *data;
|
||||||
Atom type;
|
Atom type;
|
||||||
xGetDevicePropertyReply reply;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
||||||
if (stuff->delete)
|
if (stuff->delete)
|
||||||
|
@ -963,7 +961,7 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply = (xGetDevicePropertyReply) {
|
xGetDevicePropertyReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetDeviceProperty,
|
.RepType = X_GetDeviceProperty,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -975,13 +973,13 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
.deviceid = dev->id
|
.deviceid = dev->id
|
||||||
};
|
};
|
||||||
|
|
||||||
if (stuff->delete && (reply.bytesAfter == 0))
|
if (stuff->delete && (rep.bytesAfter == 0))
|
||||||
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
|
WriteReplyToClient(client, sizeof(xGenericReply), &rep);
|
||||||
|
|
||||||
if (length) {
|
if (length) {
|
||||||
switch (reply.format) {
|
switch (rep.format) {
|
||||||
case 32:
|
case 32:
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
||||||
break;
|
break;
|
||||||
|
@ -996,7 +994,7 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete the Property */
|
/* delete the Property */
|
||||||
if (stuff->delete && (reply.bytesAfter == 0)) {
|
if (stuff->delete && (rep.bytesAfter == 0)) {
|
||||||
XIPropertyPtr prop, *prev;
|
XIPropertyPtr prop, *prev;
|
||||||
|
|
||||||
for (prev = &dev->properties.properties; (prop = *prev);
|
for (prev = &dev->properties.properties; (prop = *prev);
|
||||||
|
@ -1077,7 +1075,6 @@ int
|
||||||
ProcXIListProperties(ClientPtr client)
|
ProcXIListProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
Atom *atoms;
|
Atom *atoms;
|
||||||
xXIListPropertiesReply rep;
|
|
||||||
int natoms;
|
int natoms;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
@ -1093,7 +1090,7 @@ ProcXIListProperties(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xXIListPropertiesReply) {
|
xXIListPropertiesReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIListProperties,
|
.RepType = X_XIListProperties,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -1171,7 +1168,6 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIGetPropertyReq);
|
REQUEST(xXIGetPropertyReq);
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xXIGetPropertyReply reply;
|
|
||||||
int length;
|
int length;
|
||||||
int rc, format, nitems, bytes_after;
|
int rc, format, nitems, bytes_after;
|
||||||
char *data;
|
char *data;
|
||||||
|
@ -1192,7 +1188,7 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply = (xXIGetPropertyReply) {
|
xXIGetPropertyReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIGetProperty,
|
.RepType = X_XIGetProperty,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -1203,13 +1199,13 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
.format = format
|
.format = format
|
||||||
};
|
};
|
||||||
|
|
||||||
if (length && stuff->delete && (reply.bytes_after == 0))
|
if (length && stuff->delete && (rep.bytes_after == 0))
|
||||||
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &reply);
|
WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &rep);
|
||||||
|
|
||||||
if (length) {
|
if (length) {
|
||||||
switch (reply.format) {
|
switch (rep.format) {
|
||||||
case 32:
|
case 32:
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
||||||
break;
|
break;
|
||||||
|
@ -1224,7 +1220,7 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete the Property */
|
/* delete the Property */
|
||||||
if (stuff->delete && (reply.bytes_after == 0)) {
|
if (stuff->delete && (rep.bytes_after == 0)) {
|
||||||
XIPropertyPtr prop, *prev;
|
XIPropertyPtr prop, *prev;
|
||||||
|
|
||||||
for (prev = &dev->properties.properties; (prop = *prev);
|
for (prev = &dev->properties.properties; (prop = *prev);
|
||||||
|
|
|
@ -67,7 +67,6 @@ SProcXIQueryDevice(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXIQueryDevice(ClientPtr client)
|
ProcXIQueryDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIQueryDeviceReply rep;
|
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev = NULL;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
int i = 0, len = 0;
|
int i = 0, len = 0;
|
||||||
|
@ -110,7 +109,7 @@ ProcXIQueryDevice(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xXIQueryDeviceReply) {
|
xXIQueryDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIQueryDevice,
|
.RepType = X_XIQueryDevice,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -77,7 +77,6 @@ int
|
||||||
ProcXIQueryPointer(ClientPtr client)
|
ProcXIQueryPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
xXIQueryPointerReply rep;
|
|
||||||
DeviceIntPtr pDev, kbd;
|
DeviceIntPtr pDev, kbd;
|
||||||
WindowPtr pWin, t;
|
WindowPtr pWin, t;
|
||||||
SpritePtr pSprite;
|
SpritePtr pSprite;
|
||||||
|
@ -127,7 +126,7 @@ ProcXIQueryPointer(ClientPtr client)
|
||||||
|
|
||||||
pSprite = pDev->spriteInfo->sprite;
|
pSprite = pDev->spriteInfo->sprite;
|
||||||
|
|
||||||
rep = (xXIQueryPointerReply) {
|
xXIQueryPointerReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIQueryPointer,
|
.RepType = X_XIQueryPointer,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -54,7 +54,6 @@ extern XExtensionVersion XIVersion; /* defined in getvers.c */
|
||||||
int
|
int
|
||||||
ProcXIQueryVersion(ClientPtr client)
|
ProcXIQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIQueryVersionReply rep;
|
|
||||||
XIClientPtr pXIClient;
|
XIClientPtr pXIClient;
|
||||||
int major, minor;
|
int major, minor;
|
||||||
|
|
||||||
|
@ -113,7 +112,7 @@ ProcXIQueryVersion(ClientPtr client)
|
||||||
pXIClient->minor_version = minor;
|
pXIClient->minor_version = minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xXIQueryVersionReply) {
|
xXIQueryVersionReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIQueryVersion,
|
.RepType = X_XIQueryVersion,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -343,7 +343,6 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
int rc, i;
|
int rc, i;
|
||||||
WindowPtr win;
|
WindowPtr win;
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
xXIGetSelectedEventsReply reply;
|
|
||||||
OtherInputMasks *masks;
|
OtherInputMasks *masks;
|
||||||
InputClientsPtr others = NULL;
|
InputClientsPtr others = NULL;
|
||||||
xXIEventMask *evmask = NULL;
|
xXIEventMask *evmask = NULL;
|
||||||
|
@ -357,7 +356,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply = (xXIGetSelectedEventsReply) {
|
xXIGetSelectedEventsReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIGetSelectedEvents,
|
.RepType = X_XIGetSelectedEvents,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -376,7 +375,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!others) {
|
if (!others) {
|
||||||
WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
|
WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,8 +401,8 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
|
|
||||||
evmask->deviceid = i;
|
evmask->deviceid = i;
|
||||||
evmask->mask_len = mask_len;
|
evmask->mask_len = mask_len;
|
||||||
reply.num_masks++;
|
rep.num_masks++;
|
||||||
reply.length += sizeof(xXIEventMask) / 4 + evmask->mask_len;
|
rep.length += sizeof(xXIEventMask) / 4 + evmask->mask_len;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&evmask->deviceid);
|
swaps(&evmask->deviceid);
|
||||||
|
@ -419,10 +418,10 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save the value before SRepXIGetSelectedEvents swaps it */
|
/* save the value before SRepXIGetSelectedEvents swaps it */
|
||||||
length = reply.length;
|
length = rep.length;
|
||||||
WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
|
WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &rep);
|
||||||
|
|
||||||
if (reply.num_masks)
|
if (rep.num_masks)
|
||||||
WriteToClient(client, length * 4, buffer);
|
WriteToClient(client, length * 4, buffer);
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
|
@ -86,7 +86,6 @@ ProcXISetFocus(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXIGetFocus(ClientPtr client)
|
ProcXIGetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIGetFocusReply rep;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -99,7 +98,7 @@ ProcXIGetFocus(ClientPtr client)
|
||||||
if (!dev->focus)
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep = (xXIGetFocusReply) {
|
xXIGetFocusReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_XIGetFocus,
|
.RepType = X_XIGetFocus,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
Loading…
Reference in New Issue