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:
parent
32f2b784b9
commit
8028817f6b
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user