[PATCH evdev 2/4] Don't pass pointers around to first_v and num_v.

Peter Hutterer peter.hutterer at who-t.net
Sun Oct 10 16:23:20 PDT 2010


We only use them as values, no need for the addresses.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c |   16 ++++++++--------
 src/evdev.h |    4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index e5b3065..b634ab4 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -612,13 +612,13 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
  * Post the relative motion events.
  */
 void
-EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
+EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
                               int v[MAX_VALUATORS])
 {
     EvdevPtr pEvdev = pInfo->private;
 
     if (pEvdev->rel) {
-        xf86PostMotionEventP(pInfo->dev, FALSE, *first_v, *num_v, v + *first_v);
+        xf86PostMotionEventP(pInfo->dev, FALSE, first_v, num_v, v + first_v);
     }
 }
 
@@ -626,7 +626,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,
+EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
                               int v[MAX_VALUATORS])
 {
     EvdevPtr pEvdev = pInfo->private;
@@ -641,14 +641,14 @@ EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
      * just work.
      */
     if (pEvdev->abs && pEvdev->tool) {
-        xf86PostMotionEventP(pInfo->dev, TRUE, *first_v, *num_v, v);
+        xf86PostMotionEventP(pInfo->dev, TRUE, first_v, num_v, v);
     }
 }
 
 /**
  * Post the queued key/button events.
  */
-static void EvdevPostQueuedEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
+static void EvdevPostQueuedEvents(InputInfoPtr pInfo, int num_v, int first_v,
                                   int v[MAX_VALUATORS])
 {
     int i;
@@ -684,9 +684,9 @@ EvdevProcessSyncEvent(InputInfoPtr pInfo, struct input_event *ev)
 
     EvdevProcessValuators(pInfo, v, &num_v, &first_v);
 
-    EvdevPostRelativeMotionEvents(pInfo, &num_v, &first_v, v);
-    EvdevPostAbsoluteMotionEvents(pInfo, &num_v, &first_v, v);
-    EvdevPostQueuedEvents(pInfo, &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);
 
     memset(pEvdev->delta, 0, sizeof(pEvdev->delta));
     memset(pEvdev->queue, 0, sizeof(pEvdev->queue));
diff --git a/src/evdev.h b/src/evdev.h
index 4945140..ce7f5f8 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -200,9 +200,9 @@ void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
 void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
 void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value);
 void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
-void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
+void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
 				   int v[MAX_VALUATORS]);
-void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
+void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
 				   int v[MAX_VALUATORS]);
 unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
 
-- 
1.7.2.3



More information about the xorg-devel mailing list