[PATCH v2] dix: fix ptraccel debugging printfs
Peter Hutterer
peter.hutterer at who-t.net
Thu Feb 7 20:10:35 PST 2013
This is mostly sigsafe code, so use sigsave printf. And update some fields
to double that used to be int.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Changes to v1:
- don't change the length modifiers to %f printfs, this patch is now after
the addition of pnprintf length modifier handling in the series
dix/ptrveloc.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index c7994b0..b95f194 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -77,7 +77,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
/*#define PTRACCEL_DEBUGGING*/
#ifdef PTRACCEL_DEBUGGING
-#define DebugAccelF ErrorF
+#define DebugAccelF ErrorFSigSafe
#else
#define DebugAccelF(...) /* */
#endif
@@ -566,7 +566,7 @@ FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t)
vel->tracker[n].dy = 0.0;
vel->tracker[n].time = cur_t;
vel->tracker[n].dir = GetDirection(dx, dy);
- DebugAccelF("(dix prtacc) motion [dx: %i dy: %i dir:%i diff: %i]\n",
+ DebugAccelF("(dix prtacc) motion [dx: %f dy: %f dir:%d diff: %d]\n",
dx, dy, vel->tracker[n].dir,
cur_t - vel->tracker[vel->cur_tracker].time);
vel->cur_tracker = n;
@@ -667,7 +667,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
#ifdef PTRACCEL_DEBUGGING
MotionTracker *tracker = TRACKER(vel, used_offset);
- DebugAccelF("(dix prtacc) result: offset %i [dx: %i dy: %i diff: %i]\n",
+ DebugAccelF("(dix prtacc) result: offset %i [dx: %f dy: %f diff: %i]\n",
used_offset, tracker->dx, tracker->dy,
cur_t - tracker->time);
#endif
@@ -799,7 +799,7 @@ ComputeAcceleration(DeviceIntPtr dev,
result = BasicComputeAcceleration(dev, vel,
vel->velocity, threshold, acc);
DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n",
- vel->velocity, res);
+ vel->velocity, result);
}
return result;
@@ -1122,8 +1122,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime)
valuator_mask_set_double(val, 0, mult * dx);
if (dy != 0.0)
valuator_mask_set_double(val, 1, mult * dy);
- DebugAccelF("pos (%i | %i) delta x:%.3f y:%.3f\n", mult * dx,
- mult * dy);
+ DebugAccelF("delta x:%.3f y:%.3f\n", mult * dx, mult * dy);
}
}
}
--
1.8.1
More information about the xorg-devel
mailing list