COIN-OR::LEMON - Graph Library

Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/bits


Ignore:
Timestamp:
03/02/07 19:04:28 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
Message:

Hard Warning checking

  • based on the remark of the ZIB user
  • we do not use -Winline
Location:
lemon/bits
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/alteration_notifier.h

    r2384 r2386  
    149149      ///
    150150      /// Constructor which attach the observer into notifier.
    151       ObserverBase(AlterationNotifier& notifier) {
    152         attach(notifier);
     151      ObserverBase(AlterationNotifier& nf) {
     152        attach(nf);
    153153      }
    154154
     
    159159      ObserverBase(const ObserverBase& copy) {
    160160        if (copy.attached()) {
    161           attach(*copy._notifier());
     161          attach(*copy.notifier());
    162162        }
    163163      }
     
    174174      /// This member attaches the observer into an AlterationNotifier.
    175175      ///
    176       void attach(AlterationNotifier& notifier) {
    177         notifier.attach(*this);
     176      void attach(AlterationNotifier& nf) {
     177        nf.attach(*this);
    178178      }
    179179     
  • lemon/bits/array_map.h

    r2384 r2386  
    8282      Parent::attach(graph.notifier(Item()));
    8383      allocate_memory();
    84       Notifier* notifier = Parent::notifier();
    85       Item it;
    86       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    87         int id = notifier->id(it);;
     84      Notifier* nf = Parent::notifier();
     85      Item it;
     86      for (nf->first(it); it != INVALID; nf->next(it)) {
     87        int id = nf->id(it);;
    8888        allocator.construct(&(values[id]), Value());
    8989      }                                                         
     
    9696      Parent::attach(graph.notifier(Item()));
    9797      allocate_memory();
    98       Notifier* notifier = Parent::notifier();
    99       Item it;
    100       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    101         int id = notifier->id(it);;
     98      Notifier* nf = Parent::notifier();
     99      Item it;
     100      for (nf->first(it); it != INVALID; nf->next(it)) {
     101        int id = nf->id(it);;
    102102        allocator.construct(&(values[id]), value);
    103103      }                                                         
     
    114114      if (capacity == 0) return;
    115115      values = allocator.allocate(capacity);
    116       Notifier* notifier = Parent::notifier();
    117       Item it;
    118       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    119         int id = notifier->id(it);;
     116      Notifier* nf = Parent::notifier();
     117      Item it;
     118      for (nf->first(it); it != INVALID; nf->next(it)) {
     119        int id = nf->id(it);;
    120120        allocator.construct(&(values[id]), copy.values[id]);
    121121      }
     
    143143    ArrayMap& operator=(const CMap& cmap) {
    144144      checkConcept<concepts::ReadMap<Key, _Value>, CMap>();
    145       const typename Parent::Notifier* notifier = Parent::notifier();
    146       Item it;
    147       for (notifier->first(it); it != INVALID; notifier->next(it)) {
     145      const typename Parent::Notifier* nf = Parent::notifier();
     146      Item it;
     147      for (nf->first(it); it != INVALID; nf->next(it)) {
    148148        set(it, cmap[it]);
    149149      }
     
    202202    /// and it overrides the add() member function of the observer base.     
    203203    virtual void add(const Key& key) {
    204       Notifier* notifier = Parent::notifier();
    205       int id = notifier->id(key);
     204      Notifier* nf = Parent::notifier();
     205      int id = nf->id(key);
    206206      if (id >= capacity) {
    207207        int new_capacity = (capacity == 0 ? 1 : capacity);
     
    211211        Value* new_values = allocator.allocate(new_capacity);
    212212        Item it;
    213         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    214           int jd = notifier->id(it);;
     213        for (nf->first(it); it != INVALID; nf->next(it)) {
     214          int jd = nf->id(it);;
    215215          if (id != jd) {
    216216            allocator.construct(&(new_values[jd]), values[jd]);
     
    230230    /// and it overrides the add() member function of the observer base.     
    231231    virtual void add(const std::vector<Key>& keys) {
    232       Notifier* notifier = Parent::notifier();
     232      Notifier* nf = Parent::notifier();
    233233      int max_id = -1;
    234       for (int i = 0; i < (int)keys.size(); ++i) {
    235         int id = notifier->id(keys[i]);
     234      for (int i = 0; i < int(keys.size()); ++i) {
     235        int id = nf->id(keys[i]);
    236236        if (id > max_id) {
    237237          max_id = id;
     
    245245        Value* new_values = allocator.allocate(new_capacity);
    246246        Item it;
    247         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    248           int id = notifier->id(it);
     247        for (nf->first(it); it != INVALID; nf->next(it)) {
     248          int id = nf->id(it);
    249249          bool found = false;
    250           for (int i = 0; i < (int)keys.size(); ++i) {
    251             int jd = notifier->id(keys[i]);
     250          for (int i = 0; i < int(keys.size()); ++i) {
     251            int jd = nf->id(keys[i]);
    252252            if (id == jd) {
    253253              found = true;
     
    263263        capacity = new_capacity;
    264264      }
    265       for (int i = 0; i < (int)keys.size(); ++i) {
    266         int id = notifier->id(keys[i]);
     265      for (int i = 0; i < int(keys.size()); ++i) {
     266        int id = nf->id(keys[i]);
    267267        allocator.construct(&(values[id]), Value());
    268268      }
     
    283283    /// and it overrides the erase() member function of the observer base.     
    284284    virtual void erase(const std::vector<Key>& keys) {
    285       for (int i = 0; i < (int)keys.size(); ++i) {
     285      for (int i = 0; i < int(keys.size()); ++i) {
    286286        int id = Parent::notifier()->id(keys[i]);
    287287        allocator.destroy(&(values[id]));
     
    294294    /// and it overrides the build() member function of the observer base.
    295295    virtual void build() {
    296       Notifier* notifier = Parent::notifier();
     296      Notifier* nf = Parent::notifier();
    297297      allocate_memory();
    298298      Item it;
    299       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    300         int id = notifier->id(it);;
     299      for (nf->first(it); it != INVALID; nf->next(it)) {
     300        int id = nf->id(it);;
    301301        allocator.construct(&(values[id]), Value());
    302302      }                                                         
     
    308308    /// and it overrides the clear() member function of the observer base.     
    309309    virtual void clear() {     
    310       Notifier* notifier = Parent::notifier();
     310      Notifier* nf = Parent::notifier();
    311311      if (capacity != 0) {
    312312        Item it;
    313         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    314           int id = notifier->id(it);
     313        for (nf->first(it); it != INVALID; nf->next(it)) {
     314          int id = nf->id(it);
    315315          allocator.destroy(&(values[id]));
    316316        }                                                               
  • lemon/bits/base_extender.h

    r2260 r2386  
    194194    }
    195195
    196     Node nodeFromId(int id) const {
    197       return Parent::nodeFromId(id);
    198     }
    199 
    200     Edge edgeFromId(int id) const {
    201       return direct(Parent::edgeFromId(id >> 1), bool(id & 1));
    202     }
    203 
    204     UEdge uEdgeFromId(int id) const {
    205       return Parent::edgeFromId(id);
     196    Node nodeFromId(int ix) const {
     197      return Parent::nodeFromId(ix);
     198    }
     199
     200    Edge edgeFromId(int ix) const {
     201      return direct(Parent::edgeFromId(ix >> 1), bool(ix & 1));
     202    }
     203
     204    UEdge uEdgeFromId(int ix) const {
     205      return Parent::edgeFromId(ix);
    206206    }
    207207
     
    239239    }
    240240
    241     Edge findEdge(Node source, Node target, Edge prev = INVALID) const {
    242       if (prev == INVALID) {
    243         UEdge edge = Parent::findEdge(source, target);
     241    Edge findEdge(Node s, Node t, Edge p = INVALID) const {
     242      if (p == INVALID) {
     243        UEdge edge = Parent::findEdge(s, t);
    244244        if (edge != INVALID) return direct(edge, true);
    245         edge = Parent::findEdge(target, source);
     245        edge = Parent::findEdge(t, s);
    246246        if (edge != INVALID) return direct(edge, false);
    247       } else if (direction(prev)) {
    248         UEdge edge = Parent::findEdge(source, target, prev);
     247      } else if (direction(p)) {
     248        UEdge edge = Parent::findEdge(s, t, p);
    249249        if (edge != INVALID) return direct(edge, true);
    250         edge = Parent::findEdge(target, source);
     250        edge = Parent::findEdge(t, s);
    251251        if (edge != INVALID) return direct(edge, false);       
    252252      } else {
    253         UEdge edge = Parent::findEdge(target, source, prev);
     253        UEdge edge = Parent::findEdge(t, s, p);
    254254        if (edge != INVALID) return direct(edge, false);             
    255255      }
     
    257257    }
    258258
    259     UEdge findUEdge(Node source, Node target, UEdge prev = INVALID) const {
    260       if (source != target) {
    261         if (prev == INVALID) {
    262           UEdge edge = Parent::findEdge(source, target);
     259    UEdge findUEdge(Node s, Node t, UEdge p = INVALID) const {
     260      if (s != t) {
     261        if (p == INVALID) {
     262          UEdge edge = Parent::findEdge(s, t);
    263263          if (edge != INVALID) return edge;
    264           edge = Parent::findEdge(target, source);
     264          edge = Parent::findEdge(t, s);
    265265          if (edge != INVALID) return edge;
    266         } else if (Parent::source(prev) == source) {
    267           UEdge edge = Parent::findEdge(source, target, prev);
     266        } else if (Parent::s(p) == s) {
     267          UEdge edge = Parent::findEdge(s, t, p);
    268268          if (edge != INVALID) return edge;
    269           edge = Parent::findEdge(target, source);
     269          edge = Parent::findEdge(t, s);
    270270          if (edge != INVALID) return edge;     
    271271        } else {
    272           UEdge edge = Parent::findEdge(target, source, prev);
     272          UEdge edge = Parent::findEdge(t, s, p);
    273273          if (edge != INVALID) return edge;           
    274274        }
    275275      } else {
    276         return Parent::findEdge(source, target, prev);
     276        return Parent::findEdge(s, t, p);
    277277      }
    278278      return INVALID;
     
    358358    }
    359359
    360     void firstInc(UEdge& edge, bool& direction, const Node& node) const {
     360    void firstInc(UEdge& edge, bool& dir, const Node& node) const {
    361361      if (Parent::aNode(node)) {
    362362        Parent::firstFromANode(edge, node);
    363         direction = true;
     363        dir = true;
    364364      } else {
    365365        Parent::firstFromBNode(edge, node);
    366         direction = static_cast<UEdge&>(edge) == INVALID;
    367       }
    368     }
    369     void nextInc(UEdge& edge, bool& direction) const {
    370       if (direction) {
     366        dir = static_cast<UEdge&>(edge) == INVALID;
     367      }
     368    }
     369    void nextInc(UEdge& edge, bool& dir) const {
     370      if (dir) {
    371371        Parent::nextFromANode(edge);
    372372      } else {
    373373        Parent::nextFromBNode(edge);
    374         if (edge == INVALID) direction = true;
     374        if (edge == INVALID) dir = true;
    375375      }
    376376    }
     
    458458        (edge.forward ? 0 : 1);
    459459    }
    460     Edge edgeFromId(int id) const {
    461       return Edge(Parent::fromUEdgeId(id >> 1), (id & 1) == 0);
     460    Edge edgeFromId(int ix) const {
     461      return Edge(Parent::fromUEdgeId(ix >> 1), (ix & 1) == 0);
    462462    }
    463463    int maxEdgeId() const {
     
    469469    }
    470470
    471     Edge direct(const UEdge& edge, bool direction) const {
    472       return Edge(edge, direction);
     471    Edge direct(const UEdge& edge, bool dir) const {
     472      return Edge(edge, dir);
    473473    }
    474474
  • lemon/bits/debug_map.h

    r2384 r2386  
    166166        }
    167167      }
    168       for (int i = 0; i < (int)flag.size(); ++i) {
     168      for (int i = 0; i < int(flag.size()); ++i) {
    169169        LEMON_ASSERT(!flag[i], MapError());
    170170      }
     
    236236    virtual void add(const Key& key) {
    237237      int id = Parent::notifier()->id(key);
    238       if (id >= (int)container.size()) {
     238      if (id >= int(container.size())) {
    239239        container.resize(id + 1);
    240240        flag.resize(id + 1, false);
     
    247247        Item it;
    248248        for (notifier->first(it); it != INVALID; notifier->next(it)) {
    249           int id = Parent::notifier()->id(it);
    250           fl[id] = true;
     249          int jd = Parent::notifier()->id(it);
     250          fl[jd] = true;
    251251        }
    252252        LEMON_ASSERT(fl == flag, MapError());
     
    260260    virtual void add(const std::vector<Key>& keys) {
    261261      int max = container.size() - 1;
    262       for (int i = 0; i < (int)keys.size(); ++i) {
     262      for (int i = 0; i < int(keys.size()); ++i) {
    263263        int id = Parent::notifier()->id(keys[i]);
    264264        if (id >= max) {
     
    268268      container.resize(max + 1);
    269269      flag.resize(max + 1, false);
    270       for (int i = 0; i < (int)keys.size(); ++i) {
     270      for (int i = 0; i < int(keys.size()); ++i) {
    271271        LEMON_ASSERT(!flag[Parent::notifier()->id(keys[i])], MapError());
    272272        flag[Parent::notifier()->id(keys[i])] = true;
     
    319319        LEMON_ASSERT(fl == flag, MapError());
    320320      }
    321       for (int i = 0; i < (int)keys.size(); ++i) {
     321      for (int i = 0; i < int(keys.size()); ++i) {
    322322        container[Parent::notifier()->id(keys[i])] = Value();
    323323        LEMON_ASSERT(flag[Parent::notifier()->id(keys[i])], MapError());
     
    332332    virtual void build() {
    333333      if (strictCheck) {
    334         for (int i = 0; i < (int)flag.size(); ++i) {
     334        for (int i = 0; i < int(flag.size()); ++i) {
    335335          LEMON_ASSERT(flag[i], MapError());
    336336        }
     
    363363      }
    364364      if (strictCheck) {
    365         for (int i = 0; i < (int)flag.size(); ++i) {
     365        for (int i = 0; i < int(flag.size()); ++i) {
    366366          LEMON_ASSERT(!flag[i], MapError());
    367367        }
  • lemon/bits/edge_set_extender.h

    r2384 r2386  
    190190    /// Returns the base node (ie. the source in this case) of the iterator
    191191    Node baseNode(const OutEdgeIt &e) const {
    192       return Parent::source((Edge)e);
     192      return Parent::source(static_cast<const Edge&>(e));
    193193    }
    194194    /// \brief Running node of the iterator
     
    197197    /// iterator
    198198    Node runningNode(const OutEdgeIt &e) const {
    199       return Parent::target((Edge)e);
     199      return Parent::target(static_cast<const Edge&>(e));
    200200    }
    201201
     
    204204    /// Returns the base node (ie. the target in this case) of the iterator
    205205    Node baseNode(const InEdgeIt &e) const {
    206       return Parent::target((Edge)e);
     206      return Parent::target(static_cast<const Edge&>(e));
    207207    }
    208208    /// \brief Running node of the iterator
     
    211211    /// iterator
    212212    Node runningNode(const InEdgeIt &e) const {
    213       return Parent::source((Edge)e);
     213      return Parent::source(static_cast<const Edge&>(e));
    214214    }
    215215
     
    497497    /// Returns the base node (ie. the source in this case) of the iterator
    498498    Node baseNode(const OutEdgeIt &e) const {
    499       return Parent::source((Edge)e);
     499      return Parent::source(static_cast<const Edge&>(e));
    500500    }
    501501    /// \brief Running node of the iterator
     
    504504    /// iterator
    505505    Node runningNode(const OutEdgeIt &e) const {
    506       return Parent::target((Edge)e);
     506      return Parent::target(static_cast<const Edge&>(e));
    507507    }
    508508
     
    511511    /// Returns the base node (ie. the target in this case) of the iterator
    512512    Node baseNode(const InEdgeIt &e) const {
    513       return Parent::target((Edge)e);
     513      return Parent::target(static_cast<const Edge&>(e));
    514514    }
    515515    /// \brief Running node of the iterator
     
    518518    /// iterator
    519519    Node runningNode(const InEdgeIt &e) const {
    520       return Parent::source((Edge)e);
     520      return Parent::source(static_cast<const Edge&>(e));
    521521    }
    522522
  • lemon/bits/graph_adaptor_extender.h

    r2231 r2386  
    400400    /// Returns the base node (ie. the source in this case) of the iterator
    401401    Node baseNode(const OutEdgeIt &e) const {
    402       return Parent::source((Edge)e);
     402      return Parent::source(static_cast<const Edge&>(e));
    403403    }
    404404    /// \brief Running node of the iterator
     
    407407    /// iterator
    408408    Node runningNode(const OutEdgeIt &e) const {
    409       return Parent::target((Edge)e);
     409      return Parent::target(static_cast<const Edge&>(e));
    410410    }
    411411
     
    414414    /// Returns the base node (ie. the target in this case) of the iterator
    415415    Node baseNode(const InEdgeIt &e) const {
    416       return Parent::target((Edge)e);
     416      return Parent::target(static_cast<const Edge&>(e));
    417417    }
    418418    /// \brief Running node of the iterator
     
    421421    /// iterator
    422422    Node runningNode(const InEdgeIt &e) const {
    423       return Parent::source((Edge)e);
     423      return Parent::source(static_cast<const Edge&>(e));
    424424    }
    425425
     
    652652    /// Returns the base node (ie. the source in this case) of the iterator
    653653    Node baseNode(const OutEdgeIt &e) const {
    654       return Parent::source((Edge&)e);
     654      return Parent::source(static_cast<const Edge&>(e));
    655655    }
    656656    /// \brief Running node of the iterator
     
    659659    /// iterator
    660660    Node runningNode(const OutEdgeIt &e) const {
    661       return Parent::target((Edge&)e);
     661      return Parent::target(static_cast<const Edge&>(e));
    662662    }
    663663 
     
    666666    /// Returns the base node (ie. the target in this case) of the iterator
    667667    Node baseNode(const InEdgeIt &e) const {
    668       return Parent::target((Edge&)e);
     668      return Parent::target(static_cast<const Edge&>(e));
    669669    }
    670670    /// \brief Running node of the iterator
     
    673673    /// iterator
    674674    Node runningNode(const InEdgeIt &e) const {
    675       return Parent::source((Edge&)e);
     675      return Parent::source(static_cast<const Edge&>(e));
    676676    }
    677677 
  • lemon/bits/graph_extender.h

    r2384 r2386  
    557557    /// Returns the base node (ie. the source in this case) of the iterator
    558558    Node baseNode(const OutEdgeIt &e) const {
    559       return Parent::source((Edge)e);
     559      return Parent::source(static_cast<const Edge&>(e));
    560560    }
    561561    /// \brief Running node of the iterator
     
    564564    /// iterator
    565565    Node runningNode(const OutEdgeIt &e) const {
    566       return Parent::target((Edge)e);
     566      return Parent::target(static_cast<const Edge&>(e));
    567567    }
    568568
     
    571571    /// Returns the base node (ie. the target in this case) of the iterator
    572572    Node baseNode(const InEdgeIt &e) const {
    573       return Parent::target((Edge)e);
     573      return Parent::target(static_cast<const Edge&>(e));
    574574    }
    575575    /// \brief Running node of the iterator
     
    578578    /// iterator
    579579    Node runningNode(const InEdgeIt &e) const {
    580       return Parent::source((Edge)e);
     580      return Parent::source(static_cast<const Edge&>(e));
    581581    }
    582582
     
    680680      UEdge uedge = Parent::addEdge(from, to);
    681681      notifier(UEdge()).add(uedge);
    682       std::vector<Edge> edges;
    683       edges.push_back(Parent::direct(uedge, true));
    684       edges.push_back(Parent::direct(uedge, false));     
    685       notifier(Edge()).add(edges);
     682      std::vector<Edge> ev;
     683      ev.push_back(Parent::direct(uedge, true));
     684      ev.push_back(Parent::direct(uedge, false));     
     685      notifier(Edge()).add(ev);
    686686      return uedge;
    687687    }
     
    722722
    723723    void erase(const UEdge& uedge) {
    724       std::vector<Edge> edges;
    725       edges.push_back(Parent::direct(uedge, true));
    726       edges.push_back(Parent::direct(uedge, false));     
    727       notifier(Edge()).erase(edges);
     724      std::vector<Edge> ev;
     725      ev.push_back(Parent::direct(uedge, true));
     726      ev.push_back(Parent::direct(uedge, false));     
     727      notifier(Edge()).erase(ev);
    728728      notifier(UEdge()).erase(uedge);
    729729      Parent::erase(uedge);
     
    10081008    /// Returns the base node (ie. the source in this case) of the iterator
    10091009    Node baseNode(const OutEdgeIt &e) const {
    1010       return Parent::source((Edge&)e);
     1010      return Parent::source(static_cast<const Edge&>(e));
    10111011    }
    10121012    /// \brief Running node of the iterator
     
    10151015    /// iterator
    10161016    Node runningNode(const OutEdgeIt &e) const {
    1017       return Parent::target((Edge&)e);
     1017      return Parent::target(static_cast<const Edge&>(e));
    10181018    }
    10191019 
     
    10221022    /// Returns the base node (ie. the target in this case) of the iterator
    10231023    Node baseNode(const InEdgeIt &e) const {
    1024       return Parent::target((Edge&)e);
     1024      return Parent::target(static_cast<const Edge&>(e));
    10251025    }
    10261026    /// \brief Running node of the iterator
     
    10291029    /// iterator
    10301030    Node runningNode(const InEdgeIt &e) const {
    1031       return Parent::source((Edge&)e);
     1031      return Parent::source(static_cast<const Edge&>(e));
    10321032    }
    10331033 
     
    12961296    }
    12971297 
    1298     UEdge addEdge(const Node& source, const Node& target) {
    1299       UEdge uedge = Parent::addEdge(source, target);
     1298    UEdge addEdge(const Node& s, const Node& t) {
     1299      UEdge uedge = Parent::addEdge(s, t);
    13001300      notifier(UEdge()).add(uedge);
    13011301   
    1302       std::vector<Edge> edges;
    1303       edges.push_back(Parent::direct(uedge, true));
    1304       edges.push_back(Parent::direct(uedge, false));
    1305       notifier(Edge()).add(edges);
     1302      std::vector<Edge> ev;
     1303      ev.push_back(Parent::direct(uedge, true));
     1304      ev.push_back(Parent::direct(uedge, false));
     1305      notifier(Edge()).add(ev);
    13061306   
    13071307      return uedge;
     
    13521352   
    13531353    void erase(const UEdge& uedge) {
    1354       std::vector<Edge> edges;
    1355       edges.push_back(Parent::direct(uedge, true));
    1356       edges.push_back(Parent::direct(uedge, false));
    1357       notifier(Edge()).erase(edges);
     1354      std::vector<Edge> ev;
     1355      ev.push_back(Parent::direct(uedge, true));
     1356      ev.push_back(Parent::direct(uedge, false));
     1357      notifier(Edge()).erase(ev);
    13581358      notifier(UEdge()).erase(uedge);
    13591359      Parent::erase(uedge);
  • lemon/bits/item_reader.h

    r2254 r2386  
    595595          if (!(is >> temp))
    596596            throw DataFormatError("DefaultReader<char> format error");
    597           value = (char)temp;
     597          value = static_cast<char>(temp);
    598598          break;
    599599        }
  • lemon/bits/item_writer.h

    r2255 r2386  
    156156      if (escaped) {
    157157        std::ostringstream ls;
    158         for (int i = 0; i < (int)value.size(); ++i) {
     158        for (int i = 0; i < int(value.size()); ++i) {
    159159          writeEscape(ls, value[i]);
    160160        }
     
    205205      default:
    206206        if (c < 0x20) {
    207           os << '\\' << std::oct << (int)c;
     207          os << '\\' << std::oct << static_cast<int>(c);
    208208        } else {
    209209          os << c;
  • lemon/bits/lp_id.h

    r2363 r2386  
    7878          impl.index[xn] = impl.first_free;
    7979          impl.first_free = xn;
    80           for(int i = fn + 1; i < (int)impl.cross.size(); ++i) {
     80          for(int i = fn + 1; i < int(impl.cross.size()); ++i) {
    8181            impl.cross[i - 1] = impl.cross[i];
    8282            impl.index[impl.cross[i]]--;
     
    9090      void firstFloating(int& fn) const {
    9191        fn = impl.first_index;
    92         if (fn == (int)impl.cross.size()) fn = -1;
     92        if (fn == int(impl.cross.size())) fn = -1;
    9393      }
    9494
    9595      void nextFloating(int& fn) const {
    9696        ++fn;
    97         if (fn == (int)impl.cross.size()) fn = -1;
     97        if (fn == int(impl.cross.size())) fn = -1;
    9898      }
    9999
  • lemon/bits/utility.h

    r2177 r2386  
    7070
    7171
    72   class InvalidType {
    73   private:
    74     InvalidType();
     72  struct InvalidType {
    7573  };
    7674
  • lemon/bits/variant.h

    r2292 r2386  
    7474    /// This constructor initalizes to the given value of the \c First
    7575    /// type.
    76     BiVariant(const First& first) {
     76    BiVariant(const First& f) {
    7777      flag = true;
    78       new(reinterpret_cast<First*>(data)) First(first);
     78      new(reinterpret_cast<First*>(data)) First(f);
    7979    }
    8080
     
    8383    /// This constructor initalizes to the given value of the \c
    8484    /// Second type.
    85     BiVariant(const Second& second) {
     85    BiVariant(const Second& s) {
    8686      flag = false;
    87       new(reinterpret_cast<Second*>(data)) Second(second);
     87      new(reinterpret_cast<Second*>(data)) Second(s);
    8888    }
    8989
     
    122122    /// This function sets the variant to the given value of the \c
    123123    /// First type.
    124     BiVariant& setFirst(const First& first) {
     124    BiVariant& setFirst(const First& f) {
    125125      destroy();
    126126      flag = true;
    127       new(reinterpret_cast<First*>(data)) First(first);   
     127      new(reinterpret_cast<First*>(data)) First(f);   
    128128      return *this;
    129129    }
     
    144144    /// This function sets the variant to the given value of the \c
    145145    /// Second type.
    146     BiVariant& setSecond(const Second& second) {
     146    BiVariant& setSecond(const Second& s) {
    147147      destroy();
    148148      flag = false;
    149       new(reinterpret_cast<Second*>(data)) Second(second);   
     149      new(reinterpret_cast<Second*>(data)) Second(s);   
    150150      return *this;
    151151    }
    152152
    153153    /// \brief Operator form of the \c setFirst()
    154     BiVariant& operator=(const First& first) {
    155       return setFirst(first);
     154    BiVariant& operator=(const First& f) {
     155      return setFirst(f);
    156156    }
    157157
    158158    /// \brief Operator form of the \c setSecond()
    159     BiVariant& operator=(const Second& second) {
    160       return setSecond(second);
     159    BiVariant& operator=(const Second& s) {
     160      return setSecond(s);
    161161    }
    162162
  • lemon/bits/vector_map.h

    r2384 r2386  
    135135    VectorMap& operator=(const CMap& cmap) {
    136136      checkConcept<concepts::ReadMap<Key, _Value>, CMap>();
    137       const typename Parent::Notifier* notifier = Parent::notifier();
     137      const typename Parent::Notifier* nf = Parent::notifier();
    138138      Item it;
    139       for (notifier->first(it); it != INVALID; notifier->next(it)) {
     139      for (nf->first(it); it != INVALID; nf->next(it)) {
    140140        set(it, cmap[it]);
    141141      }
     
    177177    virtual void add(const Key& key) {
    178178      int id = Parent::notifier()->id(key);
    179       if (id >= (int)container.size()) {
     179      if (id >= int(container.size())) {
    180180        container.resize(id + 1);
    181181      }
     
    188188    virtual void add(const std::vector<Key>& keys) {
    189189      int max = container.size() - 1;
    190       for (int i = 0; i < (int)keys.size(); ++i) {
     190      for (int i = 0; i < int(keys.size()); ++i) {
    191191        int id = Parent::notifier()->id(keys[i]);
    192192        if (id >= max) {
     
    210210    /// and it overrides the erase() member function of the observer base.     
    211211    virtual void erase(const std::vector<Key>& keys) {
    212       for (int i = 0; i < (int)keys.size(); ++i) {
     212      for (int i = 0; i < int(keys.size()); ++i) {
    213213        container[Parent::notifier()->id(keys[i])] = Value();
    214214      }
Note: See TracChangeset for help on using the changeset viewer.