COIN-OR::LEMON - Graph Library

Changeset 997:761fe0846f49 in lemon-main


Ignore:
Timestamp:
09/13/12 11:45:36 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
998:7fdaa05a69a1, 1005:c5990f454032
Phase:
public
Message:

Fix clang compilation warnings and errors (#449)

Files:
17 edited

Legend:

Unmodified
Added
Removed
  • lemon/adaptors.h

    r656 r997  
    13651365    /// and edge filter maps.
    13661366    SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
    1367       initialize(graph, node_filter, edge_filter);
     1367      this->initialize(graph, node_filter, edge_filter);
    13681368    }
    13691369
     
    22622262    /// Creates an undirected graph from the given digraph.
    22632263    Undirector(DGR& digraph) {
    2264       initialize(digraph);
     2264      this->initialize(digraph);
    22652265    }
    22662266
  • lemon/bits/bezier.h

    r440 r997  
    160160    const Point d=(a+b)/2;
    161161    const Point e=(b+c)/2;
    162     const Point f=(d+e)/2;
     162    // const Point f=(d+e)/2;
    163163    R f1=_f(Bezier3(p1,a,d,e),_d);
    164164    R f2=_f(Bezier3(e,d,c,p4),_d);
  • lemon/bits/edge_set_extender.h

    r962 r997  
    524524    // Returns the base node of the iterator
    525525    Node baseNode(const IncEdgeIt &e) const {
    526       return e.direction ? u(e) : v(e);
     526      return e.direction ? this->u(e) : this->v(e);
    527527    }
    528528    // Running node of the iterator
     
    530530    // Returns the running node of the iterator
    531531    Node runningNode(const IncEdgeIt &e) const {
    532       return e.direction ? v(e) : u(e);
     532      return e.direction ? this->v(e) : this->u(e);
    533533    }
    534534
  • lemon/bits/graph_extender.h

    r685 r997  
    588588    // Returns the base node of the iterator
    589589    Node baseNode(const IncEdgeIt &edge) const {
    590       return edge._direction ? u(edge) : v(edge);
     590      return edge._direction ? this->u(edge) : this->v(edge);
    591591    }
    592592    // Running node of the iterator
     
    594594    // Returns the running node of the iterator
    595595    Node runningNode(const IncEdgeIt &edge) const {
    596       return edge._direction ? v(edge) : u(edge);
     596      return edge._direction ? this->v(edge) : this->u(edge);
    597597    }
    598598
  • lemon/circulation.h

    r688 r997  
    559559
    560560      Node act;
    561       Node bact=INVALID;
    562       Node last_activated=INVALID;
    563561      while((act=_level->highestActive())!=INVALID) {
    564562        int actlevel=(*_level)[act];
  • lemon/concept_check.h

    r440 r997  
    3636
    3737  template <class T> inline void ignore_unused_variable_warning(const T&) { }
     38  template <class T1, class T2>
     39  inline void ignore_unused_variable_warning(const T1&, const T2&) { }
     40  template <class T1, class T2, class T3>
     41  inline void ignore_unused_variable_warning(const T1&, const T2&,
     42                                             const T3&) { }
     43  template <class T1, class T2, class T3, class T4>
     44  inline void ignore_unused_variable_warning(const T1&, const T2&,
     45                                             const T3&, const T4&) { }
     46  template <class T1, class T2, class T3, class T4, class T5>
     47  inline void ignore_unused_variable_warning(const T1&, const T2&,
     48                                             const T3&, const T4&,
     49                                             const T5&) { }
     50  template <class T1, class T2, class T3, class T4, class T5, class T6>
     51  inline void ignore_unused_variable_warning(const T1&, const T2&,
     52                                             const T3&, const T4&,
     53                                             const T5&, const T6&) { }
    3854
    3955  ///\e
  • lemon/concepts/graph_components.h

    r975 r997  
    495495          _GraphItemIt it3 = it1;
    496496          _GraphItemIt it4 = INVALID;
     497          ignore_unused_variable_warning(it3);
     498          ignore_unused_variable_warning(it4);
    497499
    498500          it2 = ++it1;
     
    584586          _GraphIncIt it3 = it1;
    585587          _GraphIncIt it4 = INVALID;
     588          ignore_unused_variable_warning(it3);
     589          ignore_unused_variable_warning(it4);
    586590
    587591          it2 = ++it1;
  • lemon/concepts/maps.h

    r975 r997  
    5050      /// Returns the value associated with the given key.
    5151      Value operator[](const Key &) const {
    52         return *static_cast<Value *>(0);
     52        return *(static_cast<Value *>(0)+1);
    5353      }
    5454
  • lemon/graph_to_eps.h

    r959 r997  
    223223  using T::_copyright;
    224224
    225   using T::NodeTextColorType;
     225  using typename T::NodeTextColorType;
    226226  using T::CUST_COL;
    227227  using T::DIST_COL;
  • test/adaptors_test.cc

    r465 r997  
    6666  Digraph::Arc a2 = digraph.addArc(n1, n3);
    6767  Digraph::Arc a3 = digraph.addArc(n2, n3);
     68  ignore_unused_variable_warning(a3);
    6869
    6970  // Check the adaptor
     
    100101  Adaptor::Arc a7 = adaptor.addArc(n1, n4);
    101102  Adaptor::Arc a8 = adaptor.addArc(n1, n2);
     103  ignore_unused_variable_warning(a6,a7,a8);
    102104
    103105  adaptor.erase(a1);
     
    759761  Digraph::Arc a2 = digraph.addArc(n1, n3);
    760762  Digraph::Arc a3 = digraph.addArc(n2, n3);
     763  ignore_unused_variable_warning(a1,a2,a3);
    761764
    762765  checkGraphNodeList(adaptor, 6);
  • test/connectivity_test.cc

    r649 r997  
    6969    Graph g(d);
    7070    Digraph::Node n = d.addNode();
     71    ignore_unused_variable_warning(n);
    7172
    7273    check(stronglyConnected(d), "This digraph is strongly connected");
     
    246247    Digraph::Node watch = d.addNode();
    247248    Digraph::Node pants = d.addNode();
     249    ignore_unused_variable_warning(watch);
    248250
    249251    d.addArc(socks, shoe);
  • test/digraph_test.cc

    r440 r997  
    6161      a3 = G.addArc(n2, n3),
    6262      a4 = G.addArc(n2, n3);
     63  ignore_unused_variable_warning(a2,a3,a4);
    6364
    6465  checkGraphNodeList(G, 3);
     
    8990  Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
    9091      a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
     92  ignore_unused_variable_warning(a1,a2,a3,a4);
    9193
    9294  Node n4 = G.split(n2);
     
    122124      a3 = G.addArc(n4, n3), a4 = G.addArc(n4, n3),
    123125      a5 = G.addArc(n2, n4);
     126  ignore_unused_variable_warning(a1,a2,a3,a5);
    124127
    125128  checkGraphNodeList(G, 4);
     
    201204      a3 = G.addArc(n4, n3), a4 = G.addArc(n3, n1),
    202205      a5 = G.addArc(n2, n4);
     206  ignore_unused_variable_warning(a2,a3,a4,a5);
    203207
    204208  // Check arc deletion
     
    248252  Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
    249253      a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
     254  ignore_unused_variable_warning(a1,a2,a3,a4);
    250255
    251256  typename Digraph::Snapshot snapshot(G);
     
    336341    e1 = g.addArc(n1, n2),
    337342    e2 = g.addArc(n2, n3);
     343  ignore_unused_variable_warning(e2);
    338344
    339345  check(g.valid(n1), "Wrong validity check");
  • test/edge_set_test.cc

    r488 r997  
    4545
    4646  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     47  ignore_unused_variable_warning(ga1);
    4748
    4849  ArcSet arc_set(digraph);
    4950
    5051  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     52  ignore_unused_variable_warning(ga2);
    5153
    5254  checkGraphNodeList(arc_set, 2);
     
    7678    a3 = arc_set.addArc(n2, n3),
    7779    a4 = arc_set.addArc(n2, n3);
     80  ignore_unused_variable_warning(a2,a3,a4);
     81
    7882  checkGraphNodeList(arc_set, 3);
    7983  checkGraphArcList(arc_set, 4);
     
    111115
    112116  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     117  ignore_unused_variable_warning(ga1);
    113118
    114119  ArcSet arc_set(digraph);
    115120
    116121  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     122  ignore_unused_variable_warning(ga2);
    117123
    118124  checkGraphNodeList(arc_set, 2);
     
    142148    a3 = arc_set.addArc(n2, n3),
    143149    a4 = arc_set.addArc(n2, n3);
     150  ignore_unused_variable_warning(a2,a3,a4);
     151
    144152  checkGraphNodeList(arc_set, 3);
    145153  checkGraphArcList(arc_set, 4);
     
    191199
    192200  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     201  ignore_unused_variable_warning(ga1);
    193202
    194203  EdgeSet edge_set(digraph);
    195204
    196205  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     206  ignore_unused_variable_warning(ga2);
    197207
    198208  checkGraphNodeList(edge_set, 2);
     
    231241    e3 = edge_set.addEdge(n2, n3),
    232242    e4 = edge_set.addEdge(n2, n3);
     243  ignore_unused_variable_warning(e2,e3,e4);
     244
    233245  checkGraphNodeList(edge_set, 3);
    234246  checkGraphEdgeList(edge_set, 4);
     
    275287
    276288  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     289  ignore_unused_variable_warning(ga1);
    277290
    278291  EdgeSet edge_set(digraph);
    279292
    280293  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     294  ignore_unused_variable_warning(ga2);
    281295
    282296  checkGraphNodeList(edge_set, 2);
     
    315329    e3 = edge_set.addEdge(n2, n3),
    316330    e4 = edge_set.addEdge(n2, n3);
     331  ignore_unused_variable_warning(e2,e3,e4);
     332
    317333  checkGraphNodeList(edge_set, 3);
    318334  checkGraphEdgeList(edge_set, 4);
  • test/euler_test.cc

    r592 r997  
    102102    Graph g(d);
    103103    Digraph::Node n = d.addNode();
    104 
     104    ignore_unused_variable_warning(n);
     105 
    105106    checkDiEulerIt(d);
    106107    checkDiEulerIt(g);
     
    190191    Digraph::Node n4 = d.addNode();
    191192    Digraph::Node n5 = d.addNode();
    192    
     193    ignore_unused_variable_warning(n0,n4,n5);
     194
    193195    d.addArc(n1, n2);
    194196    d.addArc(n2, n3);
  • test/graph_test.cc

    r440 r997  
    6464  Edge e2 = G.addEdge(n2, n1),
    6565       e3 = G.addEdge(n2, n3);
     66  ignore_unused_variable_warning(e2,e3);
    6667
    6768  checkGraphNodeList(G, 3);
     
    9697       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    9798       e5 = G.addEdge(n4, n3);
     99  ignore_unused_variable_warning(e1,e3,e4,e5);
    98100
    99101  checkGraphNodeList(G, 4);
     
    175177       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    176178       e5 = G.addEdge(n4, n3);
     179  ignore_unused_variable_warning(e1,e3,e4,e5);
    177180
    178181  // Check edge deletion
     
    215218  Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    216219       e3 = G.addEdge(n2, n3);
     220  ignore_unused_variable_warning(e1,e2,e3);
    217221
    218222  checkGraphNodeList(G, 3);
     
    363367    e1 = g.addEdge(n1, n2),
    364368    e2 = g.addEdge(n2, n3);
     369  ignore_unused_variable_warning(e2);
    365370
    366371  check(g.valid(n1), "Wrong validity check");
     
    492497
    493498  Node n = G.nodeFromId(dim);
     499  ignore_unused_variable_warning(n);
    494500
    495501  for (NodeIt n(G); n != INVALID; ++n) {
  • test/maps_test.cc

    r684 r997  
    7979    NullMap<A,B> map1;
    8080    NullMap<A,B> map2 = map1;
     81    ignore_unused_variable_warning(map2);
    8182    map1 = nullMap<A,B>();
    8283  }
     
    8990    ConstMap<A,B> map2 = B();
    9091    ConstMap<A,B> map3 = map1;
     92    ignore_unused_variable_warning(map2,map3);
     93
    9194    map1 = constMap<A>(B());
    9295    map1 = constMap<A,B>();
     
    9497    ConstMap<A,C> map4(C(1));
    9598    ConstMap<A,C> map5 = map4;
     99    ignore_unused_variable_warning(map5);
     100
    96101    map4 = constMap<A>(C(2));
    97102    map4.setAll(C(3));
     
    114119    IdentityMap<A> map1;
    115120    IdentityMap<A> map2 = map1;
     121    ignore_unused_variable_warning(map2);
     122
    116123    map1 = identityMap<A>();
    117124
     
    173180    checkConcept<ReadMap<B,double>, CompMap>();
    174181    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     182    ignore_unused_variable_warning(map1);
    175183    CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
     184    ignore_unused_variable_warning(map2);
    176185
    177186    SparseMap<double, bool> m1(false); m1[3.14] = true;
     
    186195    checkConcept<ReadMap<A,double>, CombMap>();
    187196    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
     197    ignore_unused_variable_warning(map1);
    188198    CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
     199    ignore_unused_variable_warning(map2);
    189200
    190201    check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
     
    198209    FunctorToMap<F> map1;
    199210    FunctorToMap<F> map2 = FunctorToMap<F>(F());
     211    ignore_unused_variable_warning(map2);
     212
    200213    B b = functorToMap(F())[A()];
     214    ignore_unused_variable_warning(b);
    201215
    202216    checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    203     MapToFunctor<ReadMap<A,B> > map = MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     217    MapToFunctor<ReadMap<A,B> > map =
     218      MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     219    ignore_unused_variable_warning(map);
    204220
    205221    check(functorToMap(&func)[A()] == 3,
     
    219235      ConvertMap<ReadMap<double, int>, double> >();
    220236    ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true));
     237    ignore_unused_variable_warning(map1);
    221238    ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false));
     239    ignore_unused_variable_warning(map2);
     240
    222241  }
    223242
  • test/time_measure_test.cc

    r558 r997  
    1818
    1919#include <lemon/time_measure.h>
     20#include <lemon/concept_check.h>
    2021
    2122using namespace lemon;
     
    3334
    3435  for(int i=0;i<1000;i++)
    35     TimeStamp x(T);
     36    {
     37      TimeStamp x(T);
     38      ignore_unused_variable_warning(x);
     39    }
    3640}
    3741
Note: See TracChangeset for help on using the changeset viewer.