Use explicit casting to avoid signedness warnings
This commit is contained in:
parent
dd1a935ed4
commit
575f87747b
7
time.cpp
7
time.cpp
@ -19,6 +19,8 @@
|
||||
|
||||
#include "time.hpp"
|
||||
|
||||
#include "debug.hpp"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
using namespace util;
|
||||
@ -29,5 +31,8 @@ util::nanoseconds (void) {
|
||||
struct timespec t;
|
||||
clock_gettime (CLOCK_REALTIME, &t);
|
||||
|
||||
return t.tv_sec * 1000000000ULL + t.tv_nsec;
|
||||
check_soft (t.tv_sec > 0);
|
||||
check_soft (t.tv_nsec > 0);
|
||||
|
||||
return static_cast<uint64_t> (t.tv_sec) * 1000000000ULL + static_cast<uint64_t> (t.tv_nsec);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user