Problem: C-style casts used

Solution: replace by C++-style casts
This commit is contained in:
Simon Giesecke
2018-05-18 15:54:00 +02:00
parent d002eb5578
commit 4e616f30dd
52 changed files with 408 additions and 325 deletions

View File

@@ -49,18 +49,18 @@
void zmq::seed_random ()
{
#if defined ZMQ_HAVE_WINDOWS
int pid = (int) GetCurrentProcessId ();
int pid = static_cast<int> (GetCurrentProcessId ());
#else
int pid = (int) getpid ();
#endif
srand ((unsigned int) (clock_t::now_us () + pid));
srand (static_cast<unsigned int> (clock_t::now_us () + pid));
}
uint32_t zmq::generate_random ()
{
// Compensate for the fact that rand() returns signed integer.
uint32_t low = (uint32_t) rand ();
uint32_t high = (uint32_t) rand ();
uint32_t low = static_cast<uint32_t> (rand ());
uint32_t high = static_cast<uint32_t> (rand ());
high <<= (sizeof (int) * 8 - 1);
return high | low;
}