summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉric Brunet <Eric.Brunet@lps.ens.fr>2014-09-27 22:06:36 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2014-09-29 11:18:16 +1000
commit605047613c534babf723f25597e8cc4be6758db0 (patch)
treed29fe1d46ce614dcc168bbdb27c6d6f350bcd1a6
parent3ee98d0b7f7c266b8c7954b7710f9724a9c9cddd (diff)
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>
-rw-r--r--src/evdev.c32
-rw-r--r--src/evdev.h6
2 files changed, 14 insertions, 24 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++)
diff --git a/src/evdev.h b/src/evdev.h
index 2d6b62d..2a010e6 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -265,10 +265,8 @@ void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
#endif
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
-void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
- int v[MAX_VALUATORS]);
-void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
- int v[MAX_VALUATORS]);
+void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo);
+void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo);
unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
/* Middle Button emulation */