[Positioning] Fix Timestamp on 32 bits architectures
This commit is contained in:
parent
30e4e47ca8
commit
24a328fc16
|
@ -233,7 +233,9 @@ inline Timestamp::operator const struct timespec&() const
|
|||
|
||||
inline Timestamp::operator uint64_t(void) const
|
||||
{
|
||||
return timestamp.tv_sec * 1000 + timestamp.tv_nsec / 1000000 ;
|
||||
return
|
||||
static_cast<uint64_t>(timestamp.tv_sec) * 1000 +
|
||||
static_cast<uint64_t>(timestamp.tv_nsec) / 1000000 ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ public:
|
|||
TS_ASSERT_EQUALS(static_cast<struct timespec>(timestamp2), current_time) ;
|
||||
TS_ASSERT_EQUALS(timestamp2, current_time) ;
|
||||
|
||||
msec = 1234567891234567ull ;
|
||||
msec = 1234567891234ull ;
|
||||
timestamp2 = msec ;
|
||||
TS_ASSERT_EQUALS(static_cast<uint64_t>(timestamp2), msec) ;
|
||||
TS_ASSERT_EQUALS(timestamp2, msec) ;
|
||||
|
|
Loading…
Reference in New Issue