These variables are currently used only within wcmUpdateOldState and can be passed in as arguments rather than held as variables in the device struct.
Signed-off-by: Jason Gerecke <killert...@gmail.com> --- src/wcmCommon.c | 14 +++++--------- src/xf86WacomDefs.h | 2 -- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index d27ad6d..eae1ad6 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -485,16 +485,15 @@ void wcmRotateAndScaleCoordinates(InputInfoPtr pInfo, int* x, int* y) } static void wcmUpdateOldState(const InputInfoPtr pInfo, - const WacomDeviceState *ds) + const WacomDeviceState *ds, int currentX, int currentY) { const WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; priv->oldWheel = ds->abswheel; priv->oldWheel2 = ds->abswheel2; priv->oldButtons = ds->buttons; - - priv->oldX = priv->currentX; - priv->oldY = priv->currentY; + priv->oldX = currentX; + priv->oldY = currentY; priv->oldZ = ds->pressure; priv->oldTiltX = ds->tiltx; priv->oldTiltY = ds->tilty; @@ -695,13 +694,10 @@ void wcmSendEvents(InputInfoPtr pInfo, const WacomDeviceState* ds) x, y, z, v3, v4, v5, v6, id, serial, is_button ? "true" : "false", ds->buttons); - priv->currentX = x; - priv->currentY = y; - /* update the old records */ if(!priv->oldProximity) { - wcmUpdateOldState(pInfo, ds); + wcmUpdateOldState(pInfo, ds, x, y); priv->oldButtons = 0; } @@ -723,7 +719,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const WacomDeviceState* ds) priv->oldProximity = ds->proximity; if (ds->proximity) - wcmUpdateOldState(pInfo, ds); + wcmUpdateOldState(pInfo, ds, x, y); else { priv->oldButtons = 0; diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h index 8be7103..f40f654 100644 --- a/src/xf86WacomDefs.h +++ b/src/xf86WacomDefs.h @@ -250,8 +250,6 @@ struct _WacomDeviceRec WacomCommonPtr common; /* common info pointer */ /* state fields in device coordinates */ - int currentX; /* current X position */ - int currentY; /* current Y position */ int oldX; /* previous X position */ int oldY; /* previous Y position */ int oldZ; /* previous pressure */ -- 1.9.2 ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel