diff --git a/include/contractor/query_edge.hpp b/include/contractor/query_edge.hpp index 3776aab18..c3056f355 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 344f6499a..ed9357a1e 100644 --- a/include/engine/api/base_api.hpp +++ b/include/engine/api/base_api.hpp @@ -72,9 +72,8 @@ 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, @@ -142,9 +141,8 @@ 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 abc93a650..6f5563f90 100644 --- a/include/engine/api/match_parameters.hpp +++ b/include/engine/api/match_parameters.hpp @@ -78,9 +78,8 @@ 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 267058a46..69f54555b 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 7ad785ac0..8ae9a8001 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/engine_config.hpp b/include/engine/engine_config.hpp index 032a5960c..3c1249f07 100644 --- a/include/engine/engine_config.hpp +++ b/include/engine/engine_config.hpp @@ -31,8 +31,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "storage/storage_config.hpp" #include "osrm/datasets.hpp" -#include #include +#include #include namespace osrm::engine diff --git a/include/engine/phantom_node.hpp b/include/engine/phantom_node.hpp index c7d0c0bf2..3ddfaa2a5 100644 --- a/include/engine/phantom_node.hpp +++ b/include/engine/phantom_node.hpp @@ -44,16 +44,15 @@ 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 5fb0ffc58..7eb198e5a 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 613980784..175c71b32 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 3bbe6c8f9..c3c3937c8 100644 --- a/include/extractor/edge_based_node_segment.hpp +++ b/include/extractor/edge_based_node_segment.hpp @@ -18,9 +18,8 @@ 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/extractor/files.hpp b/include/extractor/files.hpp index aeddb36d4..2c90d3a04 100644 --- a/include/extractor/files.hpp +++ b/include/extractor/files.hpp @@ -24,8 +24,8 @@ namespace osrm::extractor::files // writes the .osrm.icd file template void writeIntersections(const std::filesystem::path &path, - const IntersectionBearingsT &intersection_bearings, - const EntryClassVectorT &entry_classes) + const IntersectionBearingsT &intersection_bearings, + const EntryClassVectorT &entry_classes) { static_assert(std::is_same::value || std::is_same::value, @@ -40,8 +40,8 @@ void writeIntersections(const std::filesystem::path &path, // read the .osrm.icd file template void readIntersections(const std::filesystem::path &path, - IntersectionBearingsT &intersection_bearings, - EntryClassVectorT &entry_classes) + IntersectionBearingsT &intersection_bearings, + EntryClassVectorT &entry_classes) { static_assert(std::is_same::value || std::is_same::value, @@ -54,8 +54,7 @@ void readIntersections(const std::filesystem::path &path, } // reads .osrm.properties -inline void readProfileProperties(const std::filesystem::path &path, - ProfileProperties &properties) +inline void readProfileProperties(const std::filesystem::path &path, ProfileProperties &properties) { const auto fingerprint = storage::tar::FileReader::VerifyFingerprint; storage::tar::FileReader reader{path, fingerprint}; @@ -109,8 +108,8 @@ void readEdgeBasedGraph(const std::filesystem::path &path, // reads .osrm.nbg_nodes template void readNodes(const std::filesystem::path &path, - CoordinatesT &coordinates, - PackedOSMIDsT &osm_node_ids) + CoordinatesT &coordinates, + PackedOSMIDsT &osm_node_ids) { static_assert(std::is_same::value, ""); static_assert(std::is_same::value, ""); @@ -137,8 +136,8 @@ void readNodeCoordinates(const std::filesystem::path &path, CoordinatesT &coordi // writes .osrm.nbg_nodes template void writeNodes(const std::filesystem::path &path, - const CoordinatesT &coordinates, - const PackedOSMIDsT &osm_node_ids) + const CoordinatesT &coordinates, + const PackedOSMIDsT &osm_node_ids) { static_assert(std::is_same::value, ""); static_assert(std::is_same::value, ""); @@ -160,8 +159,7 @@ inline void readNBGMapping(const std::filesystem::path &path, std::vector &mapping) +inline void writeNBGMapping(const std::filesystem::path &path, const std::vector &mapping) { const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint; storage::tar::FileWriter writer{path, fingerprint}; @@ -466,8 +464,7 @@ void readRawNBGraph(const std::filesystem::path &path, storage::serialization::read(reader, "/extractor/edges", edge_list); } -template -void readNames(const std::filesystem::path &path, NameTableT &table) +template void readNames(const std::filesystem::path &path, NameTableT &table) { const auto fingerprint = storage::tar::FileReader::VerifyFingerprint; storage::tar::FileReader reader{path, fingerprint}; @@ -494,8 +491,7 @@ void readEdgeBasedNodeWeights(const std::filesystem::path &path, NodeWeightsVect } template -void readEdgeBasedNodeDistances(const std::filesystem::path &path, - NodeDistancesVectorT &distances) +void readEdgeBasedNodeDistances(const std::filesystem::path &path, NodeDistancesVectorT &distances) { const auto fingerprint = storage::tar::FileReader::VerifyFingerprint; storage::tar::FileReader reader{path, fingerprint}; diff --git a/include/partitioner/bisection_graph.hpp b/include/partitioner/bisection_graph.hpp index 52139a85c..2f88733f4 100644 --- a/include/partitioner/bisection_graph.hpp +++ b/include/partitioner/bisection_graph.hpp @@ -105,9 +105,7 @@ 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 e0d315b6a..2c5bfb444 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 ea5becf7b..f7de2fd2d 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/partitioner/partitioner_config.hpp b/include/partitioner/partitioner_config.hpp index 315bbcf78..3bffdd515 100644 --- a/include/partitioner/partitioner_config.hpp +++ b/include/partitioner/partitioner_config.hpp @@ -1,7 +1,6 @@ #ifndef OSRM_PARTITIONER_CONFIG_HPP #define OSRM_PARTITIONER_CONFIG_HPP - #include #include #include diff --git a/include/server/api/base_parameters_grammar.hpp b/include/server/api/base_parameters_grammar.hpp index 80fda760b..9406f431f 100644 --- a/include/server/api/base_parameters_grammar.hpp +++ b/include/server/api/base_parameters_grammar.hpp @@ -110,12 +110,11 @@ 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/storage/storage_config.hpp b/include/storage/storage_config.hpp index af7145b14..3cc1720d4 100644 --- a/include/storage/storage_config.hpp +++ b/include/storage/storage_config.hpp @@ -28,7 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef STORAGE_CONFIG_HPP #define STORAGE_CONFIG_HPP - #include "storage/io_config.hpp" #include "osrm/datasets.hpp" diff --git a/include/util/deallocating_vector.hpp b/include/util/deallocating_vector.hpp index 9cb5641e3..eb5457d46 100644 --- a/include/util/deallocating_vector.hpp +++ b/include/util/deallocating_vector.hpp @@ -267,9 +267,7 @@ 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/include/util/mmap_file.hpp b/include/util/mmap_file.hpp index 56add5bbe..4c73363a9 100644 --- a/include/util/mmap_file.hpp +++ b/include/util/mmap_file.hpp @@ -34,9 +34,8 @@ util::vector_view mmapFile(const std::filesystem::path &file, MmapContainerT } template -util::vector_view mmapFile(const std::filesystem::path &file, - MmapContainerT &mmap_container, - const std::size_t size) +util::vector_view +mmapFile(const std::filesystem::path &file, MmapContainerT &mmap_container, const std::size_t size) { try { diff --git a/src/benchmarks/static_rtree.cpp b/src/benchmarks/static_rtree.cpp index a8ffd0c6c..8346b2e9b 100644 --- a/src/benchmarks/static_rtree.cpp +++ b/src/benchmarks/static_rtree.cpp @@ -11,11 +11,10 @@ #include "util/serialization.hpp" #include "util/timing_util.hpp" -#include #include +#include #include - namespace osrm::benchmarks { diff --git a/src/extractor/compressed_edge_container.cpp b/src/extractor/compressed_edge_container.cpp index 6cb6ae992..ddfafcef4 100644 --- a/src/extractor/compressed_edge_container.cpp +++ b/src/extractor/compressed_edge_container.cpp @@ -4,13 +4,12 @@ #include #include -#include #include +#include #include #include #include - namespace osrm::extractor { diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index a84fdbebe..6d351b9c6 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -1183,9 +1183,8 @@ 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(), diff --git a/src/partitioner/recursive_bisection.cpp b/src/partitioner/recursive_bisection.cpp index 63b3a39fd..36c5a0b53 100644 --- a/src/partitioner/recursive_bisection.cpp +++ b/src/partitioner/recursive_bisection.cpp @@ -61,9 +61,8 @@ RecursiveBisection::RecursiveBisection(BisectionGraph &bisection_graph_, std::transform(first, last, std::back_inserter(forest), - [this](auto graph) { - return TreeNode{std::move(graph), internal_state.SCCDepth()}; - }); + [this](auto graph) + { return TreeNode{std::move(graph), internal_state.SCCDepth()}; }); using Feeder = tbb::feeder; diff --git a/src/storage/storage.cpp b/src/storage/storage.cpp index 0caf177fa..63701822a 100644 --- a/src/storage/storage.cpp +++ b/src/storage/storage.cpp @@ -27,8 +27,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/tools/customize.cpp b/src/tools/customize.cpp index 38f86dc5a..0f3f8cb09 100644 --- a/src/tools/customize.cpp +++ b/src/tools/customize.cpp @@ -7,8 +7,8 @@ #include -#include #include +#include #include using namespace osrm; diff --git a/src/tools/io-benchmark.cpp b/src/tools/io-benchmark.cpp index 8e15e9cc1..966ab9879 100644 --- a/src/tools/io-benchmark.cpp +++ b/src/tools/io-benchmark.cpp @@ -3,7 +3,6 @@ #include "util/log.hpp" #include "util/timing_util.hpp" - #include #include #include @@ -13,9 +12,9 @@ #include #include -#include #include #include +#include #include #include #include diff --git a/src/tools/partition.cpp b/src/tools/partition.cpp index 87c7a3cbd..fb983d9ba 100644 --- a/src/tools/partition.cpp +++ b/src/tools/partition.cpp @@ -11,9 +11,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/src/tools/routed.cpp b/src/tools/routed.cpp index cfaf56e6c..ce373812c 100644 --- a/src/tools/routed.cpp +++ b/src/tools/routed.cpp @@ -110,8 +110,8 @@ inline unsigned generateServerProgramOptions(const int argc, int &requested_thread_num, short &keepalive_timeout) { - using std::filesystem::path; using boost::program_options::value; + using std::filesystem::path; const auto hardware_threads = std::max(1, std::thread::hardware_concurrency()); diff --git a/unit_tests/common/temporary_file.hpp b/unit_tests/common/temporary_file.hpp index 80729c9e2..244550161 100644 --- a/unit_tests/common/temporary_file.hpp +++ b/unit_tests/common/temporary_file.hpp @@ -8,17 +8,18 @@ inline std::string random_string(std::string::size_type length) { - static auto& chrs = "0123456789" - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + static auto &chrs = "0123456789" + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; thread_local static std::mt19937 rg{std::random_device{}()}; - thread_local static std::uniform_int_distribution pick(0, sizeof(chrs) - 2); + thread_local static std::uniform_int_distribution pick( + 0, sizeof(chrs) - 2); std::string s; s.reserve(length); - while(length--) + while (length--) { s += chrs[pick(rg)]; } diff --git a/unit_tests/extractor/name_table.cpp b/unit_tests/extractor/name_table.cpp index f8c152f9f..c4ebd0ac5 100644 --- a/unit_tests/extractor/name_table.cpp +++ b/unit_tests/extractor/name_table.cpp @@ -5,9 +5,9 @@ #include +#include #include #include -#include #include #include #include