diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2022-01-12 09:25:23 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-01-17 09:12:20 +1000 |
commit | ed877d62d292e8198d496be015a024d095f20e7b (patch) | |
tree | a616de1a95ba68ca0a2376b661030fd34436d8cb | |
parent | 55b14facb4810e77157e76857d28c3bff0050953 (diff) | |
download | xf86-input-wacom-ed877d62d292e8198d496be015a024d095f20e7b.tar.gz |
Change the v3-v6 debug holders to an array
This removes the compiler warnings when DEBUG is undefined, they're all
only used for debug logging but we don't want to ifdef them everywhere.
v5 is the only one "used" but only to re-calculate things.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/wcmCommon.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index ef63bad..bb6e164 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -840,7 +840,7 @@ void wcmSendEvents(WacomDevicePtr priv, const WacomDeviceState* ds) int z = ds->pressure; int tx = ds->tiltx; int ty = ds->tilty; - int v3, v4, v5, v6; + int v[7] = {0}; WacomAxisData axes = {0}; if (priv->serial && serial != priv->serial) @@ -872,8 +872,8 @@ void wcmSendEvents(WacomDevicePtr priv, const WacomDeviceState* ds) wcmAxisSet(&axes, WACOM_AXIS_STRIP_Y, ds->stripy); wcmAxisSet(&axes, WACOM_AXIS_RING, ds->abswheel); wcmAxisSet(&axes, WACOM_AXIS_RING2, ds->abswheel2); - v3 = ds->stripx; - v4 = ds->stripy; + v[3] = ds->stripx; + v[4] = ds->stripy; /* use tx and ty to report stripx and stripy for the DBG below */ tx = ds->stripx; ty = ds->stripy; @@ -881,14 +881,14 @@ void wcmSendEvents(WacomDevicePtr priv, const WacomDeviceState* ds) { wcmAxisSet(&axes, WACOM_AXIS_ROTATION, ds->rotation); wcmAxisSet(&axes, WACOM_AXIS_THROTTLE, ds->throttle); - v3 = ds->rotation; - v4 = ds->throttle; + v[3] = ds->rotation; + v[4] = ds->throttle; } else { wcmAxisSet(&axes, WACOM_AXIS_TILT_X, tx); wcmAxisSet(&axes, WACOM_AXIS_TILT_Y, ty); - v3 = tx; - v4 = ty; + v[3] = tx; + v[4] = ty; } @@ -905,19 +905,19 @@ void wcmSendEvents(WacomDevicePtr priv, const WacomDeviceState* ds) if (ds->proximity) wcmRotateAndScaleCoordinates(priv, &x, &y); - v5 = ds->abswheel; - v6 = ds->abswheel2; + v[5] = ds->abswheel; + v[6] = ds->abswheel2; if (IsStylus(priv) && !IsArtPen(ds)) { /* Normalize abswheel airbrush data to Art Pen rotation range. * We do not normalize Art Pen. They are already at the range. */ - v5 = ds->abswheel * MAX_ROTATION_RANGE/ + v[5] = ds->abswheel * MAX_ROTATION_RANGE/ (double)MAX_ABS_WHEEL + MIN_ROTATION; - wcmAxisSet(&axes, WACOM_AXIS_WHEEL, v5); + wcmAxisSet(&axes, WACOM_AXIS_WHEEL, v[5]); } else if (IsStylus(priv) && IsArtPen(ds)) { - wcmAxisSet(&axes, WACOM_AXIS_WHEEL, v5); + wcmAxisSet(&axes, WACOM_AXIS_WHEEL, v[5]); } DBG(6, priv, "%s prox=%d\tx=%d" @@ -925,7 +925,7 @@ void wcmSendEvents(WacomDevicePtr priv, const WacomDeviceState* ds) "\tserial=%u\tbutton=%s\tbuttons=%d\n", is_absolute(priv) ? "abs" : "rel", ds->proximity, - x, y, z, v3, v4, v5, v6, id, serial, + x, y, z, v[3], v[4], v[5], v[6], id, serial, is_button ? "true" : "false", ds->buttons); /* when entering prox, replace the zeroed-out oldState with a copy of |