diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2022-01-27 11:28:09 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-02-22 10:41:51 +1000 |
commit | ce2ec765c2fa57d3f4a1b833f424ced2cf8ba53c (patch) | |
tree | 73c205102805f20114bcbba14e147af95c4d60d7 | |
parent | 52803bf0a87772bb6ca837c68e68911909a6cd53 (diff) | |
download | xf86-input-wacom-ce2ec765c2fa57d3f4a1b833f424ced2cf8ba53c.tar.gz |
Make devicestate sample and time variables unsigned
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmCommon.c | 2 | ||||
-rw-r--r-- | src/wcmUSB.c | 22 | ||||
-rw-r--r-- | src/xf86WacomDefs.h | 6 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index e26e754..1d53a15 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1132,7 +1132,7 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, DBG(10, common, "c=%u i=%d t=%d s=0x%x x=%d y=%d b=%u " "p=%d rz=%d tx=%d ty=%d aw=%d aw2=%d rw=%d " - "t=%d px=%d st=%d cs=%d \n", + "t=%d px=%d st=%u cs=%d \n", channel, ds.device_id, ds.device_type, diff --git a/src/wcmUSB.c b/src/wcmUSB.c index b3a6750..8004518 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -952,8 +952,8 @@ static int usbChooseChannel(WacomCommonPtr common, int device_type, unsigned int } } DBG(1, common, "device with serial number: %u" - " at %d: Exceeded channel count; ignoring the events.\n", - serial, (int)wcmTimeInMillis()); + " at %u: Exceeded channel count; ignoring the events.\n", + serial, wcmTimeInMillis()); } return channel; @@ -1334,7 +1334,7 @@ static void usbParseAbsEvent(WacomCommonPtr common, change |= usbParseWacomAbsEvent(common, event, channel_number); } - ds->time = (int)wcmTimeInMillis(); + ds->time = wcmTimeInMillis(); channel->dirty |= change; } @@ -1396,7 +1396,7 @@ static void usbParseAbsMTEvent(WacomCommonPtr common, struct input_event *event) /* set this here as type for this channel doesn't get set in usbDispatchEvent() */ ds->device_type = TOUCH_ID; ds->device_id = TOUCH_DEVICE_ID; - ds->sample = (int)wcmTimeInMillis(); + ds->sample = wcmTimeInMillis(); break; case ABS_MT_POSITION_X: @@ -1415,7 +1415,7 @@ static void usbParseAbsMTEvent(WacomCommonPtr common, struct input_event *event) change = 0; } - ds->time = (int)wcmTimeInMillis(); + ds->time = wcmTimeInMillis(); (&common->wcmChannel[private->wcmMTChannel])->dirty |= change; } @@ -1506,7 +1506,7 @@ static void usbParseKeyEvent(WacomCommonPtr common, /* time stamp for 2FGT gesture events */ if ((ds->proximity && !dslast->proximity) || (!ds->proximity && dslast->proximity)) - ds->sample = (int)wcmTimeInMillis(); + ds->sample = wcmTimeInMillis(); break; case BTN_TOOL_TRIPLETAP: @@ -1518,7 +1518,7 @@ static void usbParseKeyEvent(WacomCommonPtr common, /* time stamp for 2GT gesture events */ if ((ds->proximity && !dslast->proximity) || (!ds->proximity && dslast->proximity)) - ds->sample = (int)wcmTimeInMillis(); + ds->sample = wcmTimeInMillis(); /* Second finger events will be considered in * combination with the first finger data */ break; @@ -1527,7 +1527,7 @@ static void usbParseKeyEvent(WacomCommonPtr common, change = 0; } - ds->time = (int)wcmTimeInMillis(); + ds->time = wcmTimeInMillis(); channel->dirty |= change; if (change) @@ -1558,7 +1558,7 @@ static void usbParseKeyEvent(WacomCommonPtr common, change = 0; } - ds->time = (int)wcmTimeInMillis(); + ds->time = wcmTimeInMillis(); channel->dirty |= change; } @@ -1620,7 +1620,7 @@ static void usbParseBTNEvent(WacomCommonPtr common, change = 0; } - ds->time = (int)wcmTimeInMillis(); + ds->time = wcmTimeInMillis(); channel->dirty |= change; } @@ -1906,7 +1906,7 @@ static void usbDispatchEvents(WacomDevicePtr priv) if (event->code == REL_WHEEL) { ds->relwheel = -event->value; - ds->time = (int)wcmTimeInMillis(); + ds->time = wcmTimeInMillis(); common->wcmChannel[channel].dirty |= TRUE; } else diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h index 11cf244..bbd6d63 100644 --- a/src/xf86WacomDefs.h +++ b/src/xf86WacomDefs.h @@ -203,8 +203,8 @@ struct _WacomDeviceState int distance; int throttle; int proximity; - int sample; /* wraps every 24 days */ - int time; + unsigned int sample; /* wraps every 24 days */ + unsigned int time; unsigned int keys; /* bitmask for IDX_KEY_CONTROLPANEL, etc. */ }; @@ -367,7 +367,7 @@ typedef struct { unsigned int wcmScrollDistance; /* minimum motion before sending a scroll gesture */ unsigned int wcmScrollDirection; /* store the vertical or horizontal bit in use */ unsigned int wcmGestureUsed; /* retain used gesture count within one in-prox event */ - int wcmTapTime; /* minimum time between taps for a right click */ + unsigned int wcmTapTime; /* minimum time between taps for a right click */ } WacomGesturesParameters; enum WacomProtocol { |