diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-08-22 15:05:48 -0700 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2012-08-27 10:32:50 -0700 |
commit | 625a43c040fd71393be94fdfad6cf7faa49db775 (patch) | |
tree | 920368ec893abad89b9231ae5465975b71db6a3d | |
parent | d8613ffc961be4c957ed30d4ac03e83411f835b6 (diff) | |
download | xf86-input-wacom-625a43c040fd71393be94fdfad6cf7faa49db775.tar.gz |
Make test_get_wheel_button happy
Apparently there is some subtle difference here between returning
a pointer and using a double-pointer as an output parameter.
Tracing through the function shows the former *should* be working,
but for an unknown reason fails "assert(action == &action_dn)"...
This patch shouldn't change any functionality -- it just shuts up
`make distcheck`.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
-rw-r--r-- | src/wcmCommon.c | 21 | ||||
-rw-r--r-- | test/wacom-tests.c | 3 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index d10c1d1..1b2f269 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -354,15 +354,16 @@ static int getScrollDelta(int current, int old, int wrap, int flags) * @param action_dn Action to send on scroll down * @return Action that should be performed */ -static unsigned int* getWheelButton(int delta, unsigned int *action_up, - unsigned int *action_dn) +static void getWheelButton(int delta, unsigned int *action_up, + unsigned int *action_dn, + unsigned int** action) { if (delta > 0) - return action_up; + *action = action_up; else if (delta < 0) - return action_dn; + *action = action_dn; else - return NULL; + *action = NULL; } /** @@ -401,7 +402,7 @@ static void sendWheelStripEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, if (delta && IsPad(priv) && priv->oldProximity == ds->proximity) { DBG(10, priv, "Left touch strip scroll delta = %d\n", delta); - fakeKey = getWheelButton(delta, priv->strip_keys[STRIP_LEFT_UP], priv->strip_keys[STRIP_LEFT_DN]); + getWheelButton(delta, priv->strip_keys[STRIP_LEFT_UP], priv->strip_keys[STRIP_LEFT_DN], &fakeKey); sendWheelStripEvent(fakeKey, pInfo, first_val, num_vals, valuators); } @@ -410,7 +411,7 @@ static void sendWheelStripEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, if (delta && IsPad(priv) && priv->oldProximity == ds->proximity) { DBG(10, priv, "Right touch strip scroll delta = %d\n", delta); - fakeKey = getWheelButton(delta, priv->strip_keys[STRIP_RIGHT_UP], priv->strip_keys[STRIP_RIGHT_DN]); + getWheelButton(delta, priv->strip_keys[STRIP_RIGHT_UP], priv->strip_keys[STRIP_RIGHT_DN], &fakeKey); sendWheelStripEvent(fakeKey, pInfo, first_val, num_vals, valuators); } @@ -419,7 +420,7 @@ static void sendWheelStripEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, if (delta && (IsCursor(priv) || IsPad(priv)) && priv->oldProximity == ds->proximity) { DBG(10, priv, "Relative wheel scroll delta = %d\n", delta); - fakeKey = getWheelButton(delta, priv->wheel_keys[WHEEL_REL_UP], priv->wheel_keys[WHEEL_REL_DN]); + getWheelButton(delta, priv->wheel_keys[WHEEL_REL_UP], priv->wheel_keys[WHEEL_REL_DN], &fakeKey); sendWheelStripEvent(fakeKey, pInfo, first_val, num_vals, valuators); } @@ -428,7 +429,7 @@ static void sendWheelStripEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, if (delta && IsPad(priv) && priv->oldProximity == ds->proximity) { DBG(10, priv, "Left touch wheel scroll delta = %d\n", delta); - fakeKey = getWheelButton(delta, priv->wheel_keys[WHEEL_ABS_UP], priv->wheel_keys[WHEEL_ABS_DN]); + getWheelButton(delta, priv->wheel_keys[WHEEL_ABS_UP], priv->wheel_keys[WHEEL_ABS_DN], &fakeKey); sendWheelStripEvent(fakeKey, pInfo, first_val, num_vals, valuators); } @@ -437,7 +438,7 @@ static void sendWheelStripEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, if (delta && IsPad(priv) && priv->oldProximity == ds->proximity) { DBG(10, priv, "Right touch wheel scroll delta = %d\n", delta); - fakeKey = getWheelButton(delta, priv->wheel_keys[WHEEL2_ABS_UP], priv->wheel_keys[WHEEL2_ABS_DN]); + getWheelButton(delta, priv->wheel_keys[WHEEL2_ABS_UP], priv->wheel_keys[WHEEL2_ABS_DN], &fakeKey); sendWheelStripEvent(fakeKey, pInfo, first_val, num_vals, valuators); } } diff --git a/test/wacom-tests.c b/test/wacom-tests.c index 3f47b2d..652977d 100644 --- a/test/wacom-tests.c +++ b/test/wacom-tests.c @@ -89,7 +89,8 @@ test_get_wheel_button(void) for (delta = -32; delta <= 32; delta++) { - unsigned int *action = getWheelButton(delta, &action_up, &action_dn); + unsigned int *action; + getWheelButton(delta, &action_up, &action_dn, &action); if (delta < 0) { assert(action == &action_dn); |