diff options
-rw-r--r-- | Xi/extinit.c | 12 | ||||
-rw-r--r-- | Xi/selectev.c | 4 | ||||
-rw-r--r-- | dix/devices.c | 16 | ||||
-rw-r--r-- | dix/events.c | 10 | ||||
-rw-r--r-- | include/inputstr.h | 4 | ||||
-rw-r--r-- | include/misc.h | 1 | ||||
-rw-r--r-- | include/windowstr.h | 4 | ||||
-rw-r--r-- | render/animcur.c | 4 |
8 files changed, 27 insertions, 28 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c index 8b21bd998..e222de6ed 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -340,7 +340,7 @@ int RT_INPUTCLIENT; extern XExtensionVersion AllExtensionVersions[]; -Mask PropagateMask[MAX_DEVICES]; +Mask PropagateMask[MAXDEVICES]; /***************************************************************** * @@ -680,7 +680,7 @@ AllowPropagateSuppress(Mask mask) { int i; - for (i = 0; i < MAX_DEVICES; i++) + for (i = 0; i < MAXDEVICES; i++) PropagateMask[i] |= mask; } @@ -701,7 +701,7 @@ GetNextExtEventMask(void) } lastExtEventMask <<= 1; - for (i = 0; i < MAX_DEVICES; i++) + for (i = 0; i < MAXDEVICES; i++) ExtValidMasks[i] |= mask; return mask; } @@ -739,7 +739,7 @@ SetExclusiveAccess(Mask mask) { int i; - for (i = 0; i < MAX_DEVICES; i++) + for (i = 0; i < MAXDEVICES; i++) ExtExclusiveMasks[i] |= mask; } @@ -760,7 +760,7 @@ SetMaskForExtEvent(Mask mask, int event) if ((event < LASTEvent) || (event >= 128)) FatalError("MaskForExtensionEvent: bogus event number"); - for (i = 0; i < MAX_DEVICES; i++) + for (i = 0; i < MAXDEVICES; i++) SetMaskForEvent(i, mask, event); } @@ -914,7 +914,7 @@ RestoreExtensionEvents(void) for (i = 0; i < ExtEventIndex - 1; i++) { if ((EventInfo[i].type >= LASTEvent) && (EventInfo[i].type < 128)) { - for (j = 0; j < MAX_DEVICES; j++) + for (j = 0; j < MAXDEVICES; j++) SetMaskForEvent(j, 0, EventInfo[i].type); } EventInfo[i].mask = 0; diff --git a/Xi/selectev.c b/Xi/selectev.c index 53d8f7408..9c336fce5 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.c @@ -106,10 +106,10 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win, if (mask == 0) return Success; - /* We always only use mksidx = MAX_DEVICES for events not bound to + /* We always only use mksidx = MAXDEVICES for events not bound to * devices */ - if (AddExtensionClient (win, client, mask, MAX_DEVICES) != Success) + if (AddExtensionClient (win, client, mask, MAXDEVICES) != Success) return BadAlloc; RecalculateDeviceDeliverableEvents(win); diff --git a/dix/devices.c b/dix/devices.c index 3f6d56008..abefc2e33 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -143,19 +143,19 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) DeviceIntPtr dev, *prev; /* not a typo */ DeviceIntPtr devtmp; int devid; - char devind[MAX_DEVICES]; + char devind[MAXDEVICES]; BOOL enabled; /* Find next available id */ - memset(devind, 0, sizeof(char)*MAX_DEVICES); + memset(devind, 0, sizeof(char)*MAXDEVICES); for (devtmp = inputInfo.devices; devtmp; devtmp = devtmp->next) devind[devtmp->id]++; for (devtmp = inputInfo.off_devices; devtmp; devtmp = devtmp->next) devind[devtmp->id]++; - for (devid = 0; devid < MAX_DEVICES && devind[devid]; devid++) + for (devid = 0; devid < MAXDEVICES && devind[devid]; devid++) ; - if (devid >= MAX_DEVICES) + if (devid >= MAXDEVICES) return (DeviceIntPtr)NULL; dev = xcalloc(sizeof(DeviceIntRec) + sizeof(SpriteInfoRec), 1); if (!dev) @@ -291,7 +291,7 @@ EnableDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceEnabled; ev.deviceid = dev->id; - dummyDev.id = MAX_DEVICES; + dummyDev.id = MAXDEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -369,7 +369,7 @@ DisableDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceDisabled; ev.deviceid = dev->id; - dummyDev.id = MAX_DEVICES; + dummyDev.id = MAXDEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -409,7 +409,7 @@ ActivateDevice(DeviceIntPtr dev) ev.deviceid = dev->id; memset(&dummyDev, 0, sizeof(DeviceIntRec)); - dummyDev.id = MAX_DEVICES; + dummyDev.id = MAXDEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -973,7 +973,7 @@ RemoveDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceRemoved; ev.deviceid = deviceid; - dummyDev.id = MAX_DEVICES; + dummyDev.id = MAXDEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); } diff --git a/dix/events.c b/dix/events.c index 952a801cd..aa10b02d6 100644 --- a/dix/events.c +++ b/dix/events.c @@ -372,7 +372,7 @@ extern int DeviceMotionNotify; * is initialized. The rest is memcpy'd in InitEvents. */ #define CantBeFiltered NoEventMask -static Mask filters[MAX_DEVICES][128] = { +static Mask filters[MAXDEVICES][128] = { { NoSuchEvent, /* 0 */ NoSuchEvent, /* 1 */ @@ -794,7 +794,7 @@ void SetMaskForEvent(int deviceid, Mask mask, int event) { int coretype; - if (deviceid < 0 || deviceid > MAX_DEVICES) + if (deviceid < 0 || deviceid > MAXDEVICES) FatalError("SetMaskForEvent: bogus device id"); if ((event < LASTEvent) || (event >= 128)) FatalError("SetMaskForEvent: bogus event number"); @@ -5451,7 +5451,7 @@ InitEvents(void) inputInfo.pointer = (DeviceIntPtr)NULL; lastEventMask = OwnerGrabButtonMask; filters[0][PointerMotionMask] = MotionNotify; - for (i = 1; i < MAX_DEVICES; i++) + for (i = 1; i < MAXDEVICES; i++) { memcpy(&filters[i], filters[0], sizeof(filters[0])); } @@ -6405,7 +6405,7 @@ EnterLeaveSemaphoresIsset(WindowPtr win) int i; sem = (FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey); - for (i = 0; i < (MAX_DEVICES + 7)/8; i++) + for (i = 0; i < (MAXDEVICES + 7)/8; i++) set += sem->enterleave[i]; return set; @@ -6422,7 +6422,7 @@ FocusSemaphoresIsset(WindowPtr win) int i; sem = (FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey); - for (i = 0; i < (MAX_DEVICES + 7)/8; i++) + for (i = 0; i < (MAXDEVICES + 7)/8; i++) set += sem->focusinout[i]; return set; diff --git a/include/inputstr.h b/include/inputstr.h index c74a4b108..9591d2f19 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -64,9 +64,7 @@ SOFTWARE. #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) -#define MAX_DEVICES 20 - -#define EMASKSIZE MAX_DEVICES + 1 +#define EMASKSIZE MAXDEVICES + 1 extern DevPrivateKey CoreDevicePrivateKey; diff --git a/include/misc.h b/include/misc.h index 0107a302d..3ecc9f27c 100644 --- a/include/misc.h +++ b/include/misc.h @@ -89,6 +89,7 @@ extern unsigned long serverGeneration; #define MAXCLIENTS 256 #define MAXEXTENSIONS 128 #define MAXFORMATS 8 +#define MAXDEVICES 20 /* input devices */ typedef unsigned long PIXEL; typedef unsigned long ATOM; diff --git a/include/windowstr.h b/include/windowstr.h index 13ce60bdd..9bdcadd1e 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -253,8 +253,8 @@ extern DevPrivateKey FocusPrivatesKey; * window/has focus. */ typedef struct _FocusSemaphores { - char enterleave[(MAX_DEVICES + 7)/8]; - char focusinout[(MAX_DEVICES + 7)/8]; + char enterleave[(MAXDEVICES + 7)/8]; + char focusinout[(MAXDEVICES + 7)/8]; } FocusSemaphoresRec, *FocusSemaphoresPtr; #ifdef XEVIE diff --git a/render/animcur.c b/render/animcur.c index 5723442fa..d80094d98 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -82,7 +82,7 @@ typedef struct _AnimCurState { } AnimCurStateRec, *AnimCurStatePtr; /* What a waste. But we need an API change to alloc it per device only. */ -static AnimCurStateRec animCurState[MAX_DEVICES]; +static AnimCurStateRec animCurState[MAXDEVICES]; static unsigned char empty[4]; @@ -354,7 +354,7 @@ AnimCurInit (ScreenPtr pScreen) { int i; AnimCurGeneration = serverGeneration; - for (i = 0; i < MAX_DEVICES; i++) { + for (i = 0; i < MAXDEVICES; i++) { animCurState[i].pCursor = 0; animCurState[i].pScreen = 0; animCurState[i].elt = 0; |