Xi: remove trailing whitespaces.

This commit is contained in:
Peter Hutterer 2007-11-13 17:14:35 +10:30
parent 5031238aad
commit e96d926d64
19 changed files with 130 additions and 130 deletions

View File

@ -50,9 +50,9 @@ from the author.
* This procedure allows a client to change window access control. * This procedure allows a client to change window access control.
*/ */
int int
SProcXChangeWindowAccess(ClientPtr client) SProcXChangeWindowAccess(ClientPtr client)
{ {
char n; char n;
REQUEST(xChangeWindowAccessReq); REQUEST(xChangeWindowAccessReq);
@ -61,7 +61,7 @@ SProcXChangeWindowAccess(ClientPtr client)
return ProcXChangeWindowAccess(client); return ProcXChangeWindowAccess(client);
} }
int int
ProcXChangeWindowAccess(ClientPtr client) ProcXChangeWindowAccess(ClientPtr client)
{ {
int padding, err, i; int padding, err, i;
@ -71,14 +71,14 @@ ProcXChangeWindowAccess(ClientPtr client)
DeviceIntPtr* deny_devices = NULL; DeviceIntPtr* deny_devices = NULL;
REQUEST(xChangeWindowAccessReq); REQUEST(xChangeWindowAccessReq);
REQUEST_AT_LEAST_SIZE(xChangeWindowAccessReq); REQUEST_AT_LEAST_SIZE(xChangeWindowAccessReq);
padding = (4 - (((stuff->npermit + stuff->ndeny) * sizeof(XID)) % 4)) % 4; padding = (4 - (((stuff->npermit + stuff->ndeny) * sizeof(XID)) % 4)) % 4;
if (stuff->length != ((sizeof(xChangeWindowAccessReq) + if (stuff->length != ((sizeof(xChangeWindowAccessReq) +
(((stuff->npermit + stuff->ndeny) * sizeof(XID)) + padding)) >> 2)) (((stuff->npermit + stuff->ndeny) * sizeof(XID)) + padding)) >> 2))
{ {
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
0, BadLength); 0, BadLength);
return Success; return Success;
} }
@ -87,7 +87,7 @@ ProcXChangeWindowAccess(ClientPtr client)
err = dixLookupWindow(&win, stuff->win, client, DixWriteAccess); err = dixLookupWindow(&win, stuff->win, client, DixWriteAccess);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
stuff->win, err); stuff->win, err);
return Success; return Success;
} }
@ -106,12 +106,12 @@ ProcXChangeWindowAccess(ClientPtr client)
if (stuff->npermit) if (stuff->npermit)
{ {
perm_devices = perm_devices =
(DeviceIntPtr*)xalloc(stuff->npermit * sizeof(DeviceIntPtr)); (DeviceIntPtr*)xalloc(stuff->npermit * sizeof(DeviceIntPtr));
if (!perm_devices) if (!perm_devices)
{ {
ErrorF("[Xi] ProcXChangeWindowAccess: alloc failure.\n"); ErrorF("[Xi] ProcXChangeWindowAccess: alloc failure.\n");
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0,
BadImplementation); BadImplementation);
return Success; return Success;
} }
@ -123,8 +123,8 @@ ProcXChangeWindowAccess(ClientPtr client)
if (!perm_devices[i]) if (!perm_devices[i])
{ {
xfree(perm_devices); xfree(perm_devices);
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
deviceids[i], BadDevice); deviceids[i], BadDevice);
return Success; return Success;
} }
} }
@ -132,12 +132,12 @@ ProcXChangeWindowAccess(ClientPtr client)
if (stuff->ndeny) if (stuff->ndeny)
{ {
deny_devices = deny_devices =
(DeviceIntPtr*)xalloc(stuff->ndeny * sizeof(DeviceIntPtr)); (DeviceIntPtr*)xalloc(stuff->ndeny * sizeof(DeviceIntPtr));
if (!deny_devices) if (!deny_devices)
{ {
ErrorF("[Xi] ProcXChangeWindowAccecss: alloc failure.\n"); ErrorF("[Xi] ProcXChangeWindowAccecss: alloc failure.\n");
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0,
BadImplementation); BadImplementation);
xfree(perm_devices); xfree(perm_devices);
@ -146,15 +146,15 @@ ProcXChangeWindowAccess(ClientPtr client)
for (i = 0; i < stuff->ndeny; i++) for (i = 0; i < stuff->ndeny; i++)
{ {
deny_devices[i] = deny_devices[i] =
LookupDeviceIntRec(deviceids[i+stuff->npermit]); LookupDeviceIntRec(deviceids[i+stuff->npermit]);
if (!deny_devices[i]) if (!deny_devices[i])
{ {
xfree(perm_devices); xfree(perm_devices);
xfree(deny_devices); xfree(deny_devices);
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
deviceids[i + stuff->npermit], BadDevice); deviceids[i + stuff->npermit], BadDevice);
return Success; return Success;
} }
} }
@ -165,11 +165,11 @@ ProcXChangeWindowAccess(ClientPtr client)
deny_devices, stuff->ndeny); deny_devices, stuff->ndeny);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
stuff->win, err); stuff->win, err);
return Success; return Success;
} }
xfree(perm_devices); xfree(perm_devices);
xfree(deny_devices); xfree(deny_devices);
return Success; return Success;

