From 9bd68ef9df7cadb2ca537037a425664ce14dc220 Mon Sep 17 00:00:00 2001 From: Tiago de Paula Peixoto Date: Tue, 8 May 2018 08:52:33 +0100 Subject: [PATCH] Fix compilation issues with GCC 8 --- src/graph/clustering/graph_extended_clustering.cc | 2 +- src/graph/draw/graph_cairo_draw.cc | 2 +- src/graph/generation/graph_community_network.hh | 1 - src/graph/gml.hh | 2 +- src/graph/graph_io.cc | 6 +++--- src/graph/graph_properties_copy.hh | 2 +- src/graph/graph_reverse.hh | 8 -------- src/graph/inference/support/graph_state.hh | 4 ++-- src/graph/topology/graph_all_distances.cc | 4 ++-- 9 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/graph/clustering/graph_extended_clustering.cc b/src/graph/clustering/graph_extended_clustering.cc index b21ccaa5..fcdf4500 100644 --- a/src/graph/clustering/graph_extended_clustering.cc +++ b/src/graph/clustering/graph_extended_clustering.cc @@ -58,7 +58,7 @@ struct prop_vector any_cast(props[i]).get_unchecked(size); prop_vec = vec; } - catch (bad_any_cast){} + catch (bad_any_cast&){} } } }; diff --git a/src/graph/draw/graph_cairo_draw.cc b/src/graph/draw/graph_cairo_draw.cc index 28106d7d..1c11598c 100644 --- a/src/graph/draw/graph_cairo_draw.cc +++ b/src/graph/draw/graph_cairo_draw.cc @@ -247,7 +247,7 @@ struct Converter { val_name = lexical_cast(v); } - catch (bad_lexical_cast) + catch (bad_lexical_cast&) { val_name = ""; } diff --git a/src/graph/generation/graph_community_network.hh b/src/graph/generation/graph_community_network.hh index 98e18b23..6b39a216 100644 --- a/src/graph/generation/graph_community_network.hh +++ b/src/graph/generation/graph_community_network.hh @@ -197,7 +197,6 @@ inline void operator/=(vector& v1, const vector& v2) v1.resize(max(v1.size(), v2.size())); for (size_t i = 0; i < v2.size(); ++i) v1[i] /= v2[i]; - return v1; } template diff --git a/src/graph/gml.hh b/src/graph/gml.hh index e808e5b4..65eb9e41 100644 --- a/src/graph/gml.hh +++ b/src/graph/gml.hh @@ -386,7 +386,7 @@ struct get_str sval = "\"" + sval + "\""; } } - catch (bad_any_cast) + catch (bad_any_cast&) { } } diff --git a/src/graph/graph_io.cc b/src/graph/graph_io.cc index 3b749d85..b5b8c4a5 100644 --- a/src/graph/graph_io.cc +++ b/src/graph/graph_io.cc @@ -218,7 +218,7 @@ struct check_value_type _map = new boost::detail::dynamic_property_map_adaptor (vector_map); } - catch (bad_any_cast) {} + catch (bad_any_cast&) {} } IndexMap _index_map; const key_t& _key; @@ -249,7 +249,7 @@ struct create_dynamic_map any_cast(key), value, map)); } - catch (bad_any_cast) + catch (bad_any_cast&) { try { @@ -258,7 +258,7 @@ struct create_dynamic_map any_cast(key), value, map)); } - catch (bad_any_cast) + catch (bad_any_cast&) { ConstantPropertyMap graph_index(0); boost::mpl::for_each diff --git a/src/graph/graph_properties_copy.hh b/src/graph/graph_properties_copy.hh index 157453e5..37188f46 100644 --- a/src/graph/graph_properties_copy.hh +++ b/src/graph/graph_properties_copy.hh @@ -44,7 +44,7 @@ struct copy_property auto src_map = boost::any_cast(prop_src); dispatch(tgt, src, dst_map, src_map); } - catch (boost::bad_any_cast) + catch (boost::bad_any_cast&) { typedef typename boost::property_traits::value_type val_tgt; typedef typename IteratorSel::template get_descriptor::type src_d; diff --git a/src/graph/graph_reverse.hh b/src/graph/graph_reverse.hh index 4eb78606..6b7de594 100644 --- a/src/graph/graph_reverse.hh +++ b/src/graph/graph_reverse.hh @@ -273,14 +273,6 @@ target(const typename reversed_graph::edge_descriptor& return source(e, g._g); } -template -inline -typename graph_traits>::vertex_descriptor -vertex(size_t i, const reversed_graph& g) -{ - return vertex(i, g._g); -} - template inline std::pair::out_edge_iterator, typename reversed_graph::out_edge_iterator> diff --git a/src/graph/inference/support/graph_state.hh b/src/graph/inference/support/graph_state.hh index 5c20ef7b..ae6f8052 100644 --- a/src/graph/inference/support/graph_state.hh +++ b/src/graph/inference/support/graph_state.hh @@ -258,7 +258,7 @@ struct StateWrap T val = any_cast(aval); return val; } - catch (boost::bad_any_cast) + catch (boost::bad_any_cast&) { try { @@ -269,7 +269,7 @@ struct StateWrap auto val = any_cast(aval); return val.get(); } - catch (boost::bad_any_cast) + catch (boost::bad_any_cast&) { throw ValueException("Cannot extract parameter '" + name + "' of desired type: " + diff --git a/src/graph/topology/graph_all_distances.cc b/src/graph/topology/graph_all_distances.cc index 460c561b..7ed9c2c0 100644 --- a/src/graph/topology/graph_all_distances.cc +++ b/src/graph/topology/graph_all_distances.cc @@ -110,6 +110,7 @@ struct do_all_pairs_search_unweighted void operator()(const Graph& g, DistMap dist_map) const { typedef typename graph_traits::vertex_descriptor vertex_t; + typedef typename property_traits::value_type dist_t; vector pred_map(num_vertices(g)); #pragma omp parallel if (num_vertices(g) > OPENMP_MIN_THRESH) \ @@ -119,8 +120,7 @@ struct do_all_pairs_search_unweighted [&](auto v) { dist_map[v].resize(num_vertices(g), 0); - bfs_visitor::type, - vector> + bfs_visitor> vis(dist_map[v], pred_map, v); breadth_first_search(g, v, visitor(vis)); }); -- GitLab