COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/random.h

    r631 r1340  
    6363#define LEMON_RANDOM_H
    6464
     65#include <lemon/config.h>
     66
    6567#include <algorithm>
    6668#include <iterator>
     
    7274#include <lemon/dim2.h>
    7375
    74 #ifndef WIN32
     76#ifndef LEMON_WIN32
    7577#include <sys/time.h>
    7678#include <ctime>
     
    200202        initState(init);
    201203
    202         num = length > end - begin ? length : end - begin;
     204        num = static_cast<int>(length > end - begin ? length : end - begin);
    203205        while (num--) {
    204206          curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1))
     
    214216        }
    215217
    216         num = length - 1; cnt = length - (curr - state) - 1;
     218        num = length - 1; cnt = static_cast<int>(length - (curr - state) - 1);
    217219        while (num--) {
    218220          curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2))
     
    606608    /// \return Currently always \c true.
    607609    bool seed() {
    608 #ifndef WIN32
     610#ifndef LEMON_WIN32
    609611      if (seedFromFile("/dev/urandom", 0)) return true;
    610612#endif
     
    626628    /// \param offset The offset, from the file read.
    627629    /// \return \c true when the seeding successes.
    628 #ifndef WIN32
     630#ifndef LEMON_WIN32
    629631    bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
    630632#else
     
    648650    /// \return Currently always \c true.
    649651    bool seedFromTime() {
    650 #ifndef WIN32
     652#ifndef LEMON_WIN32
    651653      timeval tv;
    652654      gettimeofday(&tv, 0);
Note: See TracChangeset for help on using the changeset viewer.