mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +01:00
Problem: ptr/ref parameters and local variables are non-const but never modified
Solution: add const
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
void zmq::seed_random ()
|
||||
{
|
||||
#if defined ZMQ_HAVE_WINDOWS
|
||||
int pid = static_cast<int> (GetCurrentProcessId ());
|
||||
const int pid = static_cast<int> (GetCurrentProcessId ());
|
||||
#else
|
||||
int pid = static_cast<int> (getpid ());
|
||||
#endif
|
||||
@@ -59,7 +59,7 @@ void zmq::seed_random ()
|
||||
uint32_t zmq::generate_random ()
|
||||
{
|
||||
// Compensate for the fact that rand() returns signed integer.
|
||||
uint32_t low = static_cast<uint32_t> (rand ());
|
||||
const uint32_t low = static_cast<uint32_t> (rand ());
|
||||
uint32_t high = static_cast<uint32_t> (rand ());
|
||||
high <<= (sizeof (int) * 8 - 1);
|
||||
return high | low;
|
||||
|
||||
Reference in New Issue
Block a user