diff --git a/include/contractor/query_edge.hpp b/include/contractor/query_edge.hpp index c3056f355..3776aab18 100644 --- a/include/contractor/query_edge.hpp +++ b/include/contractor/query_edge.hpp @@ -15,8 +15,8 @@ struct QueryEdge struct EdgeData { explicit EdgeData() - : turn_id(0), shortcut(false), weight{0}, duration(0), forward(false), backward(false), - distance{0} + : turn_id(0), shortcut(false), weight{0}, duration(0), forward(false), + backward(false), distance{0} { } diff --git a/include/engine/api/base_api.hpp b/include/engine/api/base_api.hpp index ed9357a1e..344f6499a 100644 --- a/include/engine/api/base_api.hpp +++ b/include/engine/api/base_api.hpp @@ -72,8 +72,9 @@ class BaseAPI std::transform(candidates.begin(), candidates.end(), seg_hints.begin(), - [this](const auto &phantom) - { return SegmentHint{phantom, facade.GetCheckSum()}; }); + [this](const auto &phantom) { + return SegmentHint{phantom, facade.GetCheckSum()}; + }); return json::makeWaypoint( snapped_location, @@ -141,8 +142,9 @@ class BaseAPI std::transform(candidates.begin(), candidates.end(), seg_hints.begin(), - [this](const auto &phantom) - { return SegmentHint{phantom, facade.GetCheckSum()}; }); + [this](const auto &phantom) { + return SegmentHint{phantom, facade.GetCheckSum()}; + }); Hint hint{std::move(seg_hints)}; hint_string = builder->CreateString(hint.ToBase64()); } diff --git a/include/engine/api/match_parameters.hpp b/include/engine/api/match_parameters.hpp index 6f5563f90..abc93a650 100644 --- a/include/engine/api/match_parameters.hpp +++ b/include/engine/api/match_parameters.hpp @@ -78,8 +78,9 @@ struct MatchParameters : public RouteParameters bool tidy_, const std::vector &waypoints_, Args &&...args_) - : RouteParameters{std::forward(args_)..., waypoints_}, - timestamps{std::move(timestamps_)}, gaps(gaps_), tidy(tidy_) + : RouteParameters{std::forward(args_)..., waypoints_}, timestamps{std::move( + timestamps_)}, + gaps(gaps_), tidy(tidy_) { } diff --git a/include/engine/api/route_parameters.hpp b/include/engine/api/route_parameters.hpp index 69f54555b..267058a46 100644 --- a/include/engine/api/route_parameters.hpp +++ b/include/engine/api/route_parameters.hpp @@ -141,8 +141,8 @@ struct RouteParameters : public BaseParameters : BaseParameters{std::forward(args_)...}, steps{steps_}, alternatives{alternatives_}, number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_}, annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None}, - geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}, - waypoints{std::move(waypoints_)} + geometries{geometries_}, overview{overview_}, + continue_straight{continue_straight_}, waypoints{std::move(waypoints_)} { } @@ -157,10 +157,10 @@ struct RouteParameters : public BaseParameters std::vector waypoints_, Args &&...args_) : BaseParameters{std::forward(args_)...}, steps{steps_}, alternatives{alternatives_}, - number_of_alternatives{alternatives_ ? 1u : 0u}, - annotations{annotations_ != AnnotationsType::None}, annotations_type{annotations_}, - geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}, - waypoints{std::move(waypoints_)} + number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_ != + AnnotationsType::None}, + annotations_type{annotations_}, geometries{geometries_}, overview{overview_}, + continue_straight{continue_straight_}, waypoints{std::move(waypoints_)} { } diff --git a/include/engine/api/trip_parameters.hpp b/include/engine/api/trip_parameters.hpp index 8ae9a8001..7ad785ac0 100644 --- a/include/engine/api/trip_parameters.hpp +++ b/include/engine/api/trip_parameters.hpp @@ -61,8 +61,8 @@ struct TripParameters : public RouteParameters DestinationType destination_, bool roundtrip_, Args &&...args_) - : RouteParameters{std::forward(args_)...}, source{source_}, destination{destination_}, - roundtrip{roundtrip_} + : RouteParameters{std::forward(args_)...}, source{source_}, + destination{destination_}, roundtrip{roundtrip_} { } diff --git a/include/engine/phantom_node.hpp b/include/engine/phantom_node.hpp index 3ddfaa2a5..c7d0c0bf2 100644 --- a/include/engine/phantom_node.hpp +++ b/include/engine/phantom_node.hpp @@ -44,15 +44,16 @@ namespace osrm::engine struct PhantomNode { PhantomNode() - : forward_segment_id{SPECIAL_SEGMENTID, false}, - reverse_segment_id{SPECIAL_SEGMENTID, false}, forward_weight(INVALID_EDGE_WEIGHT), + : forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID, + false}, + forward_weight(INVALID_EDGE_WEIGHT), reverse_weight(INVALID_EDGE_WEIGHT), forward_weight_offset{0}, reverse_weight_offset{0}, forward_distance(INVALID_EDGE_DISTANCE), reverse_distance(INVALID_EDGE_DISTANCE), forward_distance_offset{0}, reverse_distance_offset{0}, forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION), forward_duration_offset{0}, reverse_duration_offset{0}, - component({INVALID_COMPONENTID, 0}), fwd_segment_position(0), - is_valid_forward_source{false}, is_valid_forward_target{false}, + component({INVALID_COMPONENTID, 0}), + fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false}, is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0) { diff --git a/include/engine/plugins/plugin_base.hpp b/include/engine/plugins/plugin_base.hpp index 7eb198e5a..5fb0ffc58 100644 --- a/include/engine/plugins/plugin_base.hpp +++ b/include/engine/plugins/plugin_base.hpp @@ -70,7 +70,7 @@ class BasePlugin std::string message; ErrorRenderer(std::string code, std::string message) - : code(std::move(code)), message(std::move(message)) {}; + : code(std::move(code)), message(std::move(message)){}; void operator()(util::json::Object &json_result) { diff --git a/include/engine/routing_algorithms/many_to_many.hpp b/include/engine/routing_algorithms/many_to_many.hpp index 175c71b32..613980784 100644 --- a/include/engine/routing_algorithms/many_to_many.hpp +++ b/include/engine/routing_algorithms/many_to_many.hpp @@ -71,7 +71,7 @@ struct NodeBucket { unsigned column_idx; - ColumnCompare(unsigned column_idx) : column_idx(column_idx) {}; + ColumnCompare(unsigned column_idx) : column_idx(column_idx){}; bool operator()(const NodeBucket &lhs, const NodeID &rhs) const // lowerbound { diff --git a/include/extractor/edge_based_node_segment.hpp b/include/extractor/edge_based_node_segment.hpp index c3c3937c8..3bbe6c8f9 100644 --- a/include/extractor/edge_based_node_segment.hpp +++ b/include/extractor/edge_based_node_segment.hpp @@ -18,8 +18,9 @@ namespace osrm::extractor struct EdgeBasedNodeSegment { EdgeBasedNodeSegment() - : forward_segment_id{SPECIAL_SEGMENTID, false}, - reverse_segment_id{SPECIAL_SEGMENTID, false}, u(SPECIAL_NODEID), v(SPECIAL_NODEID), + : forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID, + false}, + u(SPECIAL_NODEID), v(SPECIAL_NODEID), fwd_segment_position(std::numeric_limits::max() >> 1), // >> 1 because we've only got 15 bits is_startpoint(false) diff --git a/include/partitioner/bisection_graph.hpp b/include/partitioner/bisection_graph.hpp index 2f88733f4..52139a85c 100644 --- a/include/partitioner/bisection_graph.hpp +++ b/include/partitioner/bisection_graph.hpp @@ -105,7 +105,9 @@ std::vector adaptToBisectionEdge(std::vector edge std::transform(begin(edges), end(edges), std::back_inserter(result), - [](const auto &edge) { return BisectionInputEdge{edge.source, edge.target}; }); + [](const auto &edge) { + return BisectionInputEdge{edge.source, edge.target}; + }); return result; } diff --git a/include/partitioner/cell_storage.hpp b/include/partitioner/cell_storage.hpp index 2c5bfb444..e0d315b6a 100644 --- a/include/partitioner/cell_storage.hpp +++ b/include/partitioner/cell_storage.hpp @@ -189,10 +189,10 @@ template class CellStorageImpl const NodeID *const all_sources, const NodeID *const all_destinations) : num_source_nodes{data.num_source_nodes}, - num_destination_nodes{data.num_destination_nodes}, - weights{all_weights + data.value_offset}, - durations{all_durations + data.value_offset}, - distances{all_distances + data.value_offset}, + num_destination_nodes{data.num_destination_nodes}, weights{all_weights + + data.value_offset}, + durations{all_durations + data.value_offset}, distances{all_distances + + data.value_offset}, source_boundary{all_sources + data.source_boundary_offset}, destination_boundary{all_destinations + data.destination_boundary_offset} { @@ -210,8 +210,8 @@ template class CellStorageImpl const NodeID *const all_destinations) : num_source_nodes{data.num_source_nodes}, num_destination_nodes{data.num_destination_nodes}, weights{nullptr}, - durations{nullptr}, distances{nullptr}, - source_boundary{all_sources + data.source_boundary_offset}, + durations{nullptr}, distances{nullptr}, source_boundary{all_sources + + data.source_boundary_offset}, destination_boundary{all_destinations + data.destination_boundary_offset} { BOOST_ASSERT(num_source_nodes == 0 || all_sources != nullptr); diff --git a/include/partitioner/edge_based_graph_reader.hpp b/include/partitioner/edge_based_graph_reader.hpp index f7de2fd2d..99f111435 100644 --- a/include/partitioner/edge_based_graph_reader.hpp +++ b/include/partitioner/edge_based_graph_reader.hpp @@ -164,29 +164,29 @@ graphToEdges(const DynamicEdgeBasedGraph &edge_based_graph) [](const NodeID lhs, const NodeID rhs) { return std::max(lhs, rhs); }); std::vector edges(max_turn_id + 1); - tbb::parallel_for(range, - [&](const auto range) - { - for (auto node = range.begin(); node < range.end(); ++node) - { - for (auto edge : edge_based_graph.GetAdjacentEdgeRange(node)) - { - const auto &data = edge_based_graph.GetEdgeData(edge); - // we only need to save the forward edges, since the read method - // will convert from forward to bi-directional edges again - if (data.forward) - { - auto target = edge_based_graph.GetTarget(edge); - BOOST_ASSERT(data.turn_id <= max_turn_id); - edges[data.turn_id] = - extractor::EdgeBasedEdge{node, target, data}; - // only save the forward edge - edges[data.turn_id].data.forward = true; - edges[data.turn_id].data.backward = false; - } - } - } - }); + tbb::parallel_for( + range, + [&](const auto range) + { + for (auto node = range.begin(); node < range.end(); ++node) + { + for (auto edge : edge_based_graph.GetAdjacentEdgeRange(node)) + { + const auto &data = edge_based_graph.GetEdgeData(edge); + // we only need to save the forward edges, since the read method + // will convert from forward to bi-directional edges again + if (data.forward) + { + auto target = edge_based_graph.GetTarget(edge); + BOOST_ASSERT(data.turn_id <= max_turn_id); + edges[data.turn_id] = extractor::EdgeBasedEdge{node, target, data}; + // only save the forward edge + edges[data.turn_id].data.forward = true; + edges[data.turn_id].data.backward = false; + } + } + } + }); return edges; } diff --git a/include/server/api/base_parameters_grammar.hpp b/include/server/api/base_parameters_grammar.hpp index 9406f431f..80fda760b 100644 --- a/include/server/api/base_parameters_grammar.hpp +++ b/include/server/api/base_parameters_grammar.hpp @@ -110,11 +110,12 @@ struct BaseParametersGrammar : boost::spirit::qi::grammar unlimited_rule = qi::lit("unlimited")[qi::_val = std::numeric_limits::infinity()]; bearing_rule = - (qi::short_ > ',' > - qi::short_)[qi::_val = ph::bind([](short bearing, short range) - { return osrm::engine::Bearing{bearing, range}; }, - qi::_1, - qi::_2)]; + (qi::short_ > ',' > qi::short_)[qi::_val = ph::bind( + [](short bearing, short range) { + return osrm::engine::Bearing{bearing, range}; + }, + qi::_1, + qi::_2)]; location_rule = (double_ > qi::lit(',') > double_)[qi::_val = ph::bind( diff --git a/include/util/deallocating_vector.hpp b/include/util/deallocating_vector.hpp index eb5457d46..9cb5641e3 100644 --- a/include/util/deallocating_vector.hpp +++ b/include/util/deallocating_vector.hpp @@ -267,7 +267,9 @@ template class DeallocatingVector ++current_size; } - void reserve(const std::size_t) const { /* don't do anything */ } + void reserve(const std::size_t) const + { /* don't do anything */ + } void resize(const std::size_t new_size) { diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index 6d351b9c6..a84fdbebe 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -1183,8 +1183,9 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( first_turn_edges.first, first_turn_edges.second, std::back_inserter(node_sequences), - [](const auto turn_edges) - { return std::vector{turn_edges.second.first, turn_edges.second.second}; }); + [](const auto turn_edges) { + return std::vector{turn_edges.second.first, turn_edges.second.second}; + }); std::for_each(std::next(turns.begin()), turns.end(),