From ce72a0048b56089f3946f9bc90163fcad7222f86 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Fri, 15 Dec 2017 13:12:28 -0800 Subject: Move 'suppress' variable from wcmEvent to commonDispatchDevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves the following compile-time warning: ../src/wcmCommon.c: In function ‘wcmEvent’: ../src/wcmCommon.c:1007:23: error: ‘suppress’ may be used uninitialized in this function [-Werror=maybe-uninitialized] commonDispatchDevice(pInfo, pChannel, suppress); ^ Fixes: 2fa4ef48c9 ("Do not overwrite raw device state with filtered coordinate values") Signed-off-by: Jason Gerecke --- src/wcmCommon.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 900544b..bd5039c 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -56,8 +56,7 @@ static int *VCOPY(const int *valuators, int nvals) static int applyPressureCurve(WacomDevicePtr pDev, const WacomDeviceStatePtr pState); static void commonDispatchDevice(InputInfoPtr pInfo, - const WacomChannelPtr pChannel, - enum WacomSuppressMode suppress); + const WacomChannelPtr pChannel); static void sendAButton(InputInfoPtr pInfo, int button, int mask, int first_val, int num_vals, int *valuators); @@ -899,7 +898,6 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, { WacomDeviceState ds; WacomChannelPtr pChannel; - enum WacomSuppressMode suppress; InputInfoPtr pInfo; WacomToolPtr tool; WacomDevicePtr priv; @@ -1004,7 +1002,7 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, /* For touch, only first finger moves the cursor */ if ((common->wcmTouch && ds.device_type == TOUCH_ID && ds.serial_num == 1) || (ds.device_type != TOUCH_ID)) - commonDispatchDevice(pInfo, pChannel, suppress); + commonDispatchDevice(pInfo, pChannel); } @@ -1151,13 +1149,13 @@ static void detectPressureIssue(WacomDevicePtr priv, } static void commonDispatchDevice(InputInfoPtr pInfo, - const WacomChannelPtr pChannel, - enum WacomSuppressMode suppress) + const WacomChannelPtr pChannel) { WacomDeviceState* ds = &pChannel->valid.states[0]; WacomDevicePtr priv = pInfo->private; WacomCommonPtr common = priv->common; WacomDeviceState filtered; + enum WacomSuppressMode suppress; int raw_pressure = 0; /* device_type should have been retrieved and set in the respective -- cgit v1.2.1