diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 9c4d1b1b8..e53e6c224 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -108,7 +108,6 @@ ProcXChangeDeviceControl(ClientPtr client) int i, status, ret = BadValue; DeviceIntPtr dev; xDeviceResolutionCtl *r; - xChangeDeviceControlReply rep; AxisInfoPtr a; CARD32 *resolution; xDeviceEnableCtl *e; @@ -127,7 +126,7 @@ ProcXChangeDeviceControl(ClientPtr client) goto out; } - rep = (xChangeDeviceControlReply) { + xChangeDeviceControlReply rep = { .repType = X_Reply, .RepType = X_ChangeDeviceControl, .sequenceNumber = client->sequence, diff --git a/Xi/getbmap.c b/Xi/getbmap.c index 623978fd5..db7583b73 100644 --- a/Xi/getbmap.c +++ b/Xi/getbmap.c @@ -69,21 +69,12 @@ int ProcXGetDeviceButtonMapping(ClientPtr client) { DeviceIntPtr dev; - xGetDeviceButtonMappingReply rep; ButtonClassPtr b; int rc; REQUEST(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); if (rc != Success) return rc; @@ -92,8 +83,14 @@ ProcXGetDeviceButtonMapping(ClientPtr client) if (b == NULL) return BadMatch; - rep.nElts = b->numButtons; - rep.length = bytes_to_int32(rep.nElts); + xGetDeviceButtonMappingReply rep = { + .repType = X_Reply, + .RepType = X_GetDeviceButtonMapping, + .sequenceNumber = client->sequence, + .nElts = b->numButtons, + .length = bytes_to_int32(b->numButtons), + }; + WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep); WriteToClient(client, rep.nElts, &b->map[1]); return Success; diff --git a/Xi/getdctl.c b/Xi/getdctl.c index cd17d13fc..ba5097575 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -170,7 +170,6 @@ ProcXGetDeviceControl(ClientPtr client) int rc, total_length = 0; char *savbuf; DeviceIntPtr dev; - xGetDeviceControlReply rep; REQUEST(xGetDeviceControlReq); REQUEST_SIZE_MATCH(xGetDeviceControlReq); @@ -179,13 +178,6 @@ ProcXGetDeviceControl(ClientPtr client) if (rc != Success) return rc; - rep = (xGetDeviceControlReply) { - .repType = X_Reply, - .RepType = X_GetDeviceControl, - .sequenceNumber = client->sequence, - .length = 0 - }; - switch (stuff->control) { case DEVICE_RESOLUTION: if (!dev->valuator) @@ -225,7 +217,13 @@ ProcXGetDeviceControl(ClientPtr client) 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); WriteToClient(client, total_length, savbuf); free(savbuf); diff --git a/Xi/getfctl.c b/Xi/getfctl.c index be0456c18..f39a481fc 100644 --- a/Xi/getfctl.c +++ b/Xi/getfctl.c @@ -269,7 +269,6 @@ ProcXGetFeedbackControl(ClientPtr client) StringFeedbackPtr s; BellFeedbackPtr b; LedFeedbackPtr l; - xGetFeedbackControlReply rep; REQUEST(xGetFeedbackControlReq); REQUEST_SIZE_MATCH(xGetFeedbackControlReq); @@ -278,7 +277,7 @@ ProcXGetFeedbackControl(ClientPtr client) if (rc != Success) return rc; - rep = (xGetFeedbackControlReply) { + xGetFeedbackControlReply rep = { .repType = X_Reply, .RepType = X_GetFeedbackControl, .sequenceNumber = client->sequence, diff --git a/Xi/getfocus.c b/Xi/getfocus.c index 731896b7d..e63239ff3 100644 --- a/Xi/getfocus.c +++ b/Xi/getfocus.c @@ -71,7 +71,6 @@ ProcXGetDeviceFocus(ClientPtr client) { DeviceIntPtr dev; FocusClassPtr focus; - xGetDeviceFocusReply rep; int rc; REQUEST(xGetDeviceFocusReq); @@ -83,7 +82,7 @@ ProcXGetDeviceFocus(ClientPtr client) if (!dev->focus) return BadDevice; - rep = (xGetDeviceFocusReply) { + xGetDeviceFocusReply rep = { .repType = X_Reply, .RepType = X_GetDeviceFocus, .sequenceNumber = client->sequence, diff --git a/Xi/getkmap.c b/Xi/getkmap.c index 5d9cba1d5..b740450aa 100644 --- a/Xi/getkmap.c +++ b/Xi/getkmap.c @@ -71,7 +71,6 @@ SOFTWARE. int ProcXGetDeviceKeyMapping(ClientPtr client) { - xGetDeviceKeyMappingReply rep; DeviceIntPtr dev; XkbDescPtr xkb; KeySymsPtr syms; @@ -102,7 +101,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client) if (!syms) return BadAlloc; - rep = (xGetDeviceKeyMappingReply) { + xGetDeviceKeyMappingReply rep = { .repType = X_Reply, .RepType = X_GetDeviceKeyMapping, .sequenceNumber = client->sequence, diff --git a/Xi/getmmap.c b/Xi/getmmap.c index 4ff03a3bd..ac75e83a5 100644 --- a/Xi/getmmap.c +++ b/Xi/getmmap.c @@ -69,7 +69,6 @@ int ProcXGetDeviceModifierMapping(ClientPtr client) { DeviceIntPtr dev; - xGetDeviceModifierMappingReply rep; KeyCode *modkeymap = NULL; int ret, max_keys_per_mod; @@ -84,7 +83,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client) if (ret != Success) return ret; - rep = (xGetDeviceModifierMappingReply) { + xGetDeviceModifierMappingReply rep = { .repType = X_Reply, .RepType = X_GetDeviceModifierMapping, .sequenceNumber = client->sequence, diff --git a/Xi/getprop.c b/Xi/getprop.c index 54b8131ec..cf0ef3f04 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -94,13 +94,12 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) int i, rc; XEventClass *buf = NULL, *tbuf; WindowPtr pWin; - xGetDeviceDontPropagateListReply rep; OtherInputMasks *others; REQUEST(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); - rep = (xGetDeviceDontPropagateListReply) { + xGetDeviceDontPropagateListReply rep = { .repType = X_Reply, .RepType = X_GetDeviceDontPropagateList, .sequenceNumber = client->sequence, diff --git a/Xi/getselev.c b/Xi/getselev.c index 237198c11..383ab60c3 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -90,7 +90,6 @@ int ProcXGetSelectedExtensionEvents(ClientPtr client) { int i, rc, total_length = 0; - xGetSelectedExtensionEventsReply rep; WindowPtr pWin; XEventClass *buf = NULL; XEventClass *tclient; @@ -101,7 +100,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) REQUEST(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); - rep = (xGetSelectedExtensionEventsReply) { + xGetSelectedExtensionEventsReply rep = { .repType = X_Reply, .RepType = X_GetSelectedExtensionEvents, .sequenceNumber = client->sequence, diff --git a/Xi/getvers.c b/Xi/getvers.c index 0d90fc9a8..47c27e673 100644 --- a/Xi/getvers.c +++ b/Xi/getvers.c @@ -86,8 +86,6 @@ SProcXGetExtensionVersion(ClientPtr client) int ProcXGetExtensionVersion(ClientPtr client) { - xGetExtensionVersionReply rep; - REQUEST(xGetExtensionVersionReq); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); @@ -95,7 +93,7 @@ ProcXGetExtensionVersion(ClientPtr client) stuff->nbytes)) return BadLength; - rep = (xGetExtensionVersionReply) { + xGetExtensionVersionReply rep = { .repType = X_Reply, .RepType = X_GetExtensionVersion, .sequenceNumber = client->sequence, diff --git a/Xi/grabdev.c b/Xi/grabdev.c index 05f1f39f5..2c2a39c72 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -100,7 +100,6 @@ int ProcXGrabDevice(ClientPtr client) { int rc; - xGrabDeviceReply rep; DeviceIntPtr dev; GrabMask mask; struct tmask tmp[EMASKSIZE]; @@ -112,7 +111,7 @@ ProcXGrabDevice(ClientPtr client) bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; - rep = (xGrabDeviceReply) { + xGrabDeviceReply rep = { .repType = X_Reply, .RepType = X_GrabDevice, .sequenceNumber = client->sequence, diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 41d68ec87..eb57a8c6e 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -87,7 +87,6 @@ int ProcXGetDeviceMotionEvents(ClientPtr client) { INT32 *coords = NULL, *bufptr; - xGetDeviceMotionEventsReply rep; unsigned long i; int rc, num_events, axes, size = 0; unsigned long nEvents; @@ -97,8 +96,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client) ValuatorClassPtr v; REQUEST(xGetDeviceMotionEventsReq); - REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); + rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); if (rc != Success) return rc; @@ -108,7 +107,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client) if (dev->valuator->motionHintWindow) MaybeStopDeviceHint(dev, client); axes = v->numAxes; - rep = (xGetDeviceMotionEventsReply) { + + xGetDeviceMotionEventsReply rep = { .repType = X_Reply, .RepType = X_GetDeviceMotionEvents, .sequenceNumber = client->sequence, @@ -117,6 +117,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) .axes = axes, .mode = Absolute /* XXX we don't do relative at the moment */ }; + start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); if (CompareTimeStamps(start, stop) == LATER || diff --git a/Xi/listdev.c b/Xi/listdev.c index 04eea73de..f989b8506 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -316,7 +316,6 @@ ShouldSkipDevice(ClientPtr client, DeviceIntPtr d) int ProcXListInputDevices(ClientPtr client) { - xListInputDevicesReply rep; int numdevs = 0; int namesize = 1; /* need 1 extra byte for strcpy */ int i = 0, size = 0; @@ -328,7 +327,7 @@ ProcXListInputDevices(ClientPtr client) REQUEST_SIZE_MATCH(xListInputDevicesReq); - rep = (xListInputDevicesReply) { + xListInputDevicesReply rep = { .repType = X_Reply, .RepType = X_ListInputDevices, .sequenceNumber = client->sequence, diff --git a/Xi/opendev.c b/Xi/opendev.c index 39fcddc8d..f768b997d 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -79,7 +79,6 @@ ProcXOpenDevice(ClientPtr client) xInputClassInfo evbase[numInputClasses]; int j = 0; int status = Success; - xOpenDeviceReply rep; DeviceIntPtr dev; REQUEST(xOpenDeviceReq); @@ -130,7 +129,8 @@ ProcXOpenDevice(ClientPtr client) } evbase[j].class = OtherClass; evbase[j++].event_type_base = event_base[OtherClass]; - rep = (xOpenDeviceReply) { + + xOpenDeviceReply rep = { .repType = X_Reply, .RepType = X_OpenDevice, .sequenceNumber = client->sequence, diff --git a/Xi/queryst.c b/Xi/queryst.c index ca386f5dc..addc659c9 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -66,7 +66,6 @@ ProcXQueryDeviceState(ClientPtr client) xButtonState *tb; ValuatorClassPtr v; xValuatorState *tv; - xQueryDeviceStateReply rep; DeviceIntPtr dev; double *values; @@ -144,7 +143,7 @@ ProcXQueryDeviceState(ClientPtr client) } } - rep = (xQueryDeviceStateReply) { + xQueryDeviceStateReply rep = { .repType = X_Reply, .RepType = X_QueryDeviceState, .sequenceNumber = client->sequence, diff --git a/Xi/setbmap.c b/Xi/setbmap.c index 4afa655fa..61befcf1c 100644 --- a/Xi/setbmap.c +++ b/Xi/setbmap.c @@ -72,7 +72,6 @@ int ProcXSetDeviceButtonMapping(ClientPtr client) { int ret; - xSetDeviceButtonMappingReply rep; DeviceIntPtr dev; REQUEST(xSetDeviceButtonMappingReq); @@ -86,7 +85,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client) if (ret != Success) return ret; - rep = (xSetDeviceButtonMappingReply) { + xSetDeviceButtonMappingReply rep = { .repType = X_Reply, .RepType = X_SetDeviceButtonMapping, .sequenceNumber = client->sequence, diff --git a/Xi/setdval.c b/Xi/setdval.c index 9092c0fe1..3419fd99d 100644 --- a/Xi/setdval.c +++ b/Xi/setdval.c @@ -73,13 +73,12 @@ int ProcXSetDeviceValuators(ClientPtr client) { DeviceIntPtr dev; - xSetDeviceValuatorsReply rep; int rc; REQUEST(xSetDeviceValuatorsReq); REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq); - rep = (xSetDeviceValuatorsReply) { + xSetDeviceValuatorsReply rep = { .repType = X_Reply, .RepType = X_SetDeviceValuators, .sequenceNumber = client->sequence, diff --git a/Xi/setmmap.c b/Xi/setmmap.c index 84956409f..fb7e1315a 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -73,7 +73,6 @@ int ProcXSetDeviceModifierMapping(ClientPtr client) { int ret; - xSetDeviceModifierMappingReply rep; DeviceIntPtr dev; REQUEST(xSetDeviceModifierMappingReq); @@ -83,13 +82,6 @@ ProcXSetDeviceModifierMapping(ClientPtr client) (stuff->numKeyPerModifier << 1)) return BadLength; - rep = (xSetDeviceModifierMappingReply) { - .repType = X_Reply, - .RepType = X_SetDeviceModifierMapping, - .sequenceNumber = client->sequence, - .length = 0 - }; - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) return ret; @@ -99,6 +91,13 @@ ProcXSetDeviceModifierMapping(ClientPtr client) if (ret == Success) ret = MappingSuccess; + xSetDeviceModifierMappingReply rep = { + .repType = X_Reply, + .RepType = X_SetDeviceModifierMapping, + .sequenceNumber = client->sequence, + .length = 0 + }; + if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) { rep.success = ret; WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply), diff --git a/Xi/setmode.c b/Xi/setmode.c index 9d0af9869..c8e70a556 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -73,13 +73,12 @@ int ProcXSetDeviceMode(ClientPtr client) { DeviceIntPtr dev; - xSetDeviceModeReply rep; int rc; REQUEST(xSetDeviceModeReq); REQUEST_SIZE_MATCH(xSetDeviceModeReq); - rep = (xSetDeviceModeReply) { + xSetDeviceModeReply rep = { .repType = X_Reply, .RepType = X_SetDeviceMode, .sequenceNumber = client->sequence, diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c index cb633d5cb..c047ab7d1 100644 --- a/Xi/xigetclientpointer.c +++ b/Xi/xigetclientpointer.c @@ -61,7 +61,6 @@ ProcXIGetClientPointer(ClientPtr client) { int rc; ClientPtr winclient; - xXIGetClientPointerReply rep; REQUEST(xXIGetClientPointerReq); REQUEST_SIZE_MATCH(xXIGetClientPointerReq); @@ -75,7 +74,7 @@ ProcXIGetClientPointer(ClientPtr client) else winclient = client; - rep = (xXIGetClientPointerReply) { + xXIGetClientPointerReply rep = { .repType = X_Reply, .RepType = X_XIGetClientPointer, .sequenceNumber = client->sequence, diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 39607c141..fca8b1f44 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -67,7 +67,6 @@ int ProcXIGrabDevice(ClientPtr client) { DeviceIntPtr dev; - xXIGrabDeviceReply rep; int ret = Success; uint8_t status; GrabMask mask = { 0 }; @@ -123,7 +122,7 @@ ProcXIGrabDevice(ClientPtr client) if (ret != Success) return ret; - rep = (xXIGrabDeviceReply) { + xXIGrabDeviceReply rep = { .repType = X_Reply, .RepType = X_XIGrabDevice, .sequenceNumber = client->sequence, diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index bd9979884..d3c90e166 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -849,7 +849,6 @@ int ProcXListDeviceProperties(ClientPtr client) { Atom *atoms; - xListDevicePropertiesReply rep; int natoms; DeviceIntPtr dev; int rc = Success; @@ -865,7 +864,7 @@ ProcXListDeviceProperties(ClientPtr client) if (rc != Success) return rc; - rep = (xListDevicePropertiesReply) { + xListDevicePropertiesReply rep = { .repType = X_Reply, .RepType = X_ListDeviceProperties, .sequenceNumber = client->sequence, @@ -946,7 +945,6 @@ ProcXGetDeviceProperty(ClientPtr client) int rc, format, nitems, bytes_after; char *data; Atom type; - xGetDevicePropertyReply reply; REQUEST_SIZE_MATCH(xGetDevicePropertyReq); if (stuff->delete) @@ -963,7 +961,7 @@ ProcXGetDeviceProperty(ClientPtr client) if (rc != Success) return rc; - reply = (xGetDevicePropertyReply) { + xGetDevicePropertyReply rep = { .repType = X_Reply, .RepType = X_GetDeviceProperty, .sequenceNumber = client->sequence, @@ -975,13 +973,13 @@ ProcXGetDeviceProperty(ClientPtr client) .deviceid = dev->id }; - if (stuff->delete && (reply.bytesAfter == 0)) + if (stuff->delete && (rep.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); - WriteReplyToClient(client, sizeof(xGenericReply), &reply); + WriteReplyToClient(client, sizeof(xGenericReply), &rep); if (length) { - switch (reply.format) { + switch (rep.format) { case 32: client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; break; @@ -996,7 +994,7 @@ ProcXGetDeviceProperty(ClientPtr client) } /* delete the Property */ - if (stuff->delete && (reply.bytesAfter == 0)) { + if (stuff->delete && (rep.bytesAfter == 0)) { XIPropertyPtr prop, *prev; for (prev = &dev->properties.properties; (prop = *prev); @@ -1077,7 +1075,6 @@ int ProcXIListProperties(ClientPtr client) { Atom *atoms; - xXIListPropertiesReply rep; int natoms; DeviceIntPtr dev; int rc = Success; @@ -1093,7 +1090,7 @@ ProcXIListProperties(ClientPtr client) if (rc != Success) return rc; - rep = (xXIListPropertiesReply) { + xXIListPropertiesReply rep = { .repType = X_Reply, .RepType = X_XIListProperties, .sequenceNumber = client->sequence, @@ -1171,7 +1168,6 @@ ProcXIGetProperty(ClientPtr client) { REQUEST(xXIGetPropertyReq); DeviceIntPtr dev; - xXIGetPropertyReply reply; int length; int rc, format, nitems, bytes_after; char *data; @@ -1192,7 +1188,7 @@ ProcXIGetProperty(ClientPtr client) if (rc != Success) return rc; - reply = (xXIGetPropertyReply) { + xXIGetPropertyReply rep = { .repType = X_Reply, .RepType = X_XIGetProperty, .sequenceNumber = client->sequence, @@ -1203,13 +1199,13 @@ ProcXIGetProperty(ClientPtr client) .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); - WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &reply); + WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &rep); if (length) { - switch (reply.format) { + switch (rep.format) { case 32: client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; break; @@ -1224,7 +1220,7 @@ ProcXIGetProperty(ClientPtr client) } /* delete the Property */ - if (stuff->delete && (reply.bytes_after == 0)) { + if (stuff->delete && (rep.bytes_after == 0)) { XIPropertyPtr prop, *prev; for (prev = &dev->properties.properties; (prop = *prev); diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index ba0ef7ff9..43b93b8c9 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -67,7 +67,6 @@ SProcXIQueryDevice(ClientPtr client) int ProcXIQueryDevice(ClientPtr client) { - xXIQueryDeviceReply rep; DeviceIntPtr dev = NULL; int rc = Success; int i = 0, len = 0; @@ -110,7 +109,7 @@ ProcXIQueryDevice(ClientPtr client) return BadAlloc; } - rep = (xXIQueryDeviceReply) { + xXIQueryDeviceReply rep = { .repType = X_Reply, .RepType = X_XIQueryDevice, .sequenceNumber = client->sequence, diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 9466271fe..0451692ca 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -77,7 +77,6 @@ int ProcXIQueryPointer(ClientPtr client) { int rc; - xXIQueryPointerReply rep; DeviceIntPtr pDev, kbd; WindowPtr pWin, t; SpritePtr pSprite; @@ -127,7 +126,7 @@ ProcXIQueryPointer(ClientPtr client) pSprite = pDev->spriteInfo->sprite; - rep = (xXIQueryPointerReply) { + xXIQueryPointerReply rep = { .repType = X_Reply, .RepType = X_XIQueryPointer, .sequenceNumber = client->sequence, diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c index b2055f010..c897c2ee1 100644 --- a/Xi/xiqueryversion.c +++ b/Xi/xiqueryversion.c @@ -54,7 +54,6 @@ extern XExtensionVersion XIVersion; /* defined in getvers.c */ int ProcXIQueryVersion(ClientPtr client) { - xXIQueryVersionReply rep; XIClientPtr pXIClient; int major, minor; @@ -113,7 +112,7 @@ ProcXIQueryVersion(ClientPtr client) pXIClient->minor_version = minor; } - rep = (xXIQueryVersionReply) { + xXIQueryVersionReply rep = { .repType = X_Reply, .RepType = X_XIQueryVersion, .sequenceNumber = client->sequence, diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 80dbf6857..43b78cee1 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -343,7 +343,6 @@ ProcXIGetSelectedEvents(ClientPtr client) int rc, i; WindowPtr win; char *buffer = NULL; - xXIGetSelectedEventsReply reply; OtherInputMasks *masks; InputClientsPtr others = NULL; xXIEventMask *evmask = NULL; @@ -357,7 +356,7 @@ ProcXIGetSelectedEvents(ClientPtr client) if (rc != Success) return rc; - reply = (xXIGetSelectedEventsReply) { + xXIGetSelectedEventsReply rep = { .repType = X_Reply, .RepType = X_XIGetSelectedEvents, .sequenceNumber = client->sequence, @@ -376,7 +375,7 @@ ProcXIGetSelectedEvents(ClientPtr client) } if (!others) { - WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); + WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &rep); return Success; } @@ -402,8 +401,8 @@ ProcXIGetSelectedEvents(ClientPtr client) evmask->deviceid = i; evmask->mask_len = mask_len; - reply.num_masks++; - reply.length += sizeof(xXIEventMask) / 4 + evmask->mask_len; + rep.num_masks++; + rep.length += sizeof(xXIEventMask) / 4 + evmask->mask_len; if (client->swapped) { swaps(&evmask->deviceid); @@ -419,10 +418,10 @@ ProcXIGetSelectedEvents(ClientPtr client) } /* save the value before SRepXIGetSelectedEvents swaps it */ - length = reply.length; - WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); + length = rep.length; + WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &rep); - if (reply.num_masks) + if (rep.num_masks) WriteToClient(client, length * 4, buffer); free(buffer); diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c index bf2103fdc..0a9ea528a 100644 --- a/Xi/xisetdevfocus.c +++ b/Xi/xisetdevfocus.c @@ -86,7 +86,6 @@ ProcXISetFocus(ClientPtr client) int ProcXIGetFocus(ClientPtr client) { - xXIGetFocusReply rep; DeviceIntPtr dev; int ret; @@ -99,7 +98,7 @@ ProcXIGetFocus(ClientPtr client) if (!dev->focus) return BadDevice; - rep = (xXIGetFocusReply) { + xXIGetFocusReply rep = { .repType = X_Reply, .RepType = X_XIGetFocus, .sequenceNumber = client->sequence,