[Positioning] Fix Timestamp on 32 bits architectures

This commit is contained in:
Matteo Cypriani 2010-03-31 11:09:55 +02:00
parent 30e4e47ca8
commit 24a328fc16
2 changed files with 4 additions and 2 deletions

View File

@ -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 ;
}

View File

@ -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) ;