diff options
author | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
commit | 0f834b91a4768673833ab4917e87d86c237bb1a6 (patch) | |
tree | 363489504ed4b2d360259b8de4c9e392918e5d02 /xorg-server/Xi/getdctl.c | |
parent | fc72edebf875378459368c5383d9023730cbca54 (diff) | |
download | vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2 vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip |
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'xorg-server/Xi/getdctl.c')
-rw-r--r-- | xorg-server/Xi/getdctl.c | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/xorg-server/Xi/getdctl.c b/xorg-server/Xi/getdctl.c index 6090b814a..4d66a4dfc 100644 --- a/xorg-server/Xi/getdctl.c +++ b/xorg-server/Xi/getdctl.c @@ -54,7 +54,7 @@ SOFTWARE. #include <dix-config.h> #endif -#include "inputstr.h" /* DeviceIntPtr */ +#include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" @@ -86,7 +86,7 @@ SProcXGetDeviceControl(ClientPtr client) static void CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, - int length) + int length) { AxisInfoPtr a; xDeviceResolutionState *r; @@ -97,25 +97,26 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, r->length = length; r->num_valuators = v->numAxes; buf += sizeof(xDeviceResolutionState); - iptr = (int *)buf; + iptr = (int *) buf; for (i = 0, a = v->axes; i < v->numAxes; i++, a++) - *iptr++ = a->resolution; + *iptr++ = a->resolution; for (i = 0, a = v->axes; i < v->numAxes; i++, a++) - *iptr++ = a->min_resolution; + *iptr++ = a->min_resolution; for (i = 0, a = v->axes; i < v->numAxes; i++, a++) - *iptr++ = a->max_resolution; + *iptr++ = a->max_resolution; if (client->swapped) { - swaps(&r->control); - swaps(&r->length); - swapl(&r->num_valuators); - iptr = (int *)buf; - for (i = 0; i < (3 * v->numAxes); i++, iptr++) { - swapl(iptr); - } + swaps(&r->control); + swaps(&r->length); + swapl(&r->num_valuators); + iptr = (int *) buf; + for (i = 0; i < (3 * v->numAxes); i++, iptr++) { + swapl(iptr); + } } } -static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) +static void +CopySwapDeviceCore(ClientPtr client, DeviceIntPtr dev, char *buf) { xDeviceCoreState *c = (xDeviceCoreState *) buf; @@ -130,7 +131,8 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) } } -static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf) +static void +CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf) { xDeviceEnableState *e = (xDeviceEnableState *) buf; @@ -156,7 +158,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, (char *) rep); } /*********************************************************************** @@ -178,7 +180,7 @@ ProcXGetDeviceControl(ClientPtr client) rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) - return rc; + return rc; rep.repType = X_Reply; rep.RepType = X_GetDeviceControl; @@ -187,11 +189,11 @@ ProcXGetDeviceControl(ClientPtr client) switch (stuff->control) { case DEVICE_RESOLUTION: - if (!dev->valuator) - return BadMatch; - total_length = sizeof(xDeviceResolutionState) + - (3 * sizeof(int) * dev->valuator->numAxes); - break; + if (!dev->valuator) + return BadMatch; + total_length = sizeof(xDeviceResolutionState) + + (3 * sizeof(int) * dev->valuator->numAxes); + break; case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: return BadMatch; @@ -202,18 +204,18 @@ ProcXGetDeviceControl(ClientPtr client) total_length = sizeof(xDeviceEnableState); break; default: - return BadValue; + return BadValue; } - buf = (char *)malloc(total_length); + buf = (char *) malloc(total_length); if (!buf) - return BadAlloc; + return BadAlloc; savbuf = buf; switch (stuff->control) { case DEVICE_RESOLUTION: - CopySwapDeviceResolution(client, dev->valuator, buf, total_length); - break; + CopySwapDeviceResolution(client, dev->valuator, buf, total_length); + break; case DEVICE_CORE: CopySwapDeviceCore(client, dev, buf); break; @@ -221,7 +223,7 @@ ProcXGetDeviceControl(ClientPtr client) CopySwapDeviceEnable(client, dev, buf); break; default: - break; + break; } rep.length = bytes_to_int32(total_length); |