mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-05 09:00:12 +01:00
Add tv2us helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
758ffa9c8a
commit
1332d883f3
2 changed files with 7 additions and 1 deletions
|
|
@ -1887,7 +1887,7 @@ static inline void
|
|||
evdev_process_event(struct evdev_device *device, struct input_event *e)
|
||||
{
|
||||
struct evdev_dispatch *dispatch = device->dispatch;
|
||||
uint64_t time = s2us(e->time.tv_sec) + e->time.tv_usec;
|
||||
uint64_t time = tv2us(&e->time);
|
||||
|
||||
#if 0
|
||||
if (libevdev_event_is_code(e, EV_SYN, SYN_REPORT))
|
||||
|
|
|
|||
|
|
@ -440,6 +440,12 @@ us2ms(uint64_t us)
|
|||
return (uint32_t)(us / 1000);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
tv2us(const struct timeval *tv)
|
||||
{
|
||||
return s2us(tv->tv_sec) + tv->tv_usec;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
safe_atoi(const char *str, int *val)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue