Skip to content

Commit b82fbc9

Browse files
committed
Fixing warnings from rabbit
1 parent b561cd0 commit b82fbc9

7 files changed

Lines changed: 11 additions & 13 deletions

File tree

include/coloring/bipartite.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4040
namespace pgrouting {
4141
namespace functions {
4242

43-
std::vector<II_t_rt> pgr_bipartite(pgrouting::UndirectedGraph&);
43+
std::vector<II_t_rt> pgr_bipartite(const pgrouting::UndirectedGraph&);
4444

4545
} // namespace functions
4646
} // namespace pgrouting

src/coloring/bipartite.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3939

4040
namespace {
4141

42-
std::vector<II_t_rt> get_bipartition(pgrouting::UndirectedGraph &graph) {
42+
std::vector<II_t_rt> get_bipartition(const pgrouting::UndirectedGraph &graph) {
4343
using V_i = pgrouting::UndirectedGraph::V_i;
4444

4545
std::vector<II_t_rt> results;
@@ -56,7 +56,7 @@ std::vector<II_t_rt> get_bipartition(pgrouting::UndirectedGraph &graph) {
5656
throw;
5757
} catch (...) {
5858
throw std::make_pair(
59-
std::string("INTERNAL: something went wrong while calling boost::edge_coloring"),
59+
std::string("INTERNAL: something went wrong while calling boost::bipartite"),
6060
std::string(__PGR_PRETTY_FUNCTION__));;
6161
}
6262

@@ -65,7 +65,7 @@ std::vector<II_t_rt> get_bipartition(pgrouting::UndirectedGraph &graph) {
6565
int64_t vid = graph[*v].id;
6666
boost::get(partition_map, *v) ==
6767
boost::color_traits <boost::default_color_type>::white() ?
68-
results.push_back({{vid}, {0}}) : results.push_back({{vid}, {1}});
68+
results.push_back({vid, 0}) : results.push_back({vid, 1});
6969
}
7070
return results;
7171
}
@@ -75,7 +75,7 @@ std::vector<II_t_rt> get_bipartition(pgrouting::UndirectedGraph &graph) {
7575
namespace pgrouting {
7676
namespace functions {
7777

78-
std::vector<II_t_rt> pgr_bipartite(pgrouting::UndirectedGraph &graph ) {
78+
std::vector<II_t_rt> pgr_bipartite(const pgrouting::UndirectedGraph &graph ) {
7979
bool bipartite = boost::is_bipartite(graph.graph);
8080
return (bipartite)? get_bipartition(graph) : std::vector<II_t_rt>();
8181
}

src/coloring/coloring_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void do_coloring(
101101
results = sequentialVertexColoring(undigraph);
102102
break;
103103
default:
104-
err << "Unknown coloring function" << get_name(which);
104+
err << "Unknown coloring function " << get_name(which);
105105
return;
106106
}
107107

src/coloring/coloring_process.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ void pgr_process_coloring(
5353
II_t_rt **result_tuples,
5454
size_t *result_count) {
5555
using pgrouting::to_pg_msg;
56-
using pgrouting::pgr_free;
57-
pgassert(edges_sql);
56+
5857
pgassert(!(*result_tuples));
5958
pgassert(*result_count == 0);
6059
pgr_SPI_connect();

src/coloring/edgeColoring.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*PGR-GNU*****************************************************************
22
File: edgeColoring.c
3-
Generated with Template by:
43
54
Generated with Template by:
65
Copyright (c) 2015-2026 pgRouting developers

src/coloring/edgeColoring.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace pgrouting {
4646
namespace functions {
4747

4848
std::vector<II_t_rt>
49-
edgeColoring(pgrouting::UndirectedGraph g) {
49+
edgeColoring(const pgrouting::UndirectedGraph g) {
5050
std::vector<II_t_rt> results(boost::num_edges(g.graph));
5151
using B_G = pgrouting::UndirectedGraph::B_G;
5252
using E = pgrouting::UndirectedGraph::E;
@@ -79,7 +79,7 @@ edgeColoring(pgrouting::UndirectedGraph g) {
7979

8080
/**
8181
* There is a problem with boost:
82-
* Sometimes it returns a color with outsatnding large value
82+
* Sometimes it returns a color with outstanding large value
8383
* When that happens changing color to: colors + 1
8484
*/
8585
results[i].d2 = get(color_map, *ei) < colors? get(color_map, *ei) + 1 : colors + 1;

src/coloring/sequentialVertexColoring.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ std::vector<II_t_rt> get_results(
5858
for (boost::tie(v, vend) = vertices(graph.graph); v != vend; ++v) {
5959
int64_t node = graph[*v].id;
6060
auto color = colors[*v];
61-
results.push_back({{node}, {static_cast<int64_t>(color + 1)}});
61+
results.push_back({node, static_cast<int64_t>(color + 1)});
6262
}
6363

6464
// ordering the results in an increasing order of the node id
@@ -109,7 +109,7 @@ std::vector<II_t_rt> sequentialVertexColoring(const pgrouting::UndirectedGraph &
109109
throw;
110110
} catch (...) {
111111
throw std::make_pair(
112-
std::string("INTERNAL: something went wrong while calling boost::edge_coloring"),
112+
std::string("INTERNAL: something went wrong while calling boost::sequential_vertex_coloring"),
113113
std::string(__PGR_PRETTY_FUNCTION__));;
114114
}
115115

0 commit comments

Comments
 (0)