From 27041cc05f8cb258bce2c872d09206f5c36f6ebe Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 10 Oct 2024 12:18:00 -0600 Subject: [PATCH] (tidy) Fixing errors --- include/breadthFirstSearch/breadthFirstSearch.hpp | 3 ++- include/lineGraph/lineGraphFull.hpp | 2 +- src/breadthFirstSearch/breadthFirstSearch_driver.cpp | 2 ++ src/coloring/bipartite_driver.cpp | 2 ++ src/coloring/edgeColoring.cpp | 2 ++ src/components/components.cpp | 1 + src/driving_distance/driving_distance_withPoints.c | 2 +- src/pickDeliver/optimize.cpp | 2 +- src/spanningTree/kruskal_driver.cpp | 2 ++ src/spanningTree/prim_driver.cpp | 2 ++ 10 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/breadthFirstSearch/breadthFirstSearch.hpp b/include/breadthFirstSearch/breadthFirstSearch.hpp index 7dd474b04e..83e139ad58 100644 --- a/include/breadthFirstSearch/breadthFirstSearch.hpp +++ b/include/breadthFirstSearch/breadthFirstSearch.hpp @@ -28,12 +28,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include -#include +#include #include #include "cpp_common/base_graph.hpp" #include "cpp_common/interruption.hpp" #include "c_types/mst_rt.h" +#include "visitors/edges_order_bfs_visitor.hpp" //****************************************** diff --git a/include/lineGraph/lineGraphFull.hpp b/include/lineGraph/lineGraphFull.hpp index c433f3ad31..a6cf3dff59 100644 --- a/include/lineGraph/lineGraphFull.hpp +++ b/include/lineGraph/lineGraphFull.hpp @@ -55,7 +55,7 @@ class Pgr_lineGraphFull : public Pgr_base_graph { typedef typename boost::graph_traits < G >::in_edge_iterator EI_i; - explicit Pgr_lineGraphFull< G, T_V, T_E, t_directed>(bool directed) + explicit Pgr_lineGraphFull< G, T_V, T_E, t_directed>() : Pgr_base_graph(), m_num_edges(0) { } diff --git a/src/breadthFirstSearch/breadthFirstSearch_driver.cpp b/src/breadthFirstSearch/breadthFirstSearch_driver.cpp index 728a454945..06eb026f2a 100644 --- a/src/breadthFirstSearch/breadthFirstSearch_driver.cpp +++ b/src/breadthFirstSearch/breadthFirstSearch_driver.cpp @@ -77,11 +77,13 @@ pgr_do_breadthFirstSearch( char *hint = nullptr; try { + // NOLINTBEGIN(clang-analyzer-cplusplus.NewDelete) pgassert(!(*log_msg)); pgassert(!(*notice_msg)); pgassert(!(*err_msg)); pgassert(!(*return_tuples)); pgassert(*return_count == 0); + // NOLINTEND(clang-analyzer-cplusplus.NewDelete) diff --git a/src/coloring/bipartite_driver.cpp b/src/coloring/bipartite_driver.cpp index 29e2014ffd..66f1f779eb 100644 --- a/src/coloring/bipartite_driver.cpp +++ b/src/coloring/bipartite_driver.cpp @@ -63,11 +63,13 @@ pgr_do_bipartite( try { + // NOLINTBEGIN(clang-analyzer-cplusplus.NewDelete) pgassert(!(*log_msg)); pgassert(!(*notice_msg)); pgassert(!(*err_msg)); pgassert(!(*return_tuples)); pgassert(*return_count == 0); + // NOLINTEND(clang-analyzer-cplusplus.NewDelete) hint = edges_sql; auto edges = pgrouting::pgget::get_edges(std::string(edges_sql), true, false); diff --git a/src/coloring/edgeColoring.cpp b/src/coloring/edgeColoring.cpp index 1f427a8939..35ff877b0e 100644 --- a/src/coloring/edgeColoring.cpp +++ b/src/coloring/edgeColoring.cpp @@ -89,6 +89,7 @@ Pgr_edgeColoring::Pgr_edgeColoring(const std::vector &edges) { auto v1 = get_boost_vertex(edge.source); auto v2 = get_boost_vertex(edge.target); auto e_exists = boost::edge(v1, v2, graph); + // NOLINTNEXTLINE if (e_exists.second) continue; if (edge.source == edge.target) continue; @@ -96,6 +97,7 @@ Pgr_edgeColoring::Pgr_edgeColoring(const std::vector &edges) { if (edge.cost < 0 && edge.reverse_cost < 0) continue; E e; + // NOLINTNEXTLINE boost::tie(e, added) = boost::add_edge(v1, v2, graph); E_to_id.insert(std::make_pair(e, edge.id)); diff --git a/src/components/components.cpp b/src/components/components.cpp index f38c183c62..c2dbf824ad 100644 --- a/src/components/components.cpp +++ b/src/components/components.cpp @@ -110,6 +110,7 @@ biconnectedComponents( boost::associative_property_map bimap(bicmp_map); size_t num_comps; try { + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDelete) num_comps = biconnected_components(graph.graph, bimap); } catch (...) { throw; diff --git a/src/driving_distance/driving_distance_withPoints.c b/src/driving_distance/driving_distance_withPoints.c index b320009d35..130e633f97 100644 --- a/src/driving_distance/driving_distance_withPoints.c +++ b/src/driving_distance/driving_distance_withPoints.c @@ -70,7 +70,7 @@ process( } } else { /* TODO remove on v4 */ - char d_side = (char)tolower(driving_side[0]); + d_side = (char)tolower(driving_side[0]); if (!((d_side == 'r') || (d_side == 'l'))) d_side = 'b'; } diff --git a/src/pickDeliver/optimize.cpp b/src/pickDeliver/optimize.cpp index 5331753b7f..983aeb5290 100644 --- a/src/pickDeliver/optimize.cpp +++ b/src/pickDeliver/optimize.cpp @@ -249,7 +249,7 @@ Optimize::swap_worse(Vehicle_pickDeliver &to, Vehicle_pickDeliver &from) { } } - return false && swapped; + return swapped; } diff --git a/src/spanningTree/kruskal_driver.cpp b/src/spanningTree/kruskal_driver.cpp index 05c4714824..91d9b2328a 100644 --- a/src/spanningTree/kruskal_driver.cpp +++ b/src/spanningTree/kruskal_driver.cpp @@ -68,11 +68,13 @@ pgr_do_kruskal( char *hint = nullptr; try { + // NOLINTBEGIN(clang-analyzer-cplusplus.NewDelete) pgassert(!(*log_msg)); pgassert(!(*notice_msg)); pgassert(!(*err_msg)); pgassert(!(*return_tuples)); pgassert(*return_count == 0); + // NOLINTEND(clang-analyzer-cplusplus.NewDelete) auto roots = get_intArray(starts, false); diff --git a/src/spanningTree/prim_driver.cpp b/src/spanningTree/prim_driver.cpp index e5a124bc9d..de2f06b5ff 100644 --- a/src/spanningTree/prim_driver.cpp +++ b/src/spanningTree/prim_driver.cpp @@ -70,11 +70,13 @@ pgr_do_prim( char *hint = nullptr; try { + // NOLINTBEGIN(clang-analyzer-cplusplus.NewDelete) pgassert(!(*log_msg)); pgassert(!(*notice_msg)); pgassert(!(*err_msg)); pgassert(!(*return_tuples)); pgassert(*return_count == 0); + // NOLINTEND(clang-analyzer-cplusplus.NewDelete) auto roots = get_intArray(starts, false);