diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2022-01-04 11:40:06 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-02-22 10:41:51 +1000 |
commit | e981a1c1c70b4ed6a34cfac2cde872905e89f4ed (patch) | |
tree | 1163a9de5a841bd98423a26ebd138559c80dfa86 | |
parent | fe50ba4c0048d58f09489ad85f11c0ae4838b5b9 (diff) | |
download | xf86-input-wacom-e981a1c1c70b4ed6a34cfac2cde872905e89f4ed.tar.gz |
gesture: Use unsigned integers for finger indicies
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmTouchFilter.c | 15 | ||||
-rw-r--r-- | src/wcmTouchFilter.h | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 5bf053c..88a2eee 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -56,7 +56,7 @@ static void wcmFingerZoom(WacomDevicePtr priv); * @param[in] num Contact number to search for * @return Pointer to the associated channel, or NULL if none found */ -static WacomChannelPtr getContactNumber(WacomCommonPtr common, int num) +static WacomChannelPtr getContactNumber(WacomCommonPtr common, unsigned int num) { for (size_t i = 0; i < MAX_CHANNELS; i++) { @@ -66,7 +66,7 @@ static WacomChannelPtr getContactNumber(WacomCommonPtr common, int num) return channel; } - DBG(10, common, "Channel for contact number %d not found.\n", num); + DBG(10, common, "Channel for contact number %u not found.\n", num); return NULL; } @@ -79,15 +79,14 @@ static WacomChannelPtr getContactNumber(WacomCommonPtr common, int num) * @param[in] num Length of states list * @param[in] age Age of state information, zero being the most-current */ -static void getStateHistory(WacomCommonPtr common, WacomDeviceState states[], int num, int age) +static void getStateHistory(WacomCommonPtr common, WacomDeviceState states[], unsigned int num, unsigned int age) { - int i; - for (i = 0; i < num; i++) + for (unsigned int i = 0; i < num; i++) { WacomChannelPtr channel = getContactNumber(common, i); if (channel == NULL || i > ARRAY_SIZE(channel->valid.states)) { - DBG(7, common, "Could not get state history for contact %d, age %d.\n", i, age); + DBG(7, common, "Could not get state history for contact %u, age %u.\n", i, age); continue; } states[i] = channel->valid.states[age]; @@ -139,7 +138,7 @@ wcmSendTouchEvent(WacomDevicePtr priv, WacomChannelPtr channel, Bool no_update) * @param[in] contact_id ID of the contact to send event for (at minimum) */ static void -wcmFingerMultitouch(WacomDevicePtr priv, int contact_id) { +wcmFingerMultitouch(WacomDevicePtr priv, unsigned int contact_id) { Bool lag_mode = priv->common->wcmGestureMode == GESTURE_LAG_MODE; Bool prox = FALSE; @@ -389,7 +388,7 @@ void wcmCancelGesture(WacomDevicePtr priv) } /* parsing gesture mode according to 2FGT data */ -void wcmGestureFilter(WacomDevicePtr priv, int touch_id) +void wcmGestureFilter(WacomDevicePtr priv, unsigned int touch_id) { WacomCommonPtr common = priv->common; WacomDeviceState ds[2] = {}, dsLast[2] = {}; diff --git a/src/wcmTouchFilter.h b/src/wcmTouchFilter.h index 1bd3a2c..77cea73 100644 --- a/src/wcmTouchFilter.h +++ b/src/wcmTouchFilter.h @@ -24,7 +24,7 @@ /****************************************************************************/ -void wcmGestureFilter(WacomDevicePtr priv, int touch_id); +void wcmGestureFilter(WacomDevicePtr priv, unsigned int touch_id); Bool wcmTouchNeedSendEvents(WacomCommonPtr common); /****************************************************************************/ |