Cast to avoid signedness warnings in sleep

This commit is contained in:
Danny Robson 2012-05-08 16:40:10 +10:00
parent 474a808f79
commit 71a1592413

View File

@ -21,6 +21,7 @@
#include "debug.hpp" #include "debug.hpp"
#include "platform.hpp" #include "platform.hpp"
#include "types.hpp"
using namespace util; using namespace util;
@ -65,8 +66,8 @@ void
util::sleep (uint64_t ns) { util::sleep (uint64_t ns) {
struct timespec req, rem; struct timespec req, rem;
req.tv_sec = ns / 1000000000UL; req.tv_sec = sign_cast<time_t> (ns / 1000000000UL);
req.tv_nsec = ns % 1000000000UL; req.tv_nsec = sign_cast<long> (ns % 1000000000UL);
while (nanosleep (&req, &rem)) { while (nanosleep (&req, &rem)) {
req = rem; req = rem;