No functional change. For the most part, this just replaces the
use of the min/max/etc. variables with direct use in the function
call.

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/xf86Wacom.c | 134 ++++++++++++++------------------------------------------
 1 file changed, 34 insertions(+), 100 deletions(-)

diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 0f55fe1..82cff04 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -161,52 +161,23 @@ wcmInitAxes(DeviceIntPtr pWcm)
        WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
        WacomCommonPtr common = priv->common;
 
-       Atom label;
-       int min, max, min_res, max_res, res;
-       int mode;
-
        /* first valuator: x */
-       label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
-       min = priv->topX;
-       max = priv->bottomX;
-       min_res = 0;
-       max_res = priv->resolX;
-       res = priv->resolX;
-       mode = Absolute;
-
-       wcmInitAxis(pInfo->dev, 0, label, min, max, res, min_res, max_res, 
mode);
+       wcmInitAxis(pInfo->dev, 0, XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X),
+                       priv->topX, priv->bottomX, priv->resolX, 0, 
priv->resolX, Absolute);
 
 
        /* second valuator: y */
-       label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
-       min = priv->topY;
-       max = priv->bottomY;
-       min_res = 0;
-       max_res = priv->resolY;
-       res = priv->resolY;
-       mode = Absolute;
-
-       wcmInitAxis(pInfo->dev, 1, label, min, max, res, min_res, max_res, 
mode);
+       wcmInitAxis(pInfo->dev, 0, XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
+                               priv->topY, priv->bottomY, priv->resolY, 0, 
priv->resolY, Absolute);
 
 
        /* third valuator: pressure */
-       mode = Absolute;
-       min_res = max_res = res = 1;
-       min = 0;
-
        if (!IsPad(priv))
        {
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
-               /* pressure normalized to FILTER_PRESSURE_RES */
-               max = FILTER_PRESSURE_RES;
-               wcmInitAxis(pInfo->dev, 2, label, min, max, res, min_res, 
max_res, mode);
+               wcmInitAxis(pInfo->dev, 2, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE),
+                           0, FILTER_PRESSURE_RES, 1, 1, 1, Absolute);
 
        } else {
-               /* The pad doesn't have a pressure axis, so initialise third
-                * axis as unknown absolute axis on the pad. This way, we
-                * can leave the strip/abswheel axes on later axes and don't
-                * run the danger of clients misinterpreting the axis info
-                */
                wcmInitFillerAxis(pInfo->dev, 2);
        }
 
@@ -214,30 +185,19 @@ wcmInitAxes(DeviceIntPtr pWcm)
        /* fourth valuator: tilt-x, cursor:z-rotation, pad:strip-x */
        if (IsPen(priv))
        {
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X),
-               min = -64;
-               max = 63;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 3, label, min, max, res, min_res, 
max_res, mode);
+               wcmInitAxis(pInfo->dev, 3, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X),
+                           -64, 63, 1, 1, 1, Absolute);
        }
        else if (IsCursor(priv))
        {
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_RZ);
-               min = MIN_ROTATION;
-               max = MIN_ROTATION + MAX_ROTATION_RANGE - 1;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 3, label, min, max, res, min_res, 
max_res, mode);
-       } else if (IsPad(priv) && TabletHasFeature(common, WCM_STRIP))
-       {
-               label = None; /* XXX: what is this axis? */
-               min = 0;
-               max = common->wcmMaxStripX;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 3, label, min, max, res, min_res, 
max_res, mode);
-       } else
+               wcmInitAxis(pInfo->dev, 3, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_RZ),
+                           MIN_ROTATION, MIN_ROTATION + MAX_ROTATION_RANGE - 
1, 1, 1, 1, Absolute);
+       }
+       else if (IsPad(priv) && TabletHasFeature(common, WCM_STRIP))
+       { /* XXX: what is this axis? */
+               wcmInitAxis(pInfo->dev, 3, None, 0, common->wcmMaxStripX, 1, 1, 
1, Absolute);
+       }
+       else
        {
                wcmInitFillerAxis(pInfo->dev, 3);
        }
@@ -246,30 +206,19 @@ wcmInitAxes(DeviceIntPtr pWcm)
        /* fifth valuator: tilt-y, cursor:throttle, pad:strip-y */
        if (IsPen(priv))
        {
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y);
-               min = -64;
-               max = 63;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 4, label, min, max, res, min_res, 
max_res, mode);
+               wcmInitAxis(pInfo->dev, 4, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y),
+                           -64, 63, 1, 1, 1, Absolute);
        }
        else if (IsCursor(priv))
        {
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_THROTTLE);
-               min = -1023;
-               max = 1023;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 4, label, min, max, res, min_res, 
max_res, mode);
-       } else if (IsPad(priv) && TabletHasFeature(common, WCM_STRIP))
-       {
-               label = None; /* XXX: what is this axis? */
-               min = 0;
-               max = common->wcmMaxStripY;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 4, label, min, max, res, min_res, 
max_res, mode);
-       } else
+               wcmInitAxis(pInfo->dev, 4, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_THROTTLE),
+                           -1032, 1023, 1, 1, 1, Absolute);
+       }
+       else if (IsPad(priv) && TabletHasFeature(common, WCM_STRIP))
+       { /* XXX: what is this axis? */
+               wcmInitAxis(pInfo->dev, 4, None, 0, common->wcmMaxStripY, 1, 1, 
1, Absolute);
+       }
+       else
        {
                wcmInitFillerAxis(pInfo->dev, 4);
        }
@@ -278,21 +227,13 @@ wcmInitAxes(DeviceIntPtr pWcm)
        /* sixth valuator: airbrush: abs-wheel, artpen: rotation, pad:abs-wheel 
*/
        if (IsStylus(priv))
        {
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL);
-               max = MAX_ROTATION_RANGE + MIN_ROTATION - 1;
-               min = MIN_ROTATION;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 5, label, min, max, res, min_res, 
max_res, mode);
-       } else if ((TabletHasFeature(common, WCM_RING)) && IsPad(priv))
-       {
-               /* Touch ring */
-               label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL);
-               min = MIN_PAD_RING;
-               max = MAX_PAD_RING;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-               wcmInitAxis(pInfo->dev, 5, label, min, max, res, min_res, 
max_res, mode);
+               wcmInitAxis(pInfo->dev, 5, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL),
+                           MIN_ROTATION, MIN_ROTATION + MAX_ROTATION_RANGE - 
1, 1, 1, 1, Absolute);
+       }
+       else if ((TabletHasFeature(common, WCM_RING)) && IsPad(priv))
+       {
+               wcmInitAxis(pInfo->dev, 5, 
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL),
+                           MIN_PAD_RING, MAX_PAD_RING, 1, 1, 1, Absolute);
        }
        else
        {
@@ -303,14 +244,7 @@ wcmInitAxes(DeviceIntPtr pWcm)
        /* seventh valuator: abswheel2 */
        if ((TabletHasFeature(common, WCM_DUALRING)) && IsPad(priv))
        {
-               /* Second touch ring */
-               label = None;
-               min = MIN_PAD_RING;
-               max = MAX_PAD_RING;
-               min_res = max_res = res = 1;
-               mode = Absolute;
-
-               wcmInitAxis(pInfo->dev, 6, label, min, max, res, min_res, 
max_res, mode);
+               wcmInitAxis(pInfo->dev, 6, None, MIN_PAD_RING, MAX_PAD_RING, 1, 
1, 1, Absolute);
        }
        else
        {
-- 
1.7.11


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to