diff options
author | Éric Brunet <Eric.Brunet@lps.ens.fr> | 2014-09-27 22:06:36 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-09-29 11:18:16 +1000 |
commit | 605047613c534babf723f25597e8cc4be6758db0 (patch) | |
tree | d29fe1d46ce614dcc168bbdb27c6d6f350bcd1a6 /src/evdev.c | |
parent | Drop some unused #defines (diff) | |
download | xf86-input-evdev-605047613c534babf723f25597e8cc4be6758db0.tar.gz xf86-input-evdev-605047613c534babf723f25597e8cc4be6758db0.tar.bz2 xf86-input-evdev-605047613c534babf723f25597e8cc4be6758db0.zip |
Don't pass superfluous arguments to EvdevPost*Events
The functions EvdevPostProximityEvents, EvdevPostRelativeMotionEvents,
EvdevPostAbsoluteMotionEvents and EvdevPostQueuedEvents are only called
by EvdevProcessSyncEvent. These functions take as arguments an array of
valuators which is set by EvdevProcessSyncEvent to contain ... nothing.
This patch changes the prototype of the four functions, their definitions
and the way they are called to remove the useless array of valuators.
Signed-off-by: Éric Brunet <Eric.Brunet@lps.ens.fr>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/evdev.c b/src/evdev.c index a95c6be..8eb749a 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -868,8 +868,7 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev) * Post the relative motion events. */ void -EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v, - int v[MAX_VALUATORS]) +EvdevPostRelativeMotionEvents(InputInfoPtr pInfo) { EvdevPtr pEvdev = pInfo->private; @@ -882,8 +881,7 @@ EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v, * Post the absolute motion events. */ void -EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v, - int v[MAX_VALUATORS]) +EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo) { EvdevPtr pEvdev = pInfo->private; @@ -902,8 +900,7 @@ EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v, } static void -EvdevPostProximityEvents(InputInfoPtr pInfo, int which, int num_v, int first_v, - int v[MAX_VALUATORS]) +EvdevPostProximityEvents(InputInfoPtr pInfo, int which) { int i; EvdevPtr pEvdev = pInfo->private; @@ -918,8 +915,7 @@ EvdevPostProximityEvents(InputInfoPtr pInfo, int which, int num_v, int first_v, break; case EV_QUEUE_PROXIMITY: if (pEvdev->queue[i].val == which) - xf86PostProximityEventP(pInfo->dev, which, first_v, num_v, - v + first_v); + xf86PostProximityEvent(pInfo->dev, which, 0, 0); break; } } @@ -928,8 +924,7 @@ EvdevPostProximityEvents(InputInfoPtr pInfo, int which, int num_v, int first_v, /** * Post the queued key/button events. */ -static void EvdevPostQueuedEvents(InputInfoPtr pInfo, int num_v, int first_v, - int v[MAX_VALUATORS]) +static void EvdevPostQueuedEvents(InputInfoPtr pInfo) { int i; EvdevPtr pEvdev = pInfo->private; @@ -947,9 +942,8 @@ static void EvdevPostQueuedEvents(InputInfoPtr pInfo, int num_v, int first_v, break; if (pEvdev->abs_queued && pEvdev->in_proximity) { - xf86PostButtonEventP(pInfo->dev, Absolute, pEvdev->queue[i].detail.key, - pEvdev->queue[i].val, first_v, num_v, - v + first_v); + xf86PostButtonEvent(pInfo->dev, Absolute, pEvdev->queue[i].detail.key, + pEvdev->queue[i].val, 0, 0); } else xf86PostButtonEvent(pInfo->dev, Relative, pEvdev->queue[i].detail.key, @@ -976,8 +970,6 @@ static void EvdevProcessSyncEvent(InputInfoPtr pInfo, struct input_event *ev) { int i; - int num_v = 0, first_v = 0; - int v[MAX_VALUATORS] = {}; EvdevPtr pEvdev = pInfo->private; EvdevProcessProximityState(pInfo); @@ -985,11 +977,11 @@ EvdevProcessSyncEvent(InputInfoPtr pInfo, struct input_event *ev) EvdevProcessValuators(pInfo); EvdevProcessTouch(pInfo); - EvdevPostProximityEvents(pInfo, TRUE, num_v, first_v, v); - EvdevPostRelativeMotionEvents(pInfo, num_v, first_v, v); - EvdevPostAbsoluteMotionEvents(pInfo, num_v, first_v, v); - EvdevPostQueuedEvents(pInfo, num_v, first_v, v); - EvdevPostProximityEvents(pInfo, FALSE, num_v, first_v, v); + EvdevPostProximityEvents(pInfo, TRUE); + EvdevPostRelativeMotionEvents(pInfo); + EvdevPostAbsoluteMotionEvents(pInfo); + EvdevPostQueuedEvents(pInfo); + EvdevPostProximityEvents(pInfo, FALSE); memset(pEvdev->delta, 0, sizeof(pEvdev->delta)); for (i = 0; i < ArrayLength(pEvdev->queue); i++) |