View File

@ -82,7 +82,7 @@ int ProcXChangeDeviceCursor(ClientPtr client)
pDev = LookupDeviceIntRec(stuff->deviceid); pDev = LookupDeviceIntRec(stuff->deviceid);
if (pDev == NULL) { if (pDev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, 0, SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, 0,
BadDevice); BadDevice);
return Success; return Success;
} }
@ -91,7 +91,7 @@ int ProcXChangeDeviceCursor(ClientPtr client)
err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess); err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
stuff->win, err); stuff->win, err);
return Success; return Success;
} }
@ -103,18 +103,18 @@ int ProcXChangeDeviceCursor(ClientPtr client)
pCursor = rootCursor; pCursor = rootCursor;
else else
pCursor = (CursorPtr)None; pCursor = (CursorPtr)None;
} }
else else
{ {
pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
RT_CURSOR, DixReadAccess); RT_CURSOR, DixReadAccess);
if (!pCursor) if (!pCursor)
{ {
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
stuff->cursor, BadCursor); stuff->cursor, BadCursor);
return Success; return Success;
} }
} }
ChangeWindowDeviceCursor(pWin, pDev, pCursor); ChangeWindowDeviceCursor(pWin, pDev, pCursor);

View File

@ -90,7 +90,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
/* XXX: check if client is allowed to change hierarch */ /* XXX: check if client is allowed to change hierarch */
any = (xAnyHierarchyChangeInfo*)&stuff[1]; any = (xAnyHierarchyChangeInfo*)&stuff[1];
while(stuff->num_changes--) while(stuff->num_changes--)
{ {
@ -108,7 +108,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
xCreateMasterInfo* c = (xCreateMasterInfo*)any; xCreateMasterInfo* c = (xCreateMasterInfo*)any;
char* name; char* name;
int ret; int ret;
SWAPIF(swaps(&c->namelen, n)); SWAPIF(swaps(&c->namelen, n));
name = xcalloc(c->namelen + 1, sizeof(char)); name = xcalloc(c->namelen + 1, sizeof(char));
strncpy(name, (char*)&c[1], c->namelen); strncpy(name, (char*)&c[1], c->namelen);
@ -138,7 +138,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
{ {
xRemoveMasterInfo* r = (xRemoveMasterInfo*)any; xRemoveMasterInfo* r = (xRemoveMasterInfo*)any;
if (r->returnMode != AttachToMaster && if (r->returnMode != AttachToMaster &&
r->returnMode != Floating) r->returnMode != Floating)
return BadValue; return BadValue;
@ -164,8 +164,8 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
* desired. */ * desired. */
if (r->returnMode == AttachToMaster) if (r->returnMode == AttachToMaster)
{ {
DeviceIntPtr attached, DeviceIntPtr attached,
newptr, newptr,
newkeybd; newkeybd;
newptr = LookupDeviceIntRec(r->returnPointer); newptr = LookupDeviceIntRec(r->returnPointer);
@ -174,8 +174,8 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
!newkeybd || !newkeybd->isMaster) !newkeybd || !newkeybd->isMaster)
return BadDevice; return BadDevice;
for (attached = inputInfo.devices; for (attached = inputInfo.devices;
attached; attached;
attached = attached->next) attached = attached->next)
{ {
if (!attached->isMaster) { if (!attached->isMaster) {
@ -216,7 +216,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
if ((IsPointerDevice(newmaster) && if ((IsPointerDevice(newmaster) &&
!IsPointerDevice(ptr)) || !IsPointerDevice(ptr)) ||
(IsKeyboardDevice(newmaster) && (IsKeyboardDevice(newmaster) &&
!IsKeyboardDevice(ptr))) !IsKeyboardDevice(ptr)))
return BadDevice; return BadDevice;
AttachDevice(client, ptr, newmaster); AttachDevice(client, ptr, newmaster);
} }
@ -234,7 +234,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
ev.evtype = XI_DeviceHierarchyChangedNotify; ev.evtype = XI_DeviceHierarchyChangedNotify;
ev.time = GetTimeInMillis(); ev.time = GetTimeInMillis();
SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask, SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
(xEvent*)&ev, 1); (xEvent*)&ev, 1);
return Success; return Success;
} }

View File

@ -77,7 +77,7 @@ ProcXChangePointerKeyboardPairing(ClientPtr client)
{ {
DeviceIntPtr pPointer, pKeyboard; DeviceIntPtr pPointer, pKeyboard;
int ret; int ret;
pairingChangedNotify ev; pairingChangedNotify ev;
REQUEST(xChangePointerKeyboardPairingReq); REQUEST(xChangePointerKeyboardPairingReq);
REQUEST_SIZE_MATCH(xChangePointerKeyboardPairingReq); REQUEST_SIZE_MATCH(xChangePointerKeyboardPairingReq);
@ -87,16 +87,16 @@ ProcXChangePointerKeyboardPairing(ClientPtr client)
pPointer = LookupDeviceIntRec(stuff->pointer); pPointer = LookupDeviceIntRec(stuff->pointer);
if (pPointer == NULL) if (pPointer == NULL)
{ {
SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing, SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
stuff->pointer, BadDevice); stuff->pointer, BadDevice);
return Success; return Success;
} }
pKeyboard = LookupDeviceIntRec(stuff->keyboard); pKeyboard = LookupDeviceIntRec(stuff->keyboard);
if (pKeyboard == NULL) if (pKeyboard == NULL)
{ {
SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing, SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
stuff->keyboard, BadDevice); stuff->keyboard, BadDevice);
return Success; return Success;
} }
@ -116,15 +116,15 @@ ProcXChangePointerKeyboardPairing(ClientPtr client)
ev.keyboard = pKeyboard->id; ev.keyboard = pKeyboard->id;
ev.length = 0; ev.length = 0;
ev.time = currentTime.milliseconds; ev.time = currentTime.milliseconds;
SendEventToAllWindows(inputInfo.pointer, SendEventToAllWindows(inputInfo.pointer,
XI_PointerKeyboardPairingChangedMask, XI_PointerKeyboardPairingChangedMask,
(xEvent*)&ev, 1); (xEvent*)&ev, 1);
return Success; return Success;
} }
/* Event swap proc */ /* Event swap proc */
void void
SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from, SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
pairingChangedNotify *to) pairingChangedNotify *to)
{ {
char n; char n;

View File

@ -154,7 +154,7 @@ ProcXCloseDevice(ClientPtr client)
if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client)) if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
(*d->deviceGrab.DeactivateGrab) (d); /* release active grab */ (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
/* Remove event selections from all windows for events from this device /* Remove event selections from all windows for events from this device
* and selected by this client. * and selected by this client.
* Delete passive grabs from all windows for this device. */ * Delete passive grabs from all windows for this device. */

View File

@ -103,10 +103,10 @@ RegisterOtherDevice(DeviceIntPtr device)
} }
/** /**
* Main device event processing function. * Main device event processing function.
* Called from when processing the events from the event queue. * Called from when processing the events from the event queue.
* Generates core events for XI events as needed. * Generates core events for XI events as needed.
* *
* Note that these core events are then delivered first. For passive grabs, XI * Note that these core events are then delivered first. For passive grabs, XI
* events have preference over core. * events have preference over core.
*/ */
@ -309,7 +309,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
} }
} }
if (device->deviceGrab.fromPassiveGrab && if (device->deviceGrab.fromPassiveGrab &&
(key == device->deviceGrab.activatingKey)) (key == device->deviceGrab.activatingKey))
deactivateDeviceGrab = TRUE; deactivateDeviceGrab = TRUE;
} else if (xE->u.u.type == DeviceButtonPress) { } else if (xE->u.u.type == DeviceButtonPress) {
@ -357,7 +357,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
b->state &= ~((Button1Mask >> 1) << xE->u.u.detail); b->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify); SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
if (!b->state if (!b->state
&& device->deviceGrab.fromPassiveGrab) && device->deviceGrab.fromPassiveGrab)
deactivateDeviceGrab = TRUE; deactivateDeviceGrab = TRUE;
} else if (xE->u.u.type == ProximityIn) } else if (xE->u.u.type == ProximityIn)
@ -413,7 +413,7 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
int resolution, int min_res, int max_res) int resolution, int min_res, int max_res)
{ {
AxisInfoPtr ax; AxisInfoPtr ax;
if (!dev || !dev->valuator) if (!dev || !dev->valuator)
return; return;
@ -1122,7 +1122,7 @@ DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
if (dev->deviceGrab.grab && (dev->deviceGrab.grab->window == pWin)) if (dev->deviceGrab.grab && (dev->deviceGrab.grab->window == pWin))
(*dev->deviceGrab.DeactivateGrab) (dev); (*dev->deviceGrab.DeactivateGrab) (dev);
/* If the focus window is a root window (ie. has no parent) /* If the focus window is a root window (ie. has no parent)
* then don't delete the focus from it. */ * then don't delete the focus from it. */
if (dev->focus && (pWin == dev->focus->win) && (pWin->parent != NullWindow)) { if (dev->focus && (pWin == dev->focus->win) && (pWin->parent != NullWindow)) {

View File

@ -55,7 +55,7 @@ from the author.
#include "extgrbdev.h" #include "extgrbdev.h"
int int
SProcXExtendedGrabDevice(ClientPtr client) SProcXExtendedGrabDevice(ClientPtr client)
{ {
char n; char n;
@ -89,15 +89,15 @@ SProcXExtendedGrabDevice(ClientPtr client)
} }
int int
ProcXExtendedGrabDevice(ClientPtr client) ProcXExtendedGrabDevice(ClientPtr client)
{ {
xExtendedGrabDeviceReply rep; xExtendedGrabDeviceReply rep;
DeviceIntPtr dev; DeviceIntPtr dev;
int err = Success, int err = Success,
errval = 0, errval = 0,
i; i;
WindowPtr grab_window, WindowPtr grab_window,
confineTo = 0; confineTo = 0;
CursorPtr cursor = NULL; CursorPtr cursor = NULL;
struct tmask tmp[EMASKSIZE]; struct tmask tmp[EMASKSIZE];
@ -119,7 +119,7 @@ ProcXExtendedGrabDevice(ClientPtr client)
rep.length = 0; rep.length = 0;
if (!stuff->ungrab && /* other fields are undefined for ungrab */ if (!stuff->ungrab && /* other fields are undefined for ungrab */
(stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) + (stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) +
stuff->event_count + 2 * stuff->generic_event_count)) stuff->event_count + 2 * stuff->generic_event_count))
{ {
errval = 0; errval = 0;
@ -141,21 +141,21 @@ ProcXExtendedGrabDevice(ClientPtr client)
goto cleanup; goto cleanup;
} }
err = dixLookupWindow(&grab_window, err = dixLookupWindow(&grab_window,
stuff->grab_window, stuff->grab_window,
client, client,
DixReadAccess); DixReadAccess);
if (err != Success) if (err != Success)
{ {
errval = stuff->grab_window; errval = stuff->grab_window;
goto cleanup; goto cleanup;
} }
if (stuff->confine_to) if (stuff->confine_to)
{ {
err = dixLookupWindow(&confineTo, err = dixLookupWindow(&confineTo,
stuff->confine_to, stuff->confine_to,
client, client,
DixReadAccess); DixReadAccess);
if (err != Success) if (err != Success)
{ {
@ -166,10 +166,10 @@ ProcXExtendedGrabDevice(ClientPtr client)
if (stuff->cursor) if (stuff->cursor)
{ {
cursor = (CursorPtr)SecurityLookupIDByType(client, cursor = (CursorPtr)SecurityLookupIDByType(client,
stuff->cursor, stuff->cursor,
RT_CURSOR, RT_CURSOR,
DixReadAccess); DixReadAccess);
if (!cursor) if (!cursor)
{ {
errval = stuff->cursor; errval = stuff->cursor;
@ -178,11 +178,11 @@ ProcXExtendedGrabDevice(ClientPtr client)
} }
} }
if (CreateMaskFromList(client, if (CreateMaskFromList(client,
(XEventClass*)&stuff[1], (XEventClass*)&stuff[1],
stuff->event_count, stuff->event_count,
tmp, tmp,
dev, dev,
X_GrabDevice) != Success) X_GrabDevice) != Success)
return Success; return Success;
@ -190,7 +190,7 @@ ProcXExtendedGrabDevice(ClientPtr client)
if (stuff->generic_event_count) if (stuff->generic_event_count)
{ {
xgeMask = xgeMask =
(XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count); (XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count);
gemasks = xcalloc(1, sizeof(GenericMaskRec)); gemasks = xcalloc(1, sizeof(GenericMaskRec));
@ -203,16 +203,16 @@ ProcXExtendedGrabDevice(ClientPtr client)
gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask; gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask;
} }
ExtGrabDevice(client, dev, stuff->device_mode, ExtGrabDevice(client, dev, stuff->device_mode,
grab_window, confineTo, time, stuff->owner_events, grab_window, confineTo, time, stuff->owner_events,
cursor, tmp[stuff->deviceid].mask, cursor, tmp[stuff->deviceid].mask,
gemasks); gemasks);
if (err != Success) { if (err != Success) {
errval = 0; errval = 0;
goto cleanup; goto cleanup;
} }
cleanup: cleanup:
if (gemasks) if (gemasks)
@ -221,18 +221,18 @@ cleanup:
if (err == Success) if (err == Success)
{ {
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep); WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
} }
else else
{ {
SendErrorToClient(client, IReqCode, SendErrorToClient(client, IReqCode,
X_ExtendedGrabDevice, X_ExtendedGrabDevice,
errval, err); errval, err);
} }
return Success; return Success;
} }
void void
SRepXExtendedGrabDevice(ClientPtr client, int size, SRepXExtendedGrabDevice(ClientPtr client, int size,
xExtendedGrabDeviceReply* rep) xExtendedGrabDeviceReply* rep)
{ {
char n; char n;

View File

@ -133,7 +133,7 @@ Mask ExtExclusiveMasks[EMASKSIZE];
/** /**
* Filters for various generic events. * Filters for various generic events.
* Evtype is index, mask is value at index. * Evtype is index, mask is value at index.
*/ */
static Mask xi_filters[3] = { static Mask xi_filters[3] = {
@ -355,7 +355,7 @@ ProcIDispatch(ClientPtr client)
/******************************************************************************* /*******************************************************************************
* *
* SProcXDispatch * SProcXDispatch
* *
* Main swapped dispatch routine for requests to this extension. * Main swapped dispatch routine for requests to this extension.
* This routine is used if server and client do not have the same byte ordering. * This routine is used if server and client do not have the same byte ordering.
@ -659,7 +659,7 @@ SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to
swaps(&to->control, n); swaps(&to->control, n);
} }
static void static void
SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to) SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
{ {
char n; char n;
@ -669,7 +669,7 @@ SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
swapl(&to->time, n); swapl(&to->time, n);
} }
static void static void
SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to) SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
{ {
char n; char n;
@ -692,7 +692,7 @@ SRawDeviceEvent(rawDeviceEvent* from, rawDeviceEvent *to)
char n; char n;
int i; int i;
CARD32* valptr; CARD32* valptr;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
@ -704,7 +704,7 @@ SRawDeviceEvent(rawDeviceEvent* from, rawDeviceEvent *to)
} }
static void static void
SDeviceClassesChangedEvent(deviceClassesChangedEvent* from, SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
deviceClassesChangedEvent* to) deviceClassesChangedEvent* to)
{ {
char n; char n;
@ -717,7 +717,7 @@ SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
swapl(&to->length, n); swapl(&to->length, n);
swapl(&to->time, n); swapl(&to->time, n);
/* now swap the actual classes */ /* now swap the actual classes */
any = (xAnyClassPtr)&to[1]; any = (xAnyClassPtr)&to[1];
for (i = 0; i < to->num_classes; i++) for (i = 0; i < to->num_classes; i++)
@ -796,7 +796,7 @@ GetNextExtEventMask(void)
* *
* Since extension event types will never be less than 64, we can use * Since extension event types will never be less than 64, we can use
* 0-63 in the EventInfo array as the "type" to be used to look up this * 0-63 in the EventInfo array as the "type" to be used to look up this
* mask. This means that the corresponding macros such as * mask. This means that the corresponding macros such as
* DevicePointerMotionHint must have access to the same constants. * DevicePointerMotionHint must have access to the same constants.
* *
*/ */
@ -973,7 +973,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
/************************************************************************ /************************************************************************
* *
* This function restores extension event types and masks to their * This function restores extension event types and masks to their
* initial state. * initial state.
* *
*/ */
@ -1189,7 +1189,7 @@ SEventIDispatch(xEvent * from, xEvent * to)
* EventSwap for generic events coming from the GE extension. * EventSwap for generic events coming from the GE extension.
*/ */
static void static void
XIGEEventSwap(xGenericEvent* from, xGenericEvent* to) XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
{ {
int n; int n;
@ -1201,7 +1201,7 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
SRawDeviceEvent((rawDeviceEvent*)from, (rawDeviceEvent*)to); SRawDeviceEvent((rawDeviceEvent*)from, (rawDeviceEvent*)to);
break; break;
case XI_DeviceClassesChangedNotify: case XI_DeviceClassesChangedNotify:
SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from, SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
(deviceClassesChangedEvent*)to); (deviceClassesChangedEvent*)to);
break; break;
} }
@ -1211,8 +1211,8 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
* EventFill to fill various fields for events before they are delivered to * EventFill to fill various fields for events before they are delivered to
* the client. * the client.
*/ */
static void static void
XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev, XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev,
WindowPtr pWin, GrabPtr grab) WindowPtr pWin, GrabPtr grab)
{ {
} }

View File

@ -74,7 +74,7 @@ SProcXFakeDeviceData(ClientPtr client)
return ProcXFakeDeviceData(client);; return ProcXFakeDeviceData(client);;
} }
int int
ProcXFakeDeviceData(ClientPtr client) ProcXFakeDeviceData(ClientPtr client)
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
@ -92,7 +92,7 @@ ProcXFakeDeviceData(ClientPtr client)
dev = LookupDeviceIntRec(stuff->deviceid); dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) { if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_FakeDeviceData, 0, BadDevice); SendErrorToClient(client, IReqCode, X_FakeDeviceData, 0, BadDevice);
return Success; return Success;
} }

