COIN-OR::LEMON - Graph Library

Changeset 1124:d51126dc39fa in lemon-main


Ignore:
Timestamp:
04/02/15 13:36:16 (10 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Resolve MSVC conversion warnings C4244 (#519)

Location:
lemon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lemon/elevator.h

    r581 r1124  
    168168    int onLevel(int l) const
    169169    {
    170       return _first[l+1]-_first[l];
     170      return static_cast<int>(_first[l+1]-_first[l]);
    171171    }
    172172    ///Return true if level \c l is empty.
     
    178178    int aboveLevel(int l) const
    179179    {
    180       return _first[_max_level+1]-_first[l+1];
     180      return static_cast<int>(_first[_max_level+1]-_first[l+1]);
    181181    }
    182182    ///Return the number of active items on level \c l.
    183183    int activesOnLevel(int l) const
    184184    {
    185       return _last_active[l]-_first[l]+1;
     185      return static_cast<int>(_last_active[l]-_first[l]+1);
    186186    }
    187187    ///Return true if there is no active item on level \c l.
  • lemon/radix_sort.h

    r1092 r1124  
    329329      Allocator allocator;
    330330
    331       int length = std::distance(first, last);
     331      int length = static_cast<int>(std::distance(first, last));
    332332      Key* buffer = allocator.allocate(2 * length);
    333333      try {
  • lemon/random.h

    r584 r1124  
    200200        initState(init);
    201201
    202         num = length > end - begin ? length : end - begin;
     202        num = static_cast<int>(length > end - begin ? length : end - begin);
    203203        while (num--) {
    204204          curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1))
     
    214214        }
    215215
    216         num = length - 1; cnt = length - (curr - state) - 1;
     216        num = length - 1; cnt = static_cast<int>(length - (curr - state) - 1);
    217217        while (num--) {
    218218          curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2))
  • lemon/static_graph.h

    r877 r1124  
    204204
    205205      node_num = n;
    206       arc_num = std::distance(first, last);
     206      arc_num = static_cast<int>(std::distance(first, last));
    207207
    208208      node_first_out = new int[node_num + 1];
Note: See TracChangeset for help on using the changeset viewer.