util/timespec: use unsigned 64 bit integers for nsec values
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 21 Aug 2019 09:21:05 +0000 (11:21 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 22 Aug 2019 07:35:57 +0000 (09:35 +0200)
commit5833f433055cbc259bfe53286a6d3f6687fdd7db
treebe59c448e7a53e897ff8403872bb19676f49eb76
parent728ebcdec2bfc38f28fd7feb3b89194c64287ac6
util/timespec: use unsigned 64 bit integers for nsec values

We added this utility for vulkan where all timeouts are given as
uint64_t values. We can switch from signed to unsigned as this is the
only user and if we ever deal with signed integers somewhere else
we'll have to be careful to use the corresponding
timespec_(add|sub)_msec and always pass absolute values.

v2: Forgot to drop the test calling add_nsec() with a negative number

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Fixes: d2d70c3bb5 ("util: add a timespec helper")
Acked-by: Daniel Stone <daniels@collabora.com>
src/util/tests/timespec/timespec_test.cpp
src/util/timespec.h