View File

@ -74,8 +74,8 @@ int ProcXGetClientPointer(ClientPtr client)
err = dixLookupWindow(&win, stuff->win, client, DixReadAccess); err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_GetClientPointer, SendErrorToClient(client, IReqCode, X_GetClientPointer,
stuff->win, err); stuff->win, err);
return Success; return Success;
} }
@ -99,8 +99,8 @@ int ProcXGetClientPointer(ClientPtr client)
* *
*/ */
void void
SRepXGetClientPointer(ClientPtr client, int size, SRepXGetClientPointer(ClientPtr client, int size,
xGetClientPointerReply* rep) xGetClientPointerReply* rep)
{ {
char n; char n;

View File

@ -62,7 +62,7 @@ SProcXGrabAccessControl(ClientPtr client)
return ProcXGrabAccessControl(client); return ProcXGrabAccessControl(client);
} }
int int
ProcXGrabAccessControl(ClientPtr client) ProcXGrabAccessControl(ClientPtr client)
{ {
xGrabAccessControlReply rep; xGrabAccessControlReply rep;
@ -90,7 +90,7 @@ ProcXGrabAccessControl(ClientPtr client)
*/ */
void void
SRepXGrabAccessControl(ClientPtr client, int size, SRepXGrabAccessControl(ClientPtr client, int size,
xGrabAccessControlReply* rep) xGrabAccessControlReply* rep)
{ {
char n; char n;

View File

@ -147,12 +147,12 @@ ProcXGrabDevice(ClientPtr client)
* *
* This procedure creates an event mask from a list of XEventClasses. * This procedure creates an event mask from a list of XEventClasses.
* *
* Procedure is as follows: * Procedure is as follows:
* An XEventClass is (deviceid << 8 | eventtype). For each entry in the list, * An XEventClass is (deviceid << 8 | eventtype). For each entry in the list,
* get the device. Then run through all available event indices (those are * get the device. Then run through all available event indices (those are
* set when XI starts up) and binary OR's the device's mask to whatever the * set when XI starts up) and binary OR's the device's mask to whatever the
* event mask for the given event type was. * event mask for the given event type was.
* If an error occurs, it is sent to the client. Errors are generated if * If an error occurs, it is sent to the client. Errors are generated if
* - if the device given in the event classs is invalid * - if the device given in the event classs is invalid
* - if the device in the class list is not the device given as parameter (no * - if the device in the class list is not the device given as parameter (no
* error if parameter is NULL) * error if parameter is NULL)

View File

@ -186,7 +186,7 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
dev->use = IsXExtensionPointer; dev->use = IsXExtensionPointer;
else else
dev->use = IsXExtensionDevice; dev->use = IsXExtensionDevice;
if (!d->isMaster) if (!d->isMaster)
dev->attached = (d->u.master) ? d->u.master->id : IsFloating; dev->attached = (d->u.master) ? d->u.master->id : IsFloating;
if (client->swapped) { if (client->swapped) {
@ -225,7 +225,7 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
* *
* Devices may have up to 255 valuators. The length of a ValuatorClass is * Devices may have up to 255 valuators. The length of a ValuatorClass is
* defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo). * defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the * The maximum length is therefore (8 + 255 * 12) = 3068. However, the
* length field is one byte. If a device has more than 20 valuators, we * length field is one byte. If a device has more than 20 valuators, we
* must therefore return multiple valuator classes to the client. * must therefore return multiple valuator classes to the client.
* *

View File

@ -78,8 +78,8 @@ ProcXQueryWindowAccess(ClientPtr client)
err = dixLookupWindow(&win, stuff->win, client, DixReadAccess); err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_QueryWindowAccess, SendErrorToClient(client, IReqCode, X_QueryWindowAccess,
stuff->win, err); stuff->win, err);
return Success; return Success;
} }
@ -100,8 +100,8 @@ ProcXQueryWindowAccess(ClientPtr client)
if (!deviceids) if (!deviceids)
{ {
ErrorF("[Xi] ProcXQueryWindowAccess: xalloc failure.\n"); ErrorF("[Xi] ProcXQueryWindowAccess: xalloc failure.\n");
SendErrorToClient(client, IReqCode, X_QueryWindowAccess, SendErrorToClient(client, IReqCode, X_QueryWindowAccess,
0, BadImplementation); 0, BadImplementation);
return Success; return Success;
} }
@ -117,8 +117,8 @@ ProcXQueryWindowAccess(ClientPtr client)
} }
void void
SRepXQueryWindowAccess(ClientPtr client, SRepXQueryWindowAccess(ClientPtr client,
int size, int size,
xQueryWindowAccessReply* rep) xQueryWindowAccessReply* rep)
{ {
char n; char n;

View File

@ -86,14 +86,14 @@ ProcXQueryDevicePointer(ClientPtr client)
pDev = LookupDeviceIntRec(stuff->deviceid); pDev = LookupDeviceIntRec(stuff->deviceid);
if (pDev == NULL || pDev->valuator == NULL) { if (pDev == NULL || pDev->valuator == NULL) {
SendErrorToClient(client, IReqCode, X_QueryDevicePointer, SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
stuff->deviceid, BadDevice); stuff->deviceid, BadDevice);
return Success; return Success;
} }
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess); rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
if (rc != Success) if (rc != Success)
{ {
SendErrorToClient(client, IReqCode, X_QueryDevicePointer, SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
stuff->win, rc); stuff->win, rc);
return Success; return Success;
} }
@ -111,7 +111,7 @@ ProcXQueryDevicePointer(ClientPtr client)
rep.rootX = pSprite->hot.x; rep.rootX = pSprite->hot.x;
rep.rootY = pSprite->hot.y; rep.rootY = pSprite->hot.y;
rep.child = None; rep.child = None;
rep.shared = (pDev->spriteInfo->spriteOwner) ? xFalse : xTrue; rep.shared = (pDev->spriteInfo->spriteOwner) ? xFalse : xTrue;
if (pSprite->hot.pScreen == pWin->drawable.pScreen) if (pSprite->hot.pScreen == pWin->drawable.pScreen)
{ {
@ -155,7 +155,7 @@ ProcXQueryDevicePointer(ClientPtr client)
*/ */
void void
SRepXQueryDevicePointer(ClientPtr client, int size, SRepXQueryDevicePointer(ClientPtr client, int size,
xQueryDevicePointerReply * rep) xQueryDevicePointerReply * rep)
{ {
char n; char n;

View File

@ -53,12 +53,12 @@ from the author.
/*********************************************************************** /***********************************************************************
* *
* This procedure allows a client to register the pairing of a pointer * This procedure allows a client to register the pairing of a pointer
* with a keyboard. * with a keyboard.
* *
*/ */
int int
SProcXRegisterPairingClient(ClientPtr client) SProcXRegisterPairingClient(ClientPtr client)
{ {
char n; char n;
@ -67,7 +67,7 @@ SProcXRegisterPairingClient(ClientPtr client)
return ProcXRegisterPairingClient(client); return ProcXRegisterPairingClient(client);
} }
int int
ProcXRegisterPairingClient(ClientPtr client) ProcXRegisterPairingClient(ClientPtr client)
{ {
xRegisterPairingClientReply rep; xRegisterPairingClientReply rep;
@ -96,7 +96,7 @@ ProcXRegisterPairingClient(ClientPtr client)
*/ */
void void
SRepXRegisterPairingClient(ClientPtr client, int size, SRepXRegisterPairingClient(ClientPtr client, int size,
xRegisterPairingClientReply* rep) xRegisterPairingClientReply* rep)
{ {
register char n; register char n;

View File

@ -110,7 +110,7 @@ SProcXSendExtensionEvent(ClientPtr client)
/*********************************************************************** /***********************************************************************
* *
* Send an event to some client, as if it had come from an extension input * Send an event to some client, as if it had come from an extension input
* device. * device.
* *
*/ */

View File

@ -88,7 +88,7 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client)
* *
* Caller: ProcXListInputDevices * Caller: ProcXListInputDevices
* *
* This is the implementation-dependent routine to initialize an input * This is the implementation-dependent routine to initialize an input
* device to the point that information about it can be listed. * device to the point that information about it can be listed.
* Some implementations open all input devices when the server is first * Some implementations open all input devices when the server is first
* initialized, and never close them. Other implementations open only * initialized, and never close them. Other implementations open only
@ -100,12 +100,12 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client)
* This procedure should be used by implementations that do not initialize * This procedure should be used by implementations that do not initialize
* all input devices at server startup. It should do device-dependent * all input devices at server startup. It should do device-dependent
* initialization for any devices not previously initialized, and call * initialization for any devices not previously initialized, and call
* AddInputDevice for each of those devices so that a DeviceIntRec will be * AddInputDevice for each of those devices so that a DeviceIntRec will be
* created for them. * created for them.
* *
* The default implementation is to do nothing (assume all input devices * The default implementation is to do nothing (assume all input devices
* are initialized during X server initialization and kept open). * are initialized during X server initialization and kept open).
* The commented-out sample code shows what you might do if you don't want * The commented-out sample code shows what you might do if you don't want
* the default. * the default.
* *
*/ */
@ -114,7 +114,7 @@ void
AddOtherInputDevices(void) AddOtherInputDevices(void)
{ {
/********************************************************************** /**********************************************************************
for each uninitialized device, do something like: for each uninitialized device, do something like:
DeviceIntPtr dev; DeviceIntPtr dev;
DeviceProc deviceProc; DeviceProc deviceProc;
@ -137,7 +137,7 @@ AddOtherInputDevices(void)
* initialized, and never close them. Other implementations open only * initialized, and never close them. Other implementations open only
* the X pointer and keyboard devices during server initialization, * the X pointer and keyboard devices during server initialization,
* and only open other input devices when some client makes an * and only open other input devices when some client makes an
* XOpenDevice request. This entry point is for the latter type of * XOpenDevice request. This entry point is for the latter type of
* implementation. * implementation.
* *
* If the physical device is not already open, do it here. In this case, * If the physical device is not already open, do it here. In this case,

View File

@ -87,7 +87,7 @@ ProcXWarpDevicePointer(ClientPtr client)
if (pDev == NULL) { if (pDev == NULL) {
SendErrorToClient(client, IReqCode, X_WarpDevicePointer, SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
stuff->deviceid, stuff->deviceid,
BadDevice); BadDevice);
return Success; return Success;
} }
@ -96,7 +96,7 @@ ProcXWarpDevicePointer(ClientPtr client)
err = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess); err = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_WarpDevicePointer, SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
stuff->dst_win, err); stuff->dst_win, err);
return Success; return Success;
} }
@ -114,14 +114,14 @@ ProcXWarpDevicePointer(ClientPtr client)
err = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess); err = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess);
if (err != Success) if (err != Success)
{ {
SendErrorToClient(client, IReqCode, X_WarpDevicePointer, SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
stuff->src_win, err); stuff->src_win, err);
return Success; return Success;
} }
winX = src->drawable.x; winX = src->drawable.x;
winY = src->drawable.y; winY = src->drawable.y;
if (src->drawable.pScreen != pSprite->hotPhys.pScreen || if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
x < winX + stuff->src_x || x < winX + stuff->src_x ||
y < winY + stuff->src_y || y < winY + stuff->src_y ||
(stuff->src_width != 0 && (stuff->src_width != 0 &&