[PATCH 06/30] dix: Only set used_offset when PTRACCEL_DEBUGGING is defined.

Cyril Brulebois kibi at debian.org
Fri May 20 08:35:16 PDT 2011


Signed-off-by: Cyril Brulebois <kibi at debian.org>
---
 dix/ptrveloc.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index dfccf15..0842789 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -595,7 +595,10 @@ CalcTracker(const MotionTracker *tracker, int cur_t){
  */
 static float
 QueryTrackers(DeviceVelocityPtr vel, int cur_t){
-    int offset, dir = UNDEFINED, used_offset = -1, age_ms;
+    int offset, dir = UNDEFINED, age_ms;
+#ifdef PTRACCEL_DEBUGGING
+    int used_offset = -1;
+#endif
     /* initial velocity: a low-offset, valid velocity */
     float initial_velocity = 0, result = 0, velocity_diff;
     float velocity_factor =  vel->corr_mul * vel->const_acceleration; /* premultiply */
@@ -631,7 +634,9 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t){
 	if ((initial_velocity == 0 || offset <= vel->initial_range) && tracker_velocity != 0) {
 	    /* set initial velocity and result */
 	    result = initial_velocity = tracker_velocity;
+#ifdef PTRACCEL_DEBUGGING
 	    used_offset = offset;
+#endif
 	} else if (initial_velocity != 0 && tracker_velocity != 0) {
 	    velocity_diff = fabs(initial_velocity - tracker_velocity);
 
@@ -647,12 +652,16 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t){
 	     * so this result is likely better
 	     * (it contains more information). */
 	    result = tracker_velocity;
+#ifdef PTRACCEL_DEBUGGING
 	    used_offset = offset;
+#endif
 	}
     }
     if(offset == vel->num_tracker){
 	DebugAccelF("(dix prtacc) query: last tracker in effect\n");
+#ifdef PTRACCEL_DEBUGGING
 	used_offset = vel->num_tracker-1;
+#endif
     }
 #ifdef PTRACCEL_DEBUGGING
     if(used_offset >= 0){
-- 
1.7.5.1



More information about the xorg-devel mailing list