summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:44 -0700
committerKeith Packard <keithp@keithp.com>2012-07-09 22:52:30 -0700
commit9805cedf7b0f76d3b75f94e956c4cc2dcf0d8b64 (patch)
tree466df72bc6e3fdad5a0a682a480af6905bd02780 /Xi
parent0af79b124e1317c36d1613d28755c5a8ce612e2a (diff)
Use C99 designated initializers in extension Events
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/chgdctl.c13
-rw-r--r--Xi/grabdevb.c15
-rw-r--r--Xi/grabdevk.c15
-rw-r--r--Xi/xiproperty.c39
4 files changed, 41 insertions, 41 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index caef0bf54..9fe69a5ad 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -113,7 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client)
AxisInfoPtr a;
CARD32 *resolution;
xDeviceEnableCtl *e;
- devicePresenceNotify dpn;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
@@ -211,11 +210,13 @@ ProcXChangeDeviceControl(ClientPtr client)
out:
if (ret == Success) {
- dpn.type = DevicePresenceNotify;
- dpn.time = currentTime.milliseconds;
- dpn.devchange = DeviceControlChanged;
- dpn.deviceid = dev->id;
- dpn.control = stuff->control;
+ devicePresenceNotify dpn = {
+ .type = DevicePresenceNotify,
+ .time = currentTime.milliseconds,
+ .devchange = DeviceControlChanged,
+ .deviceid = dev->id,
+ .control = stuff->control
+ };
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
(xEvent *) &dpn, 1);
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index 0f0e975a0..8b4ae698e 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -137,13 +137,14 @@ ProcXGrabDeviceButton(ClientPtr client)
X_GrabDeviceButton)) != Success)
return ret;
- memset(&param, 0, sizeof(param));
- param.grabtype = XI;
- param.ownerEvents = stuff->ownerEvents;
- param.this_device_mode = stuff->this_device_mode;
- param.other_devices_mode = stuff->other_devices_mode;
- param.grabWindow = stuff->grabWindow;
- param.modifiers = stuff->modifiers;
+ param = (GrabParameters) {
+ .grabtype = XI,
+ .ownerEvents = stuff->ownerEvents,
+ .this_device_mode = stuff->this_device_mode,
+ .other_devices_mode = stuff->other_devices_mode,
+ .grabWindow = stuff->grabWindow,
+ .modifiers = stuff->modifiers
+ };
mask.xi = tmp[stuff->grabbed_device].mask;
ret = GrabButton(client, dev, mdev, stuff->button, &param, XI, &mask);
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index b75518211..8694f9e6d 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.c
@@ -135,13 +135,14 @@ ProcXGrabDeviceKey(ClientPtr client)
X_GrabDeviceKey)) != Success)
return ret;
- memset(&param, 0, sizeof(param));
- param.grabtype = XI;
- param.ownerEvents = stuff->ownerEvents;
- param.this_device_mode = stuff->this_device_mode;
- param.other_devices_mode = stuff->other_devices_mode;
- param.grabWindow = stuff->grabWindow;
- param.modifiers = stuff->modifiers;
+ param = (GrabParameters) {
+ .grabtype = XI,
+ .ownerEvents = stuff->ownerEvents,
+ .this_device_mode = stuff->this_device_mode,
+ .other_devices_mode = stuff->other_devices_mode,
+ .grabWindow = stuff->grabWindow,
+ .modifiers = stuff->modifiers
+ };
mask.xi = tmp[stuff->grabbed_device].mask;
ret = GrabKey(client, dev, mdev, stuff->key, &param, XI, &mask);
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 51a36d41a..ca731042c 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -182,30 +182,27 @@ static long XIPropHandlerID = 1;
static void
send_property_event(DeviceIntPtr dev, Atom property, int what)
{
- devicePropertyNotify event;
- xXIPropertyEvent xi2;
- int state;
-
- if (what == XIPropertyDeleted)
- state = PropertyDelete;
- else
- state = PropertyNewValue;
+ int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue;
+ devicePropertyNotify event = {
+ .type = DevicePropertyNotify,
+ .deviceid = dev->id,
+ .state = state,
+ .atom = property,
+ .time = currentTime.milliseconds
+ };
+ xXIPropertyEvent xi2 = {
+ .type = GenericEvent,
+ .extension = IReqCode,
+ .length = 0,
+ .evtype = XI_PropertyEvent,
+ .deviceid = dev->id,
+ .time = currentTime.milliseconds,
+ .property = property,
+ .what = what
+ };
- event.type = DevicePropertyNotify;
- event.deviceid = dev->id;
- event.state = state;
- event.atom = property;
- event.time = currentTime.milliseconds;
SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1);
- xi2.type = GenericEvent;
- xi2.extension = IReqCode;
- xi2.length = 0;
- xi2.evtype = XI_PropertyEvent;
- xi2.deviceid = dev->id;
- xi2.time = currentTime.milliseconds;
- xi2.property = property;
- xi2.what = what;
SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2),
(xEvent *) &xi2, 1);
}