Skip to content

Commit

Permalink
wayland: crop the timestamp so it fits in uint
Browse files Browse the repository at this point in the history
It's a client-local timestamp:

> timestamp with millisecond granularity; with an undefined base
  • Loading branch information
Saviq committed Dec 11, 2024
1 parent 654dbde commit ef30b99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mir-ci/mir_ci/wayland/wayland_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def _dispatch(self) -> None:
raise e

def timestamp(self) -> int:
return int(time.monotonic() * 1000)
# ensure the value fits in a `uint_t`
return int(time.monotonic() * 1000) & 0xFFFFFFFF

Check warning on line 27 in mir-ci/mir_ci/wayland/wayland_client.py

View check run for this annotation

Codecov / codecov/patch

mir-ci/mir_ci/wayland/wayland_client.py#L27

Added line #L27 was not covered by tests

@abstractmethod
def registry_global(self, registry, id_num: int, iface_name: str, version: int) -> None:
Expand Down

0 comments on commit ef30b99

Please sign in to comment.