Commit 8028817f authored by Luca Boccassi's avatar Luca Boccassi

Problem: 1E9 is double but assigned to an int var

Solution: use the less nice but correct int constant 1000000000
instead of the shorter 1E9 to avoid a compiler warning when assigning
to timespec.tv_nsec, which is a long int.
parent 32f2b784
...@@ -165,9 +165,9 @@ namespace zmq ...@@ -165,9 +165,9 @@ namespace zmq
timeout.tv_sec += timeout_ / 1000; timeout.tv_sec += timeout_ / 1000;
timeout.tv_nsec += (timeout_ % 1000) * 1000000; timeout.tv_nsec += (timeout_ % 1000) * 1000000;
if (timeout.tv_nsec > 1E9) { if (timeout.tv_nsec > 1000000000) {
timeout.tv_sec++; timeout.tv_sec++;
timeout.tv_nsec -= 1E9; timeout.tv_nsec -= 1000000000;
} }
rc = pthread_cond_timedwait (&cond, mutex_->get_mutex (), &timeout); rc = pthread_cond_timedwait (&cond, mutex_->get_mutex (), &timeout);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment