diff options
| author | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
|---|---|---|
| committer | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
| commit | 1dad092caf01d733990648e6df64cbf964df5143 (patch) | |
| tree | 39de0e643e76754a3e23ca9dd0350b8ba4f76250 /nx-X11/programs/Xserver/Xi/listdev.c | |
| parent | 6d70b9e3c47f27a166f4aacb522c5c1e49092dd9 (diff) | |
| parent | 2b9025f797ee322e21077e100c2ee27c2e7fa0e0 (diff) | |
| download | nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.gz nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.bz2 nx-libs-1dad092caf01d733990648e6df64cbf964df5143.zip | |
Merge branch '3.6.x'
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/listdev.c')
| -rw-r--r-- | nx-X11/programs/Xserver/Xi/listdev.c | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index b7eed86b7..95896d49d 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -1,4 +1,3 @@ -/* $Xorg: listdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/listdev.c,v 3.3 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * @@ -53,17 +51,15 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif -#include <X11/X.h> /* for inputstr.h */ -#include <X11/Xproto.h> /* Request macro */ +#include <nx-X11/X.h> /* for inputstr.h */ +#include <nx-X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> +#include <nx-X11/extensions/XI.h> +#include <nx-X11/extensions/XIproto.h> #include "XIstubs.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ @@ -83,10 +79,8 @@ int SProcXListInputDevices(client) register ClientPtr client; { - register char n; - REQUEST(xListInputDevicesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return(ProcXListInputDevices(client)); } @@ -114,6 +108,7 @@ ProcXListInputDevices (client) REQUEST_SIZE_MATCH(xListInputDevicesReq); + memset(&rep, 0, sizeof(xListInputDevicesReply)); rep.repType = X_Reply; rep.RepType = X_ListInputDevices; rep.length = 0; @@ -128,7 +123,7 @@ ProcXListInputDevices (client) SizeDeviceInfo (d, &namesize, &size); total_length = numdevs * sizeof (xDeviceInfo) + size + namesize; - devbuf = (char *) xalloc (total_length); + devbuf = (char *) calloc (1, total_length); classbuf = devbuf + (numdevs * sizeof (xDeviceInfo)); namebuf = classbuf + size; savbuf = devbuf; @@ -143,7 +138,7 @@ ProcXListInputDevices (client) rep.length = (total_length + 3) >> 2; WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep); WriteToClient(client, total_length, savbuf); - xfree (savbuf); + free (savbuf); return Success; } @@ -253,7 +248,6 @@ CopySwapDevice (client, d, num_classes, buf) int num_classes; char **buf; { - register char n; xDeviceInfoPtr dev; dev = (xDeviceInfoPtr) *buf; @@ -269,7 +263,7 @@ CopySwapDevice (client, d, num_classes, buf) dev->use = IsXExtensionDevice; if (client->swapped) { - swapl(&dev->type, n); /* macro - braces are required */ + swapl(&dev->type); /* macro - braces are required */ } *buf += sizeof (xDeviceInfo); } @@ -286,7 +280,6 @@ CopySwapKeyClass (client, k, buf) KeyClassPtr k; char **buf; { - register char n; xKeyInfoPtr k2; k2 = (xKeyInfoPtr) *buf; @@ -297,7 +290,7 @@ CopySwapKeyClass (client, k, buf) k2->num_keys = k2->max_keycode - k2->min_keycode + 1; if (client->swapped) { - swaps(&k2->num_keys,n); + swaps(&k2->num_keys); } *buf += sizeof (xKeyInfo); } @@ -314,7 +307,6 @@ CopySwapButtonClass (client, b, buf) ButtonClassPtr b; char **buf; { - register char n; xButtonInfoPtr b2; b2 = (xButtonInfoPtr) *buf; @@ -323,7 +315,7 @@ CopySwapButtonClass (client, b, buf) b2->num_buttons = b->numButtons; if (client->swapped) { - swaps(&b2->num_buttons,n); /* macro - braces are required */ + swaps(&b2->num_buttons); /* macro - braces are required */ } *buf += sizeof (xButtonInfo); } @@ -347,7 +339,6 @@ CopySwapValuatorClass (client, v, buf) char **buf; { int i, j, axes, t_axes; - register char n; xValuatorInfoPtr v2; AxisInfo *a; xAxisInfoPtr a2; @@ -364,7 +355,7 @@ CopySwapValuatorClass (client, v, buf) v2->motion_buffer_size = v->numMotionEvents; if (client->swapped) { - swapl(&v2->motion_buffer_size,n); + swapl(&v2->motion_buffer_size); } *buf += sizeof (xValuatorInfo); a = v->axes + (VPC * i); @@ -374,9 +365,9 @@ CopySwapValuatorClass (client, v, buf) a2->max_value = a->max_value; a2->resolution = a->resolution; if (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++; @@ -399,9 +390,7 @@ SRepXListInputDevices (client, size, rep) int size; xListInputDevicesReply *rep; { - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - WriteToClient(client, size, (char *)rep); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + WriteToClient(client, size, rep); } |
