0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 07:31:03 +08:00

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.
This commit is contained in:
Luca Boccassi 2016-04-10 20:16:57 +01:00
parent 32f2b784b9
commit 8028817f6b

View File

@ -165,9 +165,9 @@ namespace zmq
timeout.tv_sec += timeout_ / 1000;
timeout.tv_nsec += (timeout_ % 1000) * 1000000;
if (timeout.tv_nsec > 1E9) {
if (timeout.tv_nsec > 1000000000) {
timeout.tv_sec++;
timeout.tv_nsec -= 1E9;
timeout.tv_nsec -= 1000000000;
}
rc = pthread_cond_timedwait (&cond, mutex_->get_mutex (), &timeout);