diff options
author | Matt Turner <mattst88@gmail.com> | 2011-08-04 15:35:41 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2011-09-21 17:12:04 -0400 |
commit | 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 (patch) | |
tree | f47282ce2f815acc691cfe188850adf8d6fbfcc3 /Xi/listdev.c | |
parent | c10bad3d3e8ff1b90014770fd470f9c67263e46f (diff) |
Use internal temp variable for swap macros
Also, fix whitespace, mainly around
swaps(&rep.sequenceNumber)
Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'Xi/listdev.c')
-rw-r--r-- | Xi/listdev.c | 28 |
1 files changed, 10 insertions, 18 deletions
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); } |