minor pointer accel fixes
Peter Hutterer
peter.hutterer at who-t.net
Sun May 13 21:45:51 PDT 2012
On Sun, May 13, 2012 at 01:08:05PM +0200, Simon Thum wrote:
> Hi all,
>
> I polished some indentation fallout in pointer acceleration code and
> removed a warning that came to my attention. Nothing serious.
both applied, thanks.
Cheers,
Peter
> From ad233d795b8c4eeb2f29a583441720c357c92706 Mon Sep 17 00:00:00 2001
> From: Simon Thum <simon.thum at gmx.de>
> Date: Mon, 2 Apr 2012 18:49:53 +0200
> Subject: [PATCH 1/2] dix: indentation fixes for pointer acceleration
>
> Signed-off-by: Simon Thum <simon.thum at gmx.de>
> ---
> dix/devices.c | 12 ++++--------
> dix/ptrveloc.c | 7 ++++---
> include/ptrveloc.h | 15 +++++----------
> 3 files changed, 13 insertions(+), 21 deletions(-)
>
> diff --git a/dix/devices.c b/dix/devices.c
> index 7f38865..0c62a01 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 acbb479..28d90a6 100644
> --- a/dix/ptrveloc.c
> +++ b/dix/ptrveloc.c
> @@ -62,9 +62,9 @@
>
> /* fwds */
> int
> - SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
> -static double
> +SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
>
> +static double
> SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity,
> double threshold, double acc);
> static PointerAccelerationProfileFunc
> @@ -791,7 +791,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 8778646..3bd982a 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);
>
> --
> 1.7.3.4
>
> From 604571639f156f3303361cb57c984664534c6812 Mon Sep 17 00:00:00 2001
> From: Simon Thum <simon.thum at gmx.de>
> Date: Sun, 13 May 2012 13:05:51 +0200
> Subject: [PATCH 2/2] dix: remove redundant declaration
>
> Signed-off-by: Simon Thum <simon.thum at gmx.de>
> ---
> dix/ptrveloc.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
> index 28d90a6..338f415 100644
> --- a/dix/ptrveloc.c
> +++ b/dix/ptrveloc.c
> @@ -61,9 +61,6 @@
> ****************************************************************************/
>
> /* fwds */
> -int
> -SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
> -
> static double
> SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity,
> double threshold, double acc);
> --
> 1.7.3.4
>
More information about the xorg
mailing list