Ticket #9115: boost_random_shadow_warning_fix.diff

File boost_random_shadow_warning_fix.diff, 3.9 KB (added by Mathias Gaunard, 9 years ago)
  • boost/random/lagged_fibonacci.hpp

     
    143143    BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, lagged_fibonacci_engine, f)
    144144    {
    145145        os << f.i;
    146         for(unsigned int i = 0; i < f.long_lag; ++i)
    147             os << ' ' << f.x[i];
     146        for(unsigned int j = 0; j < f.long_lag; ++j)
     147            os << ' ' << f.x[j];
    148148        return os;
    149149    }
    150150   
     
    154154    BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, lagged_fibonacci_engine, f)
    155155    {
    156156        is >> f.i >> std::ws;
    157         for(unsigned int i = 0; i < f.long_lag; ++i)
    158             is >> f.x[i] >> std::ws;
     157        for(unsigned int j = 0; j < f.long_lag; ++j)
     158            is >> f.x[j] >> std::ws;
    159159        return is;
    160160    }
    161161   
     
    163163     * Returns true if the two generators will produce identical
    164164     * sequences of outputs.
    165165     */
    166     BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_engine, x, y)
    167     { return x.i == y.i && std::equal(x.x, x.x+long_lag, y.x); }
     166    BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_engine, x_, y_)
     167    { return x_.i == y_.i && std::equal(x_.x, x_.x+long_lag, y_.x); }
    168168   
    169169    /**
    170170     * Returns true if the two generators will produce different
     
    354354        using std::pow;
    355355        os << f.i;
    356356        std::ios_base::fmtflags oldflags = os.flags(os.dec | os.fixed | os.left);
    357         for(unsigned int i = 0; i < f.long_lag; ++i)
    358             os << ' ' << f.x[i] * f.modulus();
     357        for(unsigned int j = 0; j < f.long_lag; ++j)
     358            os << ' ' << f.x[j] * f.modulus();
    359359        os.flags(oldflags);
    360360        return os;
    361361    }
     
    366366    BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, lagged_fibonacci_01_engine, f)
    367367    {
    368368        is >> f.i;
    369         for(unsigned int i = 0; i < f.long_lag; ++i) {
     369        for(unsigned int j = 0; j < f.long_lag; ++j) {
    370370            typename lagged_fibonacci_01_engine::result_type value;
    371371            is >> std::ws >> value;
    372             f.x[i] = value / f.modulus();
     372            f.x[j] = value / f.modulus();
    373373        }
    374374        return is;
    375375    }
     
    378378     * Returns true if the two generators will produce identical
    379379     * sequences of outputs.
    380380     */
    381     BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_01_engine, x, y)
    382     { return x.i == y.i && std::equal(x.x, x.x+long_lag, y.x); }
     381    BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_01_engine, x_, y_)
     382    { return x_.i == y_.i && std::equal(x_.x, x_.x+long_lag, y_.x); }
    383383   
    384384    /**
    385385     * Returns true if the two generators will produce different
  • boost/random/mersenne_twister.hpp

     
    234234     * Returns true if the two generators are in the same state,
    235235     * and will thus produce identical sequences.
    236236     */
    237     friend bool operator==(const mersenne_twister_engine& x,
    238                            const mersenne_twister_engine& y)
     237    friend bool operator==(const mersenne_twister_engine& x_,
     238                           const mersenne_twister_engine& y_)
    239239    {
    240         if(x.i < y.i) return x.equal_imp(y);
    241         else return y.equal_imp(x);
     240        if(x_.i < y_.i) return x_.equal_imp(y_);
     241        else return y_.equal_imp(x_);
    242242    }
    243243   
    244244    /**
    245245     * Returns true if the two generators are in different states.
    246246     */
    247     friend bool operator!=(const mersenne_twister_engine& x,
    248                            const mersenne_twister_engine& y)
    249     { return !(x == y); }
     247    friend bool operator!=(const mersenne_twister_engine& x_,
     248                           const mersenne_twister_engine& y_)
     249    { return !(x_ == y_); }
    250250
    251251private:
    252252    /// \cond show_private