diff --git a/dix/devices.c b/dix/devices.c index 7f3886507..0c62a012d 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1332,13 +1332,10 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, /* global list of acceleration schemes */ ValuatorAccelerationRec pointerAccelerationScheme[] = { - {PtrAccelNoOp, NULL, NULL, NULL, NULL} - , + {PtrAccelNoOp, NULL, NULL, NULL, NULL}, {PtrAccelPredictable, acceleratePointerPredictable, NULL, - InitPredictableAccelerationScheme, AccelerationDefaultCleanup} - , - {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL} - , + InitPredictableAccelerationScheme, AccelerationDefaultCleanup}, + {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL}, {-1, NULL, NULL, NULL, NULL} /* terminator */ }; @@ -1375,8 +1372,7 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme) if (pointerAccelerationScheme[i].AccelInitProc) { if (!pointerAccelerationScheme[i].AccelInitProc(dev, - &pointerAccelerationScheme - [i])) { + &pointerAccelerationScheme[i])) { return FALSE; } } diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index a788575ca..338f415c5 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -788,7 +788,8 @@ ComputeAcceleration(DeviceIntPtr dev, result += 4.0f * BasicComputeAcceleration(dev, vel, (vel->last_velocity + - vel->velocity) / 2, threshold, + vel->velocity) / 2, + threshold, acc); result /= 6.0f; DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n", diff --git a/include/ptrveloc.h b/include/ptrveloc.h index 8778646f5..3bd982a90 100644 --- a/include/ptrveloc.h +++ b/include/ptrveloc.h @@ -101,48 +101,43 @@ typedef struct _PredictableAccelSchemeRec { } PredictableAccelSchemeRec, *PredictableAccelSchemePtr; extern _X_EXPORT void - InitVelocityData(DeviceVelocityPtr vel); +InitVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT void - InitTrackers(DeviceVelocityPtr vel, int ntracker); +InitTrackers(DeviceVelocityPtr vel, int ntracker); extern _X_EXPORT BOOL ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time); extern _X_EXPORT double - BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc); extern _X_EXPORT void - FreeVelocityData(DeviceVelocityPtr vel); +FreeVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT int - SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); +SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); extern _X_EXPORT DeviceVelocityPtr GetDevicePredictableAccelData(DeviceIntPtr dev); extern _X_EXPORT void - SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, PointerAccelerationProfileFunc profile); extern _X_INTERNAL void - AccelerationDefaultCleanup(DeviceIntPtr dev); +AccelerationDefaultCleanup(DeviceIntPtr dev); extern _X_INTERNAL Bool - InitPredictableAccelerationScheme(DeviceIntPtr dev, struct _ValuatorAccelerationRec *protoScheme); extern _X_INTERNAL void - acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime); extern _X_INTERNAL void - acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime);