summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
Diffstat (limited to 'Xi')
-rw-r--r--Xi/allowev.c6
-rw-r--r--Xi/chgdctl.c15
-rw-r--r--Xi/chgfctl.c52
-rw-r--r--Xi/chgkbd.c4
-rw-r--r--Xi/chgkmap.c3
-rw-r--r--Xi/chgprop.c8
-rw-r--r--Xi/chgptr.c4
-rw-r--r--Xi/closedev.c4
-rw-r--r--Xi/devbell.c4
-rw-r--r--Xi/extinit.c238
-rw-r--r--Xi/getbmap.c10
-rw-r--r--Xi/getdctl.c35
-rw-r--r--Xi/getfctl.c64
-rw-r--r--Xi/getfocus.c14
-rw-r--r--Xi/getkmap.c10
-rw-r--r--Xi/getmmap.c10
-rw-r--r--Xi/getprop.c14
-rw-r--r--Xi/getselev.c16
-rw-r--r--Xi/getvers.c16
-rw-r--r--Xi/grabdev.c16
-rw-r--r--Xi/grabdevb.c10
-rw-r--r--Xi/grabdevk.c10
-rw-r--r--Xi/gtmotion.c20
-rw-r--r--Xi/listdev.c28
-rw-r--r--Xi/opendev.c10
-rw-r--r--Xi/queryst.c13
-rw-r--r--Xi/selectev.c8
-rw-r--r--Xi/sendexev.c7
-rw-r--r--Xi/setbmap.c10
-rw-r--r--Xi/setdval.c10
-rw-r--r--Xi/setfocus.c8
-rw-r--r--Xi/setmmap.c10
-rw-r--r--Xi/setmode.c10
-rw-r--r--Xi/ungrdev.c6
-rw-r--r--Xi/ungrdevb.c8
-rw-r--r--Xi/ungrdevk.c8
-rw-r--r--Xi/xiallowev.c8
-rw-r--r--Xi/xichangecursor.c10
-rw-r--r--Xi/xichangehierarchy.c11
-rw-r--r--Xi/xigetclientpointer.c12
-rw-r--r--Xi/xigrabdev.c28
-rw-r--r--Xi/xipassivegrab.c47
-rw-r--r--Xi/xiproperty.c102
-rw-r--r--Xi/xiquerydevice.c66
-rw-r--r--Xi/xiquerypointer.c28
-rw-r--r--Xi/xiqueryversion.c17
-rw-r--r--Xi/xiselectev.c30
-rw-r--r--Xi/xisetclientpointer.c8
-rw-r--r--Xi/xisetdevfocus.c23
-rw-r--r--Xi/xiwarppointer.c22
50 files changed, 457 insertions, 674 deletions
diff --git a/Xi/allowev.c b/Xi/allowev.c
index 96f3b543c..ff9e667b0 100644
--- a/Xi/allowev.c
+++ b/Xi/allowev.c
@@ -72,12 +72,10 @@ SOFTWARE.
int
SProcXAllowDeviceEvents(ClientPtr client)
{
- char n;
-
REQUEST(xAllowDeviceEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
- swapl(&stuff->time, n);
+ swapl(&stuff->time);
return (ProcXAllowDeviceEvents(client));
}
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index 4c4aebac6..ca697d9d8 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -74,16 +74,15 @@ SOFTWARE.
int
SProcXChangeDeviceControl(ClientPtr client)
{
- char n;
xDeviceCtl *ctl;
REQUEST(xChangeDeviceControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
- swaps(&stuff->control, n);
+ swaps(&stuff->control);
ctl = (xDeviceCtl*)&stuff[1];
- swaps(&ctl->control, n);
- swaps(&ctl->length, n);
+ swaps(&ctl->control);
+ swaps(&ctl->length);
switch(stuff->control) {
case DEVICE_ABS_CALIB:
case DEVICE_ABS_AREA:
@@ -230,9 +229,7 @@ void
SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index 9189702c1..f818cd0ce 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -74,12 +74,10 @@ SOFTWARE.
int
SProcXChangeFeedbackControl(ClientPtr client)
{
- char n;
-
REQUEST(xChangeFeedbackControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
- swapl(&stuff->mask, n);
+ swapl(&stuff->mask);
return (ProcXChangeFeedbackControl(client));
}
@@ -93,17 +91,16 @@ static int
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
{
- char n;
KeybdCtrl kctrl;
int t;
int key = DO_ALL;
if (client->swapped) {
- swaps(&f->length, n);
- swaps(&f->pitch, n);
- swaps(&f->duration, n);
- swapl(&f->led_mask, n);
- swapl(&f->led_values, n);
+ swaps(&f->length);
+ swaps(&f->pitch);
+ swaps(&f->duration);
+ swapl(&f->led_mask);
+ swapl(&f->led_values);
}
kctrl = k->ctrl;
@@ -210,14 +207,13 @@ static int
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
{
- char n;
PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) {
- swaps(&f->length, n);
- swaps(&f->num, n);
- swaps(&f->denom, n);
- swaps(&f->thresh, n);
+ swaps(&f->length);
+ swaps(&f->num);
+ swaps(&f->denom);
+ swaps(&f->thresh);
}
pctrl = p->ctrl;
@@ -276,11 +272,9 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
{
- char n;
-
if (client->swapped) {
- swaps(&f->length, n);
- swapl(&f->int_to_display, n);
+ swaps(&f->length);
+ swapl(&f->int_to_display);
}
i->ctrl.integer_displayed = f->int_to_display;
@@ -299,13 +293,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, StringFeedbackPtr s,
xStringFeedbackCtl * f)
{
- char n;
int i, j;
KeySym *syms, *sup_syms;
syms = (KeySym *) (f + 1);
if (client->swapped) {
- swaps(&f->length, n); /* swapped num_keysyms in calling proc */
+ swaps(&f->length); /* swapped num_keysyms in calling proc */
SwapLongs((CARD32 *) syms, f->num_keysyms);
}
@@ -339,14 +332,13 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, BellFeedbackPtr b,
xBellFeedbackCtl * f)
{
- char n;
int t;
BellCtrl bctrl; /* might get BadValue part way through */
if (client->swapped) {
- swaps(&f->length, n);
- swaps(&f->pitch, n);
- swaps(&f->duration, n);
+ swaps(&f->length);
+ swaps(&f->pitch);
+ swaps(&f->duration);
}
bctrl = b->ctrl;
@@ -397,13 +389,12 @@ static int
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
LedFeedbackPtr l, xLedFeedbackCtl * f)
{
- char n;
LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) {
- swaps(&f->length, n);
- swapl(&f->led_values, n);
- swapl(&f->led_mask, n);
+ swaps(&f->length);
+ swapl(&f->led_values);
+ swapl(&f->led_mask);
}
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
@@ -467,11 +458,10 @@ ProcXChangeFeedbackControl(ClientPtr client)
break;
case StringFeedbackClass:
{
- char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
if (client->swapped) {
- swaps(&f->num_keysyms, n);
+ swaps(&f->num_keysyms);
}
if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
return BadLength;
diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c
index f9fd09902..d8139193f 100644
--- a/Xi/chgkbd.c
+++ b/Xi/chgkbd.c
@@ -75,10 +75,8 @@ SOFTWARE.
int
SProcXChangeKeyboardDevice(ClientPtr client)
{
- char n;
-
REQUEST(xChangeKeyboardDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return (ProcXChangeKeyboardDevice(client));
}
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
index e4b9e154c..32caa2d02 100644
--- a/Xi/chgkmap.c
+++ b/Xi/chgkmap.c
@@ -72,11 +72,10 @@ SOFTWARE.
int
SProcXChangeDeviceKeyMapping(ClientPtr client)
{
- char n;
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
diff --git a/Xi/chgprop.c b/Xi/chgprop.c
index d24a24638..a9f833c25 100644
--- a/Xi/chgprop.c
+++ b/Xi/chgprop.c
@@ -74,13 +74,11 @@ SOFTWARE.
int
SProcXChangeDeviceDontPropagateList(ClientPtr client)
{
- char n;
-
REQUEST(xChangeDeviceDontPropagateListReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
- swapl(&stuff->window, n);
- swaps(&stuff->count, n);
+ swapl(&stuff->window);
+ swaps(&stuff->count);
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
diff --git a/Xi/chgptr.c b/Xi/chgptr.c
index 6a4fbc342..ee04ab662 100644
--- a/Xi/chgptr.c
+++ b/Xi/chgptr.c
@@ -77,10 +77,8 @@ SOFTWARE.
int
SProcXChangePointerDevice(ClientPtr client)
{
- char n;
-
REQUEST(xChangePointerDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
return (ProcXChangePointerDevice(client));
}
diff --git a/Xi/closedev.c b/Xi/closedev.c
index 1064be67b..54ada55f5 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -73,10 +73,8 @@ SOFTWARE.
int
SProcXCloseDevice(ClientPtr client)
{
- char n;
-
REQUEST(xCloseDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
return (ProcXCloseDevice(client));
}
diff --git a/Xi/devbell.c b/Xi/devbell.c
index 539da1814..881524260 100644
--- a/Xi/devbell.c
+++ b/Xi/devbell.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXDeviceBell(ClientPtr client)
{
- char n;
-
REQUEST(xDeviceBellReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXDeviceBell(client));
}
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 0905e1877..7724f5f5a 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -533,43 +533,39 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
static void
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
{
- char n;
int i;
INT32 *ip B32;
*to = *from;
- swaps(&to->sequenceNumber, n);
- swaps(&to->device_state, n);
+ swaps(&to->sequenceNumber);
+ swaps(&to->device_state);
ip = &to->valuator0;
for (i = 0; i < 6; i++) {
- swapl((ip + i), n); /* macro - braces are required */
+ swapl(ip + i);
}
}
static void
SEventFocus(deviceFocus * from, deviceFocus * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
- swapl(&to->window, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
+ swapl(&to->window);
}
static void
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
{
int i;
- char n;
INT32 *ip B32;
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
ip = &to->valuator0;
for (i = 0; i < 3; i++) {
- swapl((ip + i), n); /* macro - braces are required */
+ swapl(ip + i);
}
}
@@ -577,93 +573,78 @@ static void
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
deviceKeyStateNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
+ swaps(&to->sequenceNumber);
}
static void
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
deviceButtonStateNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
+ swaps(&to->sequenceNumber);
}
static void
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
}
static void
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
}
static void
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- swaps(&to->control, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
+ swaps(&to->control);
}
static void
SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- swapl(&to->atom, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
+ swapl(&to->atom);
}
static void
SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->root, n);
- swapl(&to->event, n);
- swapl(&to->child, n);
- swapl(&to->root_x, n);
- swapl(&to->root_y, n);
- swapl(&to->event_x, n);
- swapl(&to->event_y, n);
- swaps(&to->sourceid, n);
- swaps(&to->buttons_len, n);
- swapl(&to->mods.base_mods, n);
- swapl(&to->mods.latched_mods, n);
- swapl(&to->mods.locked_mods, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->root);
+ swapl(&to->event);
+ swapl(&to->child);
+ swapl(&to->root_x);
+ swapl(&to->root_y);
+ swapl(&to->event_x);
+ swapl(&to->event_y);
+ swaps(&to->sourceid);
+ swaps(&to->buttons_len);
+ swapl(&to->mods.base_mods);
+ swapl(&to->mods.latched_mods);
+ swapl(&to->mods.locked_mods);
}
static void
SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
{
- char n;
int i, j;
xXIAnyInfo *any;
@@ -682,8 +663,8 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
xXIKeyInfo *ki = (xXIKeyInfo*)any;
uint32_t *key = (uint32_t*)&ki[1];
for (j = 0; j < ki->num_keycodes; j++, key++)
- swapl(key, n);
- swaps(&ki->num_keycodes, n);
+ swapl(key);
+ swaps(&ki->num_keycodes);
}
break;
case ButtonClass:
@@ -692,71 +673,70 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
Atom *labels = (Atom*)((char*)bi + sizeof(xXIButtonInfo) +
pad_to_int32(bits_to_bytes(bi->num_buttons)));
for (j = 0; j < bi->num_buttons; j++)
- swapl(&labels[j], n);
- swaps(&bi->num_buttons, n);
+ swapl(&labels[j]);
+ swaps(&bi->num_buttons);
}
break;
case ValuatorClass:
{
xXIValuatorInfo* ai = (xXIValuatorInfo*)any;
- swapl(&ai->label, n);
- swapl(&ai->min.integral, n);
- swapl(&ai->min.frac, n);
- swapl(&ai->max.integral, n);
- swapl(&ai->max.frac, n);
- swapl(&ai->resolution, n);
- swaps(&ai->number, n);
+ swapl(&ai->label);
+ swapl(&ai->min.integral);
+ swapl(&ai->min.frac);
+ swapl(&ai->max.integral);
+ swapl(&ai->max.frac);
+ swapl(&ai->resolution);
+ swaps(&ai->number);
}
break;
}
- swaps(&any->type, n);
- swaps(&any->length, n);
- swaps(&any->sourceid, n);
+ swaps(&any->type);
+ swaps(&any->length);
+ swaps(&any->sourceid);
any = (xXIAnyInfo*)((char*)any + length * 4);
}
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swaps(&to->num_classes, n);
- swaps(&to->sourceid, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swaps(&to->num_classes);
+ swaps(&to->sourceid);
}
static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
{
int i;
- char n;
char *ptr;
char *vmask;
memcpy(to, from, sizeof(xEvent) + from->length * 4);
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->detail, n);
- swapl(&to->root, n);
- swapl(&to->event, n);
- swapl(&to->child, n);
- swapl(&to->root_x, n);
- swapl(&to->root_y, n);
- swapl(&to->event_x, n);
- swapl(&to->event_y, n);
- swaps(&to->buttons_len, n);
- swaps(&to->valuators_len, n);
- swaps(&to->sourceid, n);
- swapl(&to->mods.base_mods, n);
- swapl(&to->mods.latched_mods, n);
- swapl(&to->mods.locked_mods, n);
- swapl(&to->mods.effective_mods, n);
- swapl(&to->flags, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->detail);
+ swapl(&to->root);
+ swapl(&to->event);
+ swapl(&to->child);
+ swapl(&to->root_x);
+ swapl(&to->root_y);
+ swapl(&to->event_x);
+ swapl(&to->event_y);
+ swaps(&to->buttons_len);
+ swaps(&to->valuators_len);
+ swaps(&to->sourceid);
+ swapl(&to->mods.base_mods);
+ swapl(&to->mods.latched_mods);
+ swapl(&to->mods.locked_mods);
+ swapl(&to->mods.effective_mods);
+ swapl(&to->flags);
ptr = (char*)(&to[1]);
ptr += from->buttons_len * 4;
@@ -766,9 +746,9 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
{
if (BitIsOn(vmask, i))
{
- swapl(((uint32_t*)ptr), n);
+ swapl(((uint32_t *)ptr));
ptr += 4;
- swapl(((uint32_t*)ptr), n);
+ swapl(((uint32_t *)ptr));
ptr += 4;
}
}
@@ -778,55 +758,51 @@ static void SDeviceHierarchyEvent(xXIHierarchyEvent *from,
xXIHierarchyEvent *to)
{
int i;
- char n;
xXIHierarchyInfo *info;
*to = *from;
memcpy(&to[1], &from[1], from->length * 4);
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->flags, n);
- swaps(&to->num_info, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->flags);
+ swaps(&to->num_info);
info = (xXIHierarchyInfo*)&to[1];
for (i = 0; i< from->num_info; i++)
{
- swaps(&info->deviceid, n);
- swaps(&info->attachment, n);
+ swaps(&info->deviceid);
+ swaps(&info->attachment);
info++;
}
}
static void SXIPropertyEvent(xXIPropertyEvent *from, xXIPropertyEvent *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->property, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->property);
}
static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
{
- char n;
int i;
FP3232 *values;
unsigned char *mask;
memcpy(to, from, sizeof(xEvent) + from->length * 4);
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->detail, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->detail);
mask = (unsigned char*)&to[1];
@@ -841,16 +817,16 @@ static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
* they were in aAbBcC order because it's easier and really
* doesn't matter.
*/
- swapl(&values->integral, n);
- swapl(&values->frac, n);
+ swapl(&values->integral);
+ swapl(&values->frac);
values++;
- swapl(&values->integral, n);
- swapl(&values->frac, n);
+ swapl(&values->integral);
+ swapl(&values->frac);
values++;
}
}
- swaps(&to->valuators_len, n);
+ swaps(&to->valuators_len);
}
diff --git a/Xi/getbmap.c b/Xi/getbmap.c
index e2d58972a..b7054f7d2 100644
--- a/Xi/getbmap.c
+++ b/Xi/getbmap.c
@@ -70,10 +70,8 @@ SOFTWARE.
int
SProcXGetDeviceButtonMapping(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceButtonMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetDeviceButtonMapping(client));
}
@@ -126,9 +124,7 @@ void
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
xGetDeviceButtonMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
index 4e04b8b06..4287028db 100644
--- a/Xi/getdctl.c
+++ b/Xi/getdctl.c
@@ -71,12 +71,10 @@ SOFTWARE.
int
SProcXGetDeviceControl(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
- swaps(&stuff->control, n);
+ swaps(&stuff->control);
return (ProcXGetDeviceControl(client));
}
@@ -90,7 +88,6 @@ static void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
- char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
@@ -108,19 +105,18 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->max_resolution;
if (client->swapped) {
- swaps(&r->control, n);
- swaps(&r->length, n);
- swapl(&r->num_valuators, n);
+ swaps(&r->control);
+ swaps(&r->length);
+ swapl(&r->num_valuators);
iptr = (int *)buf;
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
- swapl(iptr, n);
+ swapl(iptr);
}
}
}
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
- char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
c->control = DEVICE_CORE;
@@ -129,15 +125,14 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
if (client->swapped) {
- swaps(&c->control, n);
- swaps(&c->length, n);
- swaps(&c->status, n);
+ swaps(&c->control);
+ swaps(&c->length);
+ swaps(&c->status);
}
}
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
- char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
e->control = DEVICE_ENABLE;
@@ -145,9 +140,9 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
e->enable = dev->enabled;
if (client->swapped) {
- swaps(&e->control, n);
- swaps(&e->length, n);
- swaps(&e->enable, n);
+ swaps(&e->control);
+ swaps(&e->length);
+ swaps(&e->enable);
}
}
@@ -161,10 +156,8 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
void
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getfctl.c b/Xi/getfctl.c
index 9563d63d6..ea80a879d 100644
--- a/Xi/getfctl.c
+++ b/Xi/getfctl.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXGetFeedbackControl(ClientPtr client)
{
- char n;
-
REQUEST(xGetFeedbackControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetFeedbackControl(client));
}
@@ -88,7 +86,6 @@ static void
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
{
int i;
- char n;
xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) * buf;
@@ -104,11 +101,11 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
for (i = 0; i < 32; i++)
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
if (client->swapped) {
- swaps(&k2->length, n);
- swaps(&k2->pitch, n);
- swaps(&k2->duration, n);
- swapl(&k2->led_mask, n);
- swapl(&k2->led_values, n);
+ swaps(&k2->length);
+ swaps(&k2->pitch);
+ swaps(&k2->duration);
+ swapl(&k2->led_mask);
+ swapl(&k2->led_values);
}
*buf += sizeof(xKbdFeedbackState);
}
@@ -122,7 +119,6 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
static void
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
{
- char n;
xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) * buf;
@@ -133,10 +129,10 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
p2->accelDenom = p->ctrl.den;
p2->threshold = p->ctrl.threshold;
if (client->swapped) {
- swaps(&p2->length, n);
- swaps(&p2->accelNum, n);
- swaps(&p2->accelDenom, n);
- swaps(&p2->threshold, n);
+ swaps(&p2->length);
+ swaps(&p2->accelNum);
+ swaps(&p2->accelDenom);
+ swaps(&p2->threshold);
}
*buf += sizeof(xPtrFeedbackState);
}
@@ -150,7 +146,6 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
static void
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
{
- char n;
xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) * buf;
@@ -161,10 +156,10 @@ CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
i2->min_value = i->ctrl.min_value;
i2->max_value = i->ctrl.max_value;
if (client->swapped) {
- swaps(&i2->length, n);
- swapl(&i2->resolution, n);
- swapl(&i2->min_value, n);
- swapl(&i2->max_value, n);
+ swaps(&i2->length);
+ swapl(&i2->resolution);
+ swapl(&i2->min_value);
+ swapl(&i2->max_value);
}
*buf += sizeof(xIntegerFeedbackState);
}
@@ -179,7 +174,6 @@ static void
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
{
int i;
- char n;
xStringFeedbackState *s2;
KeySym *kptr;
@@ -195,12 +189,12 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
*kptr++ = *(s->ctrl.symbols_supported + i);
if (client->swapped) {
- swaps(&s2->length, n);
- swaps(&s2->max_symbols, n);
- swaps(&s2->num_syms_supported, n);
+ swaps(&s2->length);
+ swaps(&s2->max_symbols);
+ swaps(&s2->num_syms_supported);
kptr = (KeySym *) (*buf);
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
- swapl(kptr, n);
+ swapl(kptr);
}
}
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
@@ -215,7 +209,6 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
static void
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
{
- char n;
xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) * buf;
@@ -225,9 +218,9 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
l2->led_values = l->ctrl.led_values;
l2->led_mask = l->ctrl.led_mask;
if (client->swapped) {
- swaps(&l2->length, n);
- swapl(&l2->led_values, n);
- swapl(&l2->led_mask, n);
+ swaps(&l2->length);
+ swapl(&l2->led_values);
+ swapl(&l2->led_mask);
}
*buf += sizeof(xLedFeedbackState);
}
@@ -241,7 +234,6 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
static void
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
{
- char n;
xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) * buf;
@@ -252,9 +244,9 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
b2->pitch = b->ctrl.pitch;
b2->duration = b->ctrl.duration;
if (client->swapped) {
- swaps(&b2->length, n);
- swaps(&b2->pitch, n);
- swaps(&b2->duration, n);
+ swaps(&b2->length);
+ swaps(&b2->pitch);
+ swaps(&b2->duration);
}
*buf += sizeof(xBellFeedbackState);
}
@@ -270,11 +262,9 @@ void
SRepXGetFeedbackControl(ClientPtr client, int size,
xGetFeedbackControlReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_feedbacks, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_feedbacks);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getfocus.c b/Xi/getfocus.c
index 69eadde87..676850df1 100644
--- a/Xi/getfocus.c
+++ b/Xi/getfocus.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXGetDeviceFocus(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceFocusReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetDeviceFocus(client));
}
@@ -133,11 +131,9 @@ ProcXGetDeviceFocus(ClientPtr client)
void
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->focus, n);
- swapl(&rep->time, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->focus);
+ swapl(&rep->time);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getkmap.c b/Xi/getkmap.c
index c38467b96..2501ec05a 100644
--- a/Xi/getkmap.c
+++ b/Xi/getkmap.c
@@ -74,10 +74,8 @@ SOFTWARE.
int
SProcXGetDeviceKeyMapping(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceKeyMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetDeviceKeyMapping(client));
}
@@ -150,9 +148,7 @@ void
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
xGetDeviceKeyMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getmmap.c b/Xi/getmmap.c
index bd652e9d4..4eee00679 100644
--- a/Xi/getmmap.c
+++ b/Xi/getmmap.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXGetDeviceModifierMapping(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceModifierMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetDeviceModifierMapping(client));
}
@@ -129,9 +127,7 @@ void
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
xGetDeviceModifierMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getprop.c b/Xi/getprop.c
index 5e102627d..11afd3784 100644
--- a/Xi/getprop.c
+++ b/Xi/getprop.c
@@ -75,12 +75,10 @@ extern int ExtEventIndex;
int
SProcXGetDeviceDontPropagateList(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceDontPropagateListReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
- swapl(&stuff->window, n);
+ swapl(&stuff->window);
return (ProcXGetDeviceDontPropagateList(client));
}
@@ -178,10 +176,8 @@ void
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->count, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->count);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getselev.c b/Xi/getselev.c
index 7304738b3..b316e2364 100644
--- a/Xi/getselev.c
+++ b/Xi/getselev.c
@@ -73,12 +73,10 @@ SOFTWARE.
int
SProcXGetSelectedExtensionEvents(ClientPtr client)
{
- char n;
-
REQUEST(xGetSelectedExtensionEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
- swapl(&stuff->window, n);
+ swapl(&stuff->window);
return (ProcXGetSelectedExtensionEvents(client));
}
@@ -168,11 +166,9 @@ void
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
xGetSelectedExtensionEventsReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->this_client_count, n);
- swaps(&rep->all_clients_count, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->this_client_count);
+ swaps(&rep->all_clients_count);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/getvers.c b/Xi/getvers.c
index c8e9ebca6..8bea1c4b9 100644
--- a/Xi/getvers.c
+++ b/Xi/getvers.c
@@ -73,12 +73,10 @@ XExtensionVersion XIVersion;
int
SProcXGetExtensionVersion(ClientPtr client)
{
- char n;
-
REQUEST(xGetExtensionVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
- swaps(&stuff->nbytes, n);
+ swaps(&stuff->nbytes);
return (ProcXGetExtensionVersion(client));
}
@@ -125,11 +123,9 @@ void
SRepXGetExtensionVersion(ClientPtr client, int size,
xGetExtensionVersionReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->major_version, n);
- swaps(&rep->minor_version, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->major_version);
+ swaps(&rep->minor_version);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index 925c9a6d2..4572c33fc 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -75,14 +75,12 @@ extern int ExtEventIndex;
int
SProcXGrabDevice(ClientPtr client)
{
- char n;
-
REQUEST(xGrabDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
- swapl(&stuff->grabWindow, n);
- swapl(&stuff->time, n);
- swaps(&stuff->event_count, n);
+ swapl(&stuff->grabWindow);
+ swapl(&stuff->time);
+ swaps(&stuff->event_count);
if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength;
@@ -210,9 +208,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
void
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index e235f5313..2897d410b 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -74,14 +74,12 @@ SOFTWARE.
int
SProcXGrabDeviceButton(ClientPtr client)
{
- char n;
-
REQUEST(xGrabDeviceButtonReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- swaps(&stuff->event_count, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index b34867b5f..cedd90d9c 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.c
@@ -74,14 +74,12 @@ SOFTWARE.
int
SProcXGrabDeviceKey(ClientPtr client)
{
- char n;
-
REQUEST(xGrabDeviceKeyReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- swaps(&stuff->event_count, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDeviceKey(client));
diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c
index 9132f4f47..34f167b40 100644
--- a/Xi/gtmotion.c
+++ b/Xi/gtmotion.c
@@ -71,13 +71,11 @@ SOFTWARE.
int
SProcXGetDeviceMotionEvents(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceMotionEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
- swapl(&stuff->start, n);
- swapl(&stuff->stop, n);
+ swapl(&stuff->start);
+ swapl(&stuff->stop);
return (ProcXGetDeviceMotionEvents(client));
}
@@ -143,11 +141,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
if (nEvents) {
if (client->swapped) {
- char n;
-
bufptr = coords;
for (i = 0; i < nEvents * (axes + 1); i++) {
- swapl(bufptr, n);
+ swapl(bufptr);
bufptr++;
}
}
@@ -168,10 +164,8 @@ void
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
xGetDeviceMotionEventsReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->nEvents, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->nEvents);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/listdev.c b/Xi/listdev.c
index 29f0d96e3..1b3081d96 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -78,10 +78,8 @@ SOFTWARE.
int
SProcXListInputDevices(ClientPtr client)
{
- char n;
-
REQUEST(xListInputDevicesReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXListInputDevices(client));
}
@@ -145,7 +143,6 @@ CopyDeviceName(char **namebuf, char *name)
static void
CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
{
- char n;
xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) * buf;
@@ -153,7 +150,7 @@ CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
b2->length = sizeof(xButtonInfo);
b2->num_buttons = b->numButtons;
if (client && client->swapped) {
- swaps(&b2->num_buttons, n); /* macro - braces are required */
+ swaps(&b2->num_buttons);
}
*buf += sizeof(xButtonInfo);
}
@@ -168,7 +165,6 @@ static void
CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
char **buf)
{
- char n;
xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) * buf;
@@ -188,7 +184,7 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
dev->use = IsXExtensionDevice;
if (client->swapped) {
- swapl(&dev->type, n); /* macro - braces are required */
+ swapl(&dev->type);
}
*buf += sizeof(xDeviceInfo);
}
@@ -202,7 +198,6 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
static void
CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
{
- char n;
xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) * buf;
@@ -212,7 +207,7 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
k2->max_keycode = k->xkbInfo->desc->max_key_code;
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
if (client && client->swapped) {
- swaps(&k2->num_keys, n);
+ swaps(&k2->num_keys);
}
*buf += sizeof(xKeyInfo);
}
@@ -233,7 +228,6 @@ static int
CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
{
int i, j, axes, t_axes;
- char n;
ValuatorClassPtr v = dev->valuator;
xValuatorInfoPtr v2;
AxisInfo *a;
@@ -251,7 +245,7 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
v2->mode = valuator_get_mode(dev, 0);
v2->motion_buffer_size = v->numMotionEvents;
if (client && client->swapped) {
- swapl(&v2->motion_buffer_size, n);
+ swapl(&v2->motion_buffer_size);
}
*buf += sizeof(xValuatorInfo);
a = v->axes + (VPC * i);
@@ -261,9 +255,9 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
a2->max_value = a->max_value;
a2->resolution = a->resolution;
if (client && client->swapped) {
- swapl(&a2->min_value, n);
- swapl(&a2->max_value, n);
- swapl(&a2->resolution, n);
+ swapl(&a2->min_value);
+ swapl(&a2->max_value);
+ swapl(&a2->resolution);
}
a2++;
a++;
@@ -424,9 +418,7 @@ ProcXListInputDevices(ClientPtr client)
void
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/opendev.c b/Xi/opendev.c
index 13841dc4f..ba0d30436 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -76,10 +76,8 @@ extern CARD8 event_base[];
int
SProcXOpenDevice(ClientPtr client)
{
- char n;
-
REQUEST(xOpenDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXOpenDevice(client));
}
@@ -166,9 +164,7 @@ ProcXOpenDevice(ClientPtr client)
void
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/queryst.c b/Xi/queryst.c
index 73af76d22..8c3bdcf97 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -56,10 +56,8 @@ from The Open Group.
int
SProcXQueryDeviceState(ClientPtr client)
{
- char n;
-
REQUEST(xQueryDeviceStateReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXQueryDeviceState(client));
}
@@ -72,7 +70,6 @@ SProcXQueryDeviceState(ClientPtr client)
int
ProcXQueryDeviceState(ClientPtr client)
{
- char n;
int rc, i;
int num_classes = 0;
int total_length = 0;
@@ -159,7 +156,7 @@ ProcXQueryDeviceState(ClientPtr client)
*((int *)buf) = *values;
values++;
if (client->swapped) {
- swapl((int *)buf, n); /* macro - braces needed */
+ swapl((int *)buf);
}
buf += sizeof(int);
}
@@ -184,9 +181,7 @@ ProcXQueryDeviceState(ClientPtr client)
void
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/selectev.c b/Xi/selectev.c
index 031e602ad..4c2c2fe05 100644
--- a/Xi/selectev.c
+++ b/Xi/selectev.c
@@ -123,13 +123,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
int
SProcXSelectExtensionEvent(ClientPtr client)
{
- char n;
-
REQUEST(xSelectExtensionEventReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
- swapl(&stuff->window, n);
- swaps(&stuff->count, n);
+ swapl(&stuff->window);
+ swaps(&stuff->count);
REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
diff --git a/Xi/sendexev.c b/Xi/sendexev.c
index 16cbd6f77..4770c28d1 100644
--- a/Xi/sendexev.c
+++ b/Xi/sendexev.c
@@ -76,7 +76,6 @@ extern int lastEvent; /* Defined in extension.c */
int
SProcXSendExtensionEvent(ClientPtr client)
{
- char n;
CARD32 *p;
int i;
xEvent eventT;
@@ -84,10 +83,10 @@ SProcXSendExtensionEvent(ClientPtr client)
EventSwapPtr proc;
REQUEST(xSendExtensionEventReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
- swapl(&stuff->destination, n);
- swaps(&stuff->count, n);
+ swapl(&stuff->destination);
+ swaps(&stuff->count);
if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index 37c40e408..2a8f5d3b7 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXSetDeviceButtonMapping(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceButtonMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceButtonMapping(client));
}
@@ -132,9 +130,7 @@ void
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
xSetDeviceButtonMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/setdval.c b/Xi/setdval.c
index b384f0d3c..ea17852f7 100644
--- a/Xi/setdval.c
+++ b/Xi/setdval.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXSetDeviceValuators(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceValuatorsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceValuators(client));
}
@@ -138,9 +136,7 @@ void
SRepXSetDeviceValuators(ClientPtr client, int size,
xSetDeviceValuatorsReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/setfocus.c b/Xi/setfocus.c
index 03bc37acb..feec3fc35 100644
--- a/Xi/setfocus.c
+++ b/Xi/setfocus.c
@@ -74,13 +74,11 @@ SOFTWARE.
int
SProcXSetDeviceFocus(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceFocusReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
+ swapl(&stuff->focus);
+ swapl(&stuff->time);
return (ProcXSetDeviceFocus(client));
}
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index cbe5dc8c5..dc6d828a1 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -73,10 +73,8 @@ SOFTWARE.
int
SProcXSetDeviceModifierMapping(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceModifierMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceModifierMapping(client));
}
@@ -140,9 +138,7 @@ void
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
xSetDeviceModifierMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/setmode.c b/Xi/setmode.c
index 42e90f75d..80ee764b0 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXSetDeviceMode(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceModeReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceMode(client));
}
@@ -138,9 +136,7 @@ ProcXSetDeviceMode(ClientPtr client)
void
SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c
index a09c3d024..bc66cfc4b 100644
--- a/Xi/ungrdev.c
+++ b/Xi/ungrdev.c
@@ -70,12 +70,10 @@ SOFTWARE.
int
SProcXUngrabDevice(ClientPtr client)
{
- char n;
-
REQUEST(xUngrabDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
- swapl(&stuff->time, n);
+ swapl(&stuff->time);
return (ProcXUngrabDevice(client));
}
diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c
index 4e93f1ae3..9e9ece47a 100644
--- a/Xi/ungrdevb.c
+++ b/Xi/ungrdevb.c
@@ -76,13 +76,11 @@ SOFTWARE.
int
SProcXUngrabDeviceButton(ClientPtr client)
{
- char n;
-
REQUEST(xUngrabDeviceButtonReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
return (ProcXUngrabDeviceButton(client));
}
diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c
index 3b4d6260e..526347db4 100644
--- a/Xi/ungrdevk.c
+++ b/Xi/ungrdevk.c
@@ -78,13 +78,11 @@ SOFTWARE.
int
SProcXUngrabDeviceKey(ClientPtr client)
{
- char n;
-
REQUEST(xUngrabDeviceKeyReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
return (ProcXUngrabDeviceKey(client));
}
diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
index 3077e1a44..0d45b3654 100644
--- a/Xi/xiallowev.c
+++ b/Xi/xiallowev.c
@@ -44,13 +44,11 @@
int
SProcXIAllowEvents(ClientPtr client)
{
- char n;
-
REQUEST(xXIAllowEventsReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->time);
return ProcXIAllowEvents(client);
}
diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c
index 215339331..48f51f3b5 100644
--- a/Xi/xichangecursor.c
+++ b/Xi/xichangecursor.c
@@ -56,13 +56,11 @@
int
SProcXIChangeCursor(ClientPtr client)
{
- char n;
-
REQUEST(xXIChangeCursorReq);
- swaps(&stuff->length, n);
- swapl(&stuff->win, n);
- swapl(&stuff->cursor, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swapl(&stuff->win);
+ swapl(&stuff->cursor);
+ swaps(&stuff->deviceid);
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
return (ProcXIChangeCursor(client));
}
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 96ead6fcd..f2bd8bb05 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -133,10 +133,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
int SProcXIChangeHierarchy(ClientPtr client)
{
- char n;
-
REQUEST(xXIChangeHierarchyReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXIChangeHierarchy(client));
}
@@ -424,7 +422,6 @@ ProcXIChangeHierarchy(ClientPtr client)
{
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
- char n;
int rc = Success;
int flags[MAXDEVICES] = {0};
@@ -437,8 +434,8 @@ ProcXIChangeHierarchy(ClientPtr client)
any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
while(stuff->num_changes--)
{
- SWAPIF(swapl(&any->type, n));
- SWAPIF(swaps(&any->length, n));
+ SWAPIF(swapl(&any->type));
+ SWAPIF(swaps(&any->length));
required_len += any->length;
if ((stuff->length * 4) < required_len)
@@ -449,7 +446,7 @@ ProcXIChangeHierarchy(ClientPtr client)
case XIAddMaster:
{
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
- SWAPIF(swaps(&c->name_len, n));
+ SWAPIF(swaps(&c->name_len));
rc = add_master(client, c, flags);
if (rc != Success)
diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c
index 401e89fb4..1124ae08c 100644
--- a/Xi/xigetclientpointer.c
+++ b/Xi/xigetclientpointer.c
@@ -49,11 +49,10 @@
int
SProcXIGetClientPointer(ClientPtr client)
{
- char n;
REQUEST(xXIGetClientPointerReq);
- swaps(&stuff->length, n);
- swapl(&stuff->win, n);
+ swaps(&stuff->length);
+ swapl(&stuff->win);
return ProcXIGetClientPointer(client);
}
@@ -97,10 +96,9 @@ void
SRepXIGetClientPointer(ClientPtr client, int size,
xXIGetClientPointerReply* rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->deviceid, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->deviceid);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c
index 0adc8787d..a9b655c0e 100644
--- a/Xi/xigrabdev.c
+++ b/Xi/xigrabdev.c
@@ -45,16 +45,14 @@
int
SProcXIGrabDevice(ClientPtr client)
{
- char n;
-
REQUEST(xXIGrabDeviceReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->grab_window, n);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- swaps(&stuff->mask_len, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->grab_window);
+ swapl(&stuff->cursor);
+ swapl(&stuff->time);
+ swaps(&stuff->mask_len);
return ProcXIGrabDevice(client);
}
@@ -115,13 +113,11 @@ ProcXIGrabDevice(ClientPtr client)
int
SProcXIUngrabDevice(ClientPtr client)
{
- char n;
-
REQUEST(xXIUngrabDeviceReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->time);
return ProcXIUngrabDevice(client);
}
@@ -153,9 +149,7 @@ ProcXIUngrabDevice(ClientPtr client)
void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index ae4343344..6b4574854 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -49,27 +49,26 @@ int
SProcXIPassiveGrabDevice(ClientPtr client)
{
int i;
- char n;
xXIModifierInfo *mods;
REQUEST(xXIPassiveGrabDeviceReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->grab_window, n);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- swapl(&stuff->detail, n);
- swaps(&stuff->mask_len, n);
- swaps(&stuff->num_modifiers, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->grab_window);
+ swapl(&stuff->cursor);
+ swapl(&stuff->time);
+ swapl(&stuff->detail);
+ swaps(&stuff->mask_len);
+ swaps(&stuff->num_modifiers);
mods = (xXIModifierInfo*)&stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, mods++)
{
- swapl(&mods->base_mods, n);
- swapl(&mods->latched_mods, n);
- swapl(&mods->locked_mods, n);
+ swapl(&mods->base_mods);
+ swapl(&mods->latched_mods);
+ swapl(&mods->locked_mods);
}
return ProcXIPassiveGrabDevice(client);
@@ -88,7 +87,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
GrabParameters param;
void *tmp;
int mask_len;
- int n;
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
@@ -198,7 +196,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
info->status = status;
info->modifiers = *modifiers;
if (client->swapped)
- swapl(&info->modifiers, n);
+ swapl(&info->modifiers);
rep.num_modifiers++;
rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
@@ -217,11 +215,9 @@ void
SRepXIPassiveGrabDevice(ClientPtr client, int size,
xXIPassiveGrabDeviceReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_modifiers, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_modifiers);
WriteToClient(client, size, (char *)rep);
}
@@ -229,22 +225,21 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size,
int
SProcXIPassiveUngrabDevice(ClientPtr client)
{
- char n;
int i;
uint32_t *modifiers;
REQUEST(xXIPassiveUngrabDeviceReq);
- swaps(&stuff->length, n);
- swapl(&stuff->grab_window, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->detail, n);
- swaps(&stuff->num_modifiers, n);
+ swaps(&stuff->length);
+ swapl(&stuff->grab_window);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->detail);
+ swaps(&stuff->num_modifiers);
modifiers = (uint32_t*)&stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
- swapl(modifiers, n);
+ swapl(modifiers);
return ProcXIPassiveUngrabDevice(client);
}
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 83ce93014..fa0d81188 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -1036,10 +1036,9 @@ ProcXGetDeviceProperty (ClientPtr client)
int
SProcXListDeviceProperties (ClientPtr client)
{
- char n;
REQUEST(xListDevicePropertiesReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
return (ProcXListDeviceProperties(client));
@@ -1048,25 +1047,23 @@ SProcXListDeviceProperties (ClientPtr client)
int
SProcXChangeDeviceProperty (ClientPtr client)
{
- char n;
REQUEST(xChangeDevicePropertyReq);
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
+ swaps(&stuff->length);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->nUnits);
return (ProcXChangeDeviceProperty(client));
}
int
SProcXDeleteDeviceProperty (ClientPtr client)
{
- char n;
REQUEST(xDeleteDevicePropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->property, n);
+ swaps(&stuff->length);
+ swapl(&stuff->property);
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
return (ProcXDeleteDeviceProperty(client));
}
@@ -1074,14 +1071,13 @@ SProcXDeleteDeviceProperty (ClientPtr client)
int
SProcXGetDeviceProperty (ClientPtr client)
{
- char n;
REQUEST(xGetDevicePropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
+ swaps(&stuff->length);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->longOffset);
+ swapl(&stuff->longLength);
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
return (ProcXGetDeviceProperty(client));
}
@@ -1093,10 +1089,9 @@ void
SRepXListDeviceProperties(ClientPtr client, int size,
xListDevicePropertiesReply *rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->nAtoms, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->nAtoms);
/* properties will be swapped later, see ProcXListDeviceProperties */
WriteToClient(client, size, (char*)rep);
}
@@ -1105,13 +1100,11 @@ void
SRepXGetDeviceProperty(ClientPtr client, int size,
xGetDevicePropertyReply *rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->propertyType, n);
- swapl(&rep->bytesAfter, n);
- swapl(&rep->nItems, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->propertyType);
+ swapl(&rep->bytesAfter);
+ swapl(&rep->nItems);
/* data will be swapped, see ProcXGetDeviceProperty */
WriteToClient(client, size, (char*)rep);
}
@@ -1279,11 +1272,10 @@ ProcXIGetProperty(ClientPtr client)
int
SProcXIListProperties(ClientPtr client)
{
- char n;
REQUEST(xXIListPropertiesReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
return (ProcXIListProperties(client));
@@ -1292,27 +1284,25 @@ SProcXIListProperties(ClientPtr client)
int
SProcXIChangeProperty(ClientPtr client)
{
- char n;
REQUEST(xXIChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->num_items, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->num_items);
return (ProcXIChangeProperty(client));
}
int
SProcXIDeleteProperty(ClientPtr client)
{
- char n;
REQUEST(xXIDeletePropertyReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->property, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->property);
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
return (ProcXIDeleteProperty(client));
}
@@ -1320,15 +1310,14 @@ SProcXIDeleteProperty(ClientPtr client)
int
SProcXIGetProperty(ClientPtr client)
{
- char n;
REQUEST(xXIGetPropertyReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->offset, n);
- swapl(&stuff->len, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->offset);
+ swapl(&stuff->len);
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
return (ProcXIGetProperty(client));
}
@@ -1338,10 +1327,9 @@ void
SRepXIListProperties(ClientPtr client, int size,
xXIListPropertiesReply *rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_properties, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_properties);
/* properties will be swapped later, see ProcXIListProperties */
WriteToClient(client, size, (char*)rep);
}
@@ -1350,13 +1338,11 @@ void
SRepXIGetProperty(ClientPtr client, int size,
xXIGetPropertyReply *rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->type, n);
- swapl(&rep->bytes_after, n);
- swapl(&rep->num_items, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->type);
+ swapl(&rep->bytes_after);
+ swapl(&rep->num_items);
/* data will be swapped, see ProcXIGetProperty */
WriteToClient(client, size, (char*)rep);
}
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index a768d499c..f5fca0d69 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -52,12 +52,10 @@ static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
int
SProcXIQueryDevice(ClientPtr client)
{
- char n;
-
REQUEST(xXIQueryDeviceReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
return ProcXIQueryDevice(client);
}
@@ -166,11 +164,9 @@ ProcXIQueryDevice(ClientPtr client)
void
SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_devices, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_devices);
/* Device info is already swapped, see ProcXIQueryDevice */
@@ -278,17 +274,16 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
static void
SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
{
- char n;
Atom *btn;
int i;
- swaps(&info->type, n);
- swaps(&info->length, n);
- swaps(&info->sourceid, n);
+ swaps(&info->type);
+ swaps(&info->length);
+ swaps(&info->sourceid);
for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++)
- swaps(btn, n);
+ swaps(btn);
- swaps(&info->num_buttons, n);
+ swaps(&info->num_buttons);
}
/**
@@ -317,17 +312,16 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
static void
SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
{
- char n;
uint32_t *key;
int i;
- swaps(&info->type, n);
- swaps(&info->length, n);
- swaps(&info->sourceid, n);
+ swaps(&info->type);
+ swaps(&info->length);
+ swaps(&info->sourceid);
for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++)
- swapl(key, n);
+ swapl(key);
- swaps(&info->num_keycodes, n);
+ swaps(&info->num_keycodes);
}
/**
@@ -364,16 +358,15 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
static void
SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
{
- char n;
- swaps(&info->type, n);
- swaps(&info->length, n);
- swapl(&info->label, n);
- swapl(&info->min.integral, n);
- swapl(&info->min.frac, n);
- swapl(&info->max.integral, n);
- swapl(&info->max.frac, n);
- swaps(&info->number, n);
- swaps(&info->sourceid, n);
+ swaps(&info->type);
+ swaps(&info->length);
+ swapl(&info->label);
+ swapl(&info->min.integral);
+ swapl(&info->min.frac);
+ swapl(&info->max.integral);
+ swapl(&info->max.frac);
+ swaps(&info->number);
+ swaps(&info->sourceid);
}
int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
@@ -471,7 +464,6 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
static void
SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
{
- char n;
char *any = (char*)&info[1];
int i;
@@ -497,10 +489,10 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
any += len * 4;
}
- swaps(&info->deviceid, n);
- swaps(&info->use, n);
- swaps(&info->attachment, n);
- swaps(&info->num_classes, n);
- swaps(&info->name_len, n);
+ swaps(&info->deviceid);
+ swaps(&info->use);
+ swaps(&info->attachment);
+ swaps(&info->num_classes);
+ swaps(&info->name_len);
}
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index 51317994b..9e05eff30 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -61,12 +61,10 @@
int
SProcXIQueryPointer(ClientPtr client)
{
- char n;
-
REQUEST(xXIQueryPointerReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->win, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->win);
return (ProcXIQueryPointer(client));
}
@@ -212,17 +210,15 @@ void
SRepXIQueryPointer(ClientPtr client, int size,
xXIQueryPointerReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->root, n);
- swapl(&rep->child, n);
- swapl(&rep->root_x, n);
- swapl(&rep->root_y, n);
- swapl(&rep->win_x, n);
- swapl(&rep->win_y, n);
- swaps(&rep->buttons_len, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->root);
+ swapl(&rep->child);
+ swapl(&rep->root_x);
+ swapl(&rep->root_y);
+ swapl(&rep->win_x);
+ swapl(&rep->win_y);
+ swaps(&rep->buttons_len);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c
index f647f9872..a94061432 100644
--- a/Xi/xiqueryversion.c
+++ b/Xi/xiqueryversion.c
@@ -103,23 +103,20 @@ ProcXIQueryVersion(ClientPtr client)
int
SProcXIQueryVersion(ClientPtr client)
{
- char n;
-
REQUEST(xXIQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
- swaps(&stuff->major_version, n);
- swaps(&stuff->minor_version, n);
+ swaps(&stuff->major_version);
+ swaps(&stuff->minor_version);
return (ProcXIQueryVersion(client));
}
void
SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply *rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->major_version, n);
- swaps(&rep->minor_version, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->major_version);
+ swaps(&rep->minor_version);
WriteToClient(client, size, (char *)rep);
}
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 22fbaf5e7..3af4f1fb9 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -63,21 +63,20 @@ int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
int
SProcXISelectEvents(ClientPtr client)
{
- char n;
int i;
xXIEventMask* evmask;
REQUEST(xXISelectEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
- swapl(&stuff->win, n);
- swaps(&stuff->num_masks, n);
+ swapl(&stuff->win);
+ swaps(&stuff->num_masks);
evmask = (xXIEventMask*)&stuff[1];
for (i = 0; i < stuff->num_masks; i++)
{
- swaps(&evmask->deviceid, n);
- swaps(&evmask->mask_len, n);
+ swaps(&evmask->deviceid);
+ swaps(&evmask->mask_len);
evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4);
}
@@ -192,12 +191,10 @@ ProcXISelectEvents(ClientPtr client)
int
SProcXIGetSelectedEvents(ClientPtr client)
{
- char n;
-
REQUEST(xXIGetSelectedEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
- swapl(&stuff->win, n);
+ swapl(&stuff->win);
return (ProcXIGetSelectedEvents(client));
}
@@ -207,7 +204,6 @@ ProcXIGetSelectedEvents(ClientPtr client)
{
int rc, i;
WindowPtr win;
- char n;
char *buffer = NULL;
xXIGetSelectedEventsReply reply;
OtherInputMasks *masks;
@@ -275,8 +271,8 @@ ProcXIGetSelectedEvents(ClientPtr client)
if (client->swapped)
{
- swaps(&evmask->deviceid, n);
- swaps(&evmask->mask_len, n);
+ swaps(&evmask->deviceid);
+ swaps(&evmask->mask_len);
}
memcpy(&evmask[1], devmask, j + 1);
@@ -299,11 +295,9 @@ ProcXIGetSelectedEvents(ClientPtr client)
void SRepXIGetSelectedEvents(ClientPtr client,
int len, xXIGetSelectedEventsReply *rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_masks, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_masks);
WriteToClient(client, len, (char *)rep);
}
diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c
index 09db8ff75..934747d30 100644
--- a/Xi/xisetclientpointer.c
+++ b/Xi/xisetclientpointer.c
@@ -51,12 +51,10 @@
int
SProcXISetClientPointer(ClientPtr client)
{
- char n;
-
REQUEST(xXISetClientPointerReq);
- swaps(&stuff->length, n);
- swapl(&stuff->win, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swapl(&stuff->win);
+ swaps(&stuff->deviceid);
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
return (ProcXISetClientPointer(client));
}
diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c
index 059424e41..294df7c32 100644
--- a/Xi/xisetdevfocus.c
+++ b/Xi/xisetdevfocus.c
@@ -43,13 +43,11 @@
int
SProcXISetFocus(ClientPtr client)
{
- char n;
-
REQUEST(xXISetFocusReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->focus);
+ swapl(&stuff->time);
return ProcXISetFocus(client);
}
@@ -57,11 +55,9 @@ SProcXISetFocus(ClientPtr client)
int
SProcXIGetFocus(ClientPtr client)
{
- char n;
-
REQUEST(xXIGetFocusReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
return ProcXIGetFocus(client);
}
@@ -122,9 +118,8 @@ ProcXIGetFocus(ClientPtr client)
void
SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply *rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->focus, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->focus);
WriteToClient(client, len, (char *)rep);
}
diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c
index a463ab94d..8fcb4d16b 100644
--- a/Xi/xiwarppointer.c
+++ b/Xi/xiwarppointer.c
@@ -56,19 +56,17 @@
int
SProcXIWarpPointer(ClientPtr client)
{
- char n;
-
REQUEST(xXIWarpPointerReq);
- swaps(&stuff->length, n);
- swapl(&stuff->src_win, n);
- swapl(&stuff->dst_win, n);
- swapl(&stuff->src_x, n);
- swapl(&stuff->src_y, n);
- swaps(&stuff->src_width, n);
- swaps(&stuff->src_height, n);
- swapl(&stuff->dst_x, n);
- swapl(&stuff->dst_y, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src_win);
+ swapl(&stuff->dst_win);
+ swapl(&stuff->src_x);
+ swapl(&stuff->src_y);
+ swaps(&stuff->src_width);
+ swaps(&stuff->src_height);
+ swapl(&stuff->dst_x);
+ swapl(&stuff->dst_y);
+ swaps(&stuff->deviceid);
return (ProcXIWarpPointer(client));
}