From 6991a38703e52b457893f779d51a1bab2f52d523 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 8 Jan 2016 01:31:57 +0100 Subject: [PATCH] Run clang-format --- include/contractor/contractor.hpp | 24 ++++--- include/contractor/contractor_options.hpp | 1 - include/contractor/crc32_processor.hpp | 1 - include/contractor/processing_chain.hpp | 17 ++--- include/contractor/query_edge.hpp | 1 - include/datastore/shared_memory_factory.hpp | 9 +-- include/engine/api_response_generator.hpp | 31 ++++---- include/engine/datafacade/datafacade_base.hpp | 9 ++- .../engine/datafacade/internal_datafacade.hpp | 22 +++--- include/engine/datafacade/shared_barriers.hpp | 1 - .../engine/datafacade/shared_datafacade.hpp | 28 ++++---- include/engine/datafacade/shared_datatype.hpp | 37 +++++----- include/engine/douglas_peucker.hpp | 1 - include/engine/geospatial_query.hpp | 24 +++---- .../engine/guidance/segment_compression.hpp | 2 +- include/engine/guidance/segment_list.hpp | 7 +- .../guidance/textual_route_annotation.hpp | 22 +++--- include/engine/internal_route_result.hpp | 4 +- .../engine/map_matching/bayes_classifier.hpp | 1 - .../map_matching/hidden_markov_model.hpp | 7 +- include/engine/object_encoder.hpp | 1 - include/engine/phantom_node.hpp | 4 +- include/engine/plugins/distance_table.hpp | 1 - include/engine/plugins/hello_world.hpp | 1 - include/engine/plugins/match.hpp | 12 ++-- include/engine/plugins/nearest.hpp | 4 +- include/engine/plugins/plugin_base.hpp | 1 - include/engine/plugins/timestamp.hpp | 1 - include/engine/plugins/trip.hpp | 12 ++-- include/engine/plugins/viaroute.hpp | 1 - include/engine/polyline_compressor.hpp | 1 - include/engine/polyline_formatter.hpp | 1 - include/engine/route_name_extraction.hpp | 3 +- .../routing_algorithms/alternative_path.hpp | 10 +-- .../direct_shortest_path.hpp | 1 - .../routing_algorithms/map_matching.hpp | 12 ++-- .../routing_algorithms/routing_base.hpp | 19 ++--- .../routing_algorithms/shortest_path.hpp | 1 - include/engine/search_engine.hpp | 1 - include/engine/search_engine_data.hpp | 4 +- include/engine/segment_information.hpp | 5 +- include/engine/trip/trip_brute_force.hpp | 1 - .../engine/trip/trip_farthest_insertion.hpp | 1 - .../engine/trip/trip_nearest_neighbour.hpp | 1 - include/engine/trip/trip_tabu_search.hpp | 1 - .../extractor/compressed_edge_container.hpp | 1 - .../extractor/edge_based_graph_factory.hpp | 1 - include/extractor/edge_based_node.hpp | 3 +- include/extractor/external_memory_node.hpp | 1 - include/extractor/extraction_containers.hpp | 1 - .../extractor/extraction_helper_functions.hpp | 1 - include/extractor/extraction_node.hpp | 1 - include/extractor/extraction_way.hpp | 1 - include/extractor/extractor_callbacks.hpp | 1 - include/extractor/extractor_options.hpp | 1 - .../first_and_last_segment_of_way.hpp | 1 - include/extractor/graph_compressor.hpp | 1 - include/extractor/import_edge.hpp | 1 - include/extractor/internal_extractor_edge.hpp | 1 - include/extractor/node_id.hpp | 1 - include/extractor/original_edge_data.hpp | 1 - include/extractor/query_node.hpp | 1 - include/extractor/raster_source.hpp | 1 - include/extractor/restriction.hpp | 1 - include/extractor/restriction_map.hpp | 2 - include/extractor/restriction_parser.hpp | 2 - include/extractor/scripting_environment.hpp | 1 - include/extractor/speed_profile.hpp | 1 - include/extractor/tarjan_scc.hpp | 3 +- include/extractor/travel_mode.hpp | 4 +- include/extractor/turn_instructions.hpp | 1 - include/osrm/coordinate.hpp | 1 - include/osrm/json_container.hpp | 5 +- include/osrm/libosrm_config.hpp | 1 - include/osrm/osrm.hpp | 4 +- include/osrm/route_parameters.hpp | 2 - include/osrm/strong_typedef.hpp | 1 - include/server/api_grammar.hpp | 1 - include/server/connection.hpp | 1 - include/server/http/compression_type.hpp | 1 - include/server/http/header.hpp | 1 - include/server/http/reply.hpp | 1 - include/server/http/request.hpp | 1 - include/server/request_handler.hpp | 1 - include/server/request_parser.hpp | 2 - include/server/server.hpp | 4 +- include/util/bearing.hpp | 1 - include/util/binary_heap.hpp | 1 - include/util/cast.hpp | 1 - include/util/compute_angle.hpp | 1 - include/util/coordinate_calculation.hpp | 1 - include/util/datastore_options.hpp | 1 - include/util/deallocating_vector.hpp | 4 +- include/util/debug_geometry.hpp | 3 - include/util/dist_table_wrapper.hpp | 1 - include/util/dynamic_graph.hpp | 3 +- include/util/fingerprint.hpp | 1 - include/util/fixed_point_number.hpp | 1 - include/util/floating_point.hpp | 1 - include/util/graph_loader.hpp | 7 +- include/util/hilbert_value.hpp | 1 - include/util/integer_range.hpp | 1 - include/util/iso_8601_duration_parser.hpp | 1 - include/util/json_logger.hpp | 1 - include/util/json_util.hpp | 6 +- include/util/lua_util.hpp | 1 - include/util/make_unique.hpp | 1 - include/util/matching_debug_info.hpp | 3 +- include/util/matrix_graph_wrapper.hpp | 4 +- include/util/mercator.hpp | 1 - include/util/node_based_graph.hpp | 5 +- include/util/osrm_exception.hpp | 1 - include/util/percent.hpp | 1 - include/util/range_algorithms.hpp | 1 - include/util/range_table.hpp | 1 - include/util/rectangle.hpp | 17 +++-- include/util/routed_options.hpp | 1 - include/util/shared_memory_vector_wrapper.hpp | 1 - include/util/simple_logger.hpp | 1 - include/util/static_graph.hpp | 1 - include/util/string_util.hpp | 1 - include/util/timing_util.hpp | 1 - include/util/tribool.hpp | 1 - include/util/trigonometry_table.hpp | 1 - include/util/xor_fast_hash.hpp | 1 - include/util/xor_fast_hash_storage.hpp | 1 - src/benchmarks/static_rtree.cpp | 5 +- src/contractor/processing_chain.cpp | 66 +++++++++-------- src/extractor/compressed_edge_container.cpp | 18 +++-- src/extractor/edge_based_graph_factory.cpp | 33 +++++---- src/extractor/extraction_containers.cpp | 21 +++--- src/extractor/extractor.cpp | 43 +++++------ src/extractor/extractor_callbacks.cpp | 5 +- src/extractor/extractor_options.cpp | 2 +- src/extractor/graph_compressor.cpp | 4 +- src/extractor/raster_source.cpp | 5 +- src/extractor/restriction_parser.cpp | 5 +- src/server/request_handler.cpp | 24 +++---- src/tools/check-hsgr.cpp | 23 +++--- src/tools/components.cpp | 43 ++++++----- src/tools/contract.cpp | 18 ++--- src/tools/datastore.cpp | 41 ++++++----- src/tools/extract.cpp | 11 +-- src/tools/io-benchmark.cpp | 72 +++++++++++-------- src/tools/simpleclient.cpp | 3 +- src/tools/springclean.cpp | 11 +-- src/util/coordinate.cpp | 3 +- src/util/osrm_exception.cpp | 1 - unit_tests/engine/douglas_peucker.cpp | 4 +- 149 files changed, 457 insertions(+), 498 deletions(-) diff --git a/include/contractor/contractor.hpp b/include/contractor/contractor.hpp index 29f0f22dd..633a67d41 100644 --- a/include/contractor/contractor.hpp +++ b/include/contractor/contractor.hpp @@ -74,8 +74,11 @@ class Contractor // using ContractorHeap = util::BinaryHeap // >; - using ContractorHeap = - util::BinaryHeap>; + using ContractorHeap = util::BinaryHeap>; using ContractorEdge = ContractorGraph::InputEdge; struct ContractorThreadData @@ -258,7 +261,8 @@ class Contractor // } // } // - // util::SimpleLogger().Write() << "edges at node with id " << highestNode << " has degree + // util::SimpleLogger().Write() << "edges at node with id " << highestNode << " has + // degree // " << maxdegree; // for(unsigned i = contractor_graph->BeginEdges(highestNode); i < // contractor_graph->EndEdges(highestNode); ++i) { @@ -345,9 +349,10 @@ class Contractor if (!flushed_contractor && (number_of_contracted_nodes > static_cast(number_of_nodes * 0.65 * core_factor))) { - util::DeallocatingVector new_edge_set; // this one is not explicitely - // cleared since it goes out of - // scope anywa + util::DeallocatingVector + new_edge_set; // this one is not explicitely + // cleared since it goes out of + // scope anywa std::cout << " [flush " << number_of_contracted_nodes << " nodes] " << std::flush; // Delete old heap data to free memory that we need for the coming operations @@ -595,7 +600,8 @@ class Contractor // avgdegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() ); // quaddegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() ); // - // util::SimpleLogger().Write() << "rest: " << remaining_nodes.size() << ", max: " + // util::SimpleLogger().Write() << "rest: " << remaining_nodes.size() << ", + // max: " // << maxdegree << ", min: " << mindegree << ", avg: " << avgdegree << ", // quad: " << quaddegree; @@ -639,7 +645,8 @@ class Contractor } util::SimpleLogger().Write() << "[core] " << remaining_nodes.size() << " nodes " - << contractor_graph->GetNumberOfEdges() << " edges." << std::endl; + << contractor_graph->GetNumberOfEdges() << " edges." + << std::endl; thread_data_list.data.clear(); } @@ -1067,7 +1074,6 @@ class Contractor std::vector is_core_node; util::XORFastHash fast_hash; }; - } } diff --git a/include/contractor/contractor_options.hpp b/include/contractor/contractor_options.hpp index cb29d82f3..589f6bc13 100644 --- a/include/contractor/contractor_options.hpp +++ b/include/contractor/contractor_options.hpp @@ -55,7 +55,6 @@ struct ContractorOptions static void GenerateOutputFilesNames(ContractorConfig &extractor_config); }; - } } diff --git a/include/contractor/crc32_processor.hpp b/include/contractor/crc32_processor.hpp index 827cdda0a..eaef76c8e 100644 --- a/include/contractor/crc32_processor.hpp +++ b/include/contractor/crc32_processor.hpp @@ -119,7 +119,6 @@ struct RangebasedCRC32 private: IteratorbasedCRC32 crc32; }; - } } diff --git a/include/contractor/processing_chain.hpp b/include/contractor/processing_chain.hpp index d1bc08e24..08247cf44 100644 --- a/include/contractor/processing_chain.hpp +++ b/include/contractor/processing_chain.hpp @@ -47,21 +47,22 @@ class Prepare void WriteCoreNodeMarker(std::vector &&is_core_node) const; void WriteNodeLevels(std::vector &&node_levels) const; void ReadNodeLevels(std::vector &contraction_order) const; - std::size_t WriteContractedGraph(unsigned number_of_edge_based_nodes, - const util::DeallocatingVector &contracted_edge_list); + std::size_t + WriteContractedGraph(unsigned number_of_edge_based_nodes, + const util::DeallocatingVector &contracted_edge_list); void FindComponents(unsigned max_edge_id, const util::DeallocatingVector &edges, std::vector &nodes) const; private: ContractorConfig config; - std::size_t LoadEdgeExpandedGraph(const std::string &edge_based_graph_path, - util::DeallocatingVector &edge_based_edge_list, - const std::string &edge_segment_lookup_path, - const std::string &edge_penalty_path, - const std::string &segment_speed_path); + std::size_t + LoadEdgeExpandedGraph(const std::string &edge_based_graph_path, + util::DeallocatingVector &edge_based_edge_list, + const std::string &edge_segment_lookup_path, + const std::string &edge_penalty_path, + const std::string &segment_speed_path); }; - } } diff --git a/include/contractor/query_edge.hpp b/include/contractor/query_edge.hpp index 75949c4dd..a3265b882 100644 --- a/include/contractor/query_edge.hpp +++ b/include/contractor/query_edge.hpp @@ -53,7 +53,6 @@ struct QueryEdge data.id == right.data.id); } }; - } } diff --git a/include/datastore/shared_memory_factory.hpp b/include/datastore/shared_memory_factory.hpp index 37ae802c4..4c4cb2aa6 100644 --- a/include/datastore/shared_memory_factory.hpp +++ b/include/datastore/shared_memory_factory.hpp @@ -115,7 +115,8 @@ class SharedMemory region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write); remover.SetID(shm.get_shmid()); - util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size << " bytes"; + util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size + << " bytes"; } } @@ -247,7 +248,8 @@ class SharedMemory region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write); remover.SetID(key); - util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size << " bytes"; + util::SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size + << " bytes"; } } @@ -346,7 +348,7 @@ template class SharedMemoryFactory_tmpl catch (const boost::interprocess::interprocess_exception &e) { util::SimpleLogger().Write(logWARNING) << "caught exception: " << e.what() << ", code " - << e.get_error_code(); + << e.get_error_code(); throw util::exception(e.what()); } } @@ -356,7 +358,6 @@ template class SharedMemoryFactory_tmpl }; using SharedMemoryFactory = SharedMemoryFactory_tmpl<>; - } } diff --git a/include/engine/api_response_generator.hpp b/include/engine/api_response_generator.hpp index 02dbf70f0..d8c16ba33 100644 --- a/include/engine/api_response_generator.hpp +++ b/include/engine/api_response_generator.hpp @@ -96,14 +96,15 @@ void ApiResponseGenerator::DescribeRoute(const RouteParameters &con const InternalRouteResult &raw_route, util::json::Object &json_result) { - if( not raw_route.is_valid() ){ - return; + if (not raw_route.is_valid()) + { + return; } const constexpr bool ALLOW_SIMPLIFICATION = true; const constexpr bool EXTRACT_ROUTE = false; const constexpr bool EXTRACT_ALTERNATIVE = true; Segments segment_list(raw_route, EXTRACT_ROUTE, config.zoom_level, ALLOW_SIMPLIFICATION, - facade); + facade); json_result.values["route_summary"] = SummarizeRoute(raw_route, segment_list); json_result.values["via_points"] = ListViaPoints(raw_route); json_result.values["via_indices"] = ListViaIndices(segment_list); @@ -125,7 +126,7 @@ void ApiResponseGenerator::DescribeRoute(const RouteParameters &con if (raw_route.has_alternative()) { Segments alternate_segment_list(raw_route, EXTRACT_ALTERNATIVE, config.zoom_level, - ALLOW_SIMPLIFICATION, facade); + ALLOW_SIMPLIFICATION, facade); // Alternative Route Summaries are stored in an array to (down the line) allow multiple // alternatives @@ -140,7 +141,8 @@ void ApiResponseGenerator::DescribeRoute(const RouteParameters &con auto alternate_geometry_string = GetGeometry(config.compression, alternate_segment_list); util::json::Array json_alternate_geometries_array; - json_alternate_geometries_array.values.emplace_back(std::move(alternate_geometry_string)); + json_alternate_geometries_array.values.emplace_back( + std::move(alternate_geometry_string)); json_result.values["alternative_geometries"] = json_alternate_geometries_array; } @@ -192,7 +194,8 @@ ApiResponseGenerator::SummarizeRoute(const InternalRouteResult &raw { const auto start_name_id = raw_route.segment_end_coordinates.front().source_phantom.name_id; json_route_summary.values["start_point"] = facade->get_name_for_id(start_name_id); - const auto destination_name_id = raw_route.segment_end_coordinates.back().target_phantom.name_id; + const auto destination_name_id = + raw_route.segment_end_coordinates.back().target_phantom.name_id; json_route_summary.values["end_point"] = facade->get_name_for_id(destination_name_id); } json_route_summary.values["total_time"] = segment_list.GetDuration(); @@ -217,8 +220,10 @@ ApiResponseGenerator::ListViaPoints(const InternalRouteResult &raw_ { std::string tmp; util::json::Array json_coordinate; - json_coordinate.values.emplace_back(nodes.target_phantom.location.lat / COORDINATE_PRECISION); - json_coordinate.values.emplace_back(nodes.target_phantom.location.lon / COORDINATE_PRECISION); + json_coordinate.values.emplace_back(nodes.target_phantom.location.lat / + COORDINATE_PRECISION); + json_coordinate.values.emplace_back(nodes.target_phantom.location.lon / + COORDINATE_PRECISION); json_via_points_array.values.emplace_back(std::move(json_coordinate)); } return json_via_points_array; @@ -235,7 +240,8 @@ ApiResponseGenerator::ListViaIndices(const Segments &segment_list) } template -util::json::Value ApiResponseGenerator::GetGeometry(const bool return_encoded, const Segments &segments) const +util::json::Value ApiResponseGenerator::GetGeometry(const bool return_encoded, + const Segments &segments) const { if (return_encoded) return PolylineFormatter().printEncodedString(segments.Get()); @@ -284,11 +290,12 @@ ApiResponseGenerator::BuildHintData(const InternalRouteResult &raw_ } template -ApiResponseGenerator MakeApiResponseGenerator(DataFacadeT *facade){ - return ApiResponseGenerator(facade); +ApiResponseGenerator MakeApiResponseGenerator(DataFacadeT *facade) +{ + return ApiResponseGenerator(facade); } } // namespace engine } // namespace osrm -#endif //ENGINE_GUIDANCE_API_RESPONSE_GENERATOR_HPP_ +#endif // ENGINE_GUIDANCE_API_RESPONSE_GENERATOR_HPP_ diff --git a/include/engine/datafacade/datafacade_base.hpp b/include/engine/datafacade/datafacade_base.hpp index ab419bf19..c4c4c87f4 100644 --- a/include/engine/datafacade/datafacade_base.hpp +++ b/include/engine/datafacade/datafacade_base.hpp @@ -85,10 +85,10 @@ template class BaseDataFacade const int bearing = 0, const int bearing_range = 180) = 0; - virtual std::pair - NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, - const int bearing = 0, - const int bearing_range = 180) = 0; + virtual std::pair NearestPhantomNodeWithAlternativeFromBigComponent( + const util::FixedPointCoordinate &input_coordinate, + const int bearing = 0, + const int bearing_range = 180) = 0; virtual unsigned GetCheckSum() const = 0; @@ -102,7 +102,6 @@ template class BaseDataFacade virtual std::string GetTimestamp() const = 0; }; - } } } diff --git a/include/engine/datafacade/internal_datafacade.hpp b/include/engine/datafacade/internal_datafacade.hpp index ba43513da..bbe18249a 100644 --- a/include/engine/datafacade/internal_datafacade.hpp +++ b/include/engine/datafacade/internal_datafacade.hpp @@ -37,7 +37,8 @@ template class InternalDataFacade final : public BaseDataFacad using QueryGraph = util::StaticGraph; using InputEdge = typename QueryGraph::InputEdge; using RTreeLeaf = typename super::RTreeLeaf; - using InternalRTree = util::StaticRTree::vector, false>; + using InternalRTree = + util::StaticRTree::vector, false>; using InternalGeospatialQuery = GeospatialQuery; InternalDataFacade() {} @@ -98,8 +99,8 @@ template class InternalDataFacade final : public BaseDataFacad BOOST_ASSERT_MSG(0 != node_list.size(), "node list empty"); // BOOST_ASSERT_MSG(0 != edge_list.size(), "edge list empty"); - util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " << edge_list.size() - << " edges"; + util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " + << edge_list.size() << " edges"; m_query_graph = std::unique_ptr(new QueryGraph(node_list, edge_list)); BOOST_ASSERT_MSG(0 == node_list.size(), "node list not flushed"); @@ -120,7 +121,8 @@ template class InternalDataFacade final : public BaseDataFacad for (unsigned i = 0; i < number_of_coordinates; ++i) { nodes_input_stream.read((char *)¤t_node, sizeof(extractor::QueryNode)); - m_coordinate_list->at(i) = util::FixedPointCoordinate(current_node.lat, current_node.lon); + m_coordinate_list->at(i) = + util::FixedPointCoordinate(current_node.lat, current_node.lon); BOOST_ASSERT((std::abs(m_coordinate_list->at(i).lat) >> 30) == 0); BOOST_ASSERT((std::abs(m_coordinate_list->at(i).lon) >> 30) == 0); } @@ -140,7 +142,8 @@ template class InternalDataFacade final : public BaseDataFacad extractor::OriginalEdgeData current_edge_data; for (unsigned i = 0; i < number_of_edges; ++i) { - edges_input_stream.read((char *)&(current_edge_data), sizeof(extractor::OriginalEdgeData)); + edges_input_stream.read((char *)&(current_edge_data), + sizeof(extractor::OriginalEdgeData)); m_via_node_list[i] = current_edge_data.via_node; m_name_ID_list[i] = current_edge_data.name_id; m_turn_instruction_list[i] = current_edge_data.turn_instruction; @@ -371,10 +374,10 @@ template class InternalDataFacade final : public BaseDataFacad bearing_range); } - std::pair - NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, - const int bearing = 0, - const int bearing_range = 180) override final + std::pair NearestPhantomNodeWithAlternativeFromBigComponent( + const util::FixedPointCoordinate &input_coordinate, + const int bearing = 0, + const int bearing_range = 180) override final { if (!m_static_rtree.get()) { @@ -444,7 +447,6 @@ template class InternalDataFacade final : public BaseDataFacad std::string GetTimestamp() const override final { return m_timestamp; } }; - } } } diff --git a/include/engine/datafacade/shared_barriers.hpp b/include/engine/datafacade/shared_barriers.hpp index 4eb7d5371..e22e27ea4 100644 --- a/include/engine/datafacade/shared_barriers.hpp +++ b/include/engine/datafacade/shared_barriers.hpp @@ -36,7 +36,6 @@ struct SharedBarriers // Is there any query? int number_of_queries; }; - } } } diff --git a/include/engine/datafacade/shared_datafacade.hpp b/include/engine/datafacade/shared_datafacade.hpp index 536cc230e..62fb08363 100644 --- a/include/engine/datafacade/shared_datafacade.hpp +++ b/include/engine/datafacade/shared_datafacade.hpp @@ -38,7 +38,8 @@ template class SharedDataFacade final : public BaseDataFacade< using NameIndexBlock = typename util::RangeTable<16, true>::BlockT; using InputEdge = typename QueryGraph::InputEdge; using RTreeLeaf = typename super::RTreeLeaf; - using SharedRTree = util::StaticRTree::vector, true>; + using SharedRTree = + util::StaticRTree::vector, true>; using SharedGeospatialQuery = GeospatialQuery; using TimeStampedRTreePair = std::pair>; using RTreeNode = typename SharedRTree::TreeNode; @@ -125,19 +126,22 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadNodeAndEdgeInformation() { - util::FixedPointCoordinate *coordinate_list_ptr = data_layout->GetBlockPtr( - shared_memory, SharedDataLayout::COORDINATE_LIST); + util::FixedPointCoordinate *coordinate_list_ptr = + data_layout->GetBlockPtr(shared_memory, + SharedDataLayout::COORDINATE_LIST); m_coordinate_list = util::make_unique::vector>( coordinate_list_ptr, data_layout->num_entries[SharedDataLayout::COORDINATE_LIST]); extractor::TravelMode *travel_mode_list_ptr = - data_layout->GetBlockPtr(shared_memory, SharedDataLayout::TRAVEL_MODE); + data_layout->GetBlockPtr(shared_memory, + SharedDataLayout::TRAVEL_MODE); typename util::ShM::vector travel_mode_list( travel_mode_list_ptr, data_layout->num_entries[SharedDataLayout::TRAVEL_MODE]); m_travel_mode_list.swap(travel_mode_list); - extractor::TurnInstruction *turn_instruction_list_ptr = data_layout->GetBlockPtr( - shared_memory, SharedDataLayout::TURN_INSTRUCTION); + extractor::TurnInstruction *turn_instruction_list_ptr = + data_layout->GetBlockPtr( + shared_memory, SharedDataLayout::TURN_INSTRUCTION); typename util::ShM::vector turn_instruction_list( turn_instruction_list_ptr, data_layout->num_entries[SharedDataLayout::TURN_INSTRUCTION]); @@ -258,7 +262,8 @@ template class SharedDataFacade final : public BaseDataFacade< file_index_path = boost::filesystem::path(file_index_ptr); if (!boost::filesystem::exists(file_index_path)) { - util::SimpleLogger().Write(logDEBUG) << "Leaf file name " << file_index_path.string(); + util::SimpleLogger().Write(logDEBUG) << "Leaf file name " + << file_index_path.string(); throw util::exception("Could not load leaf index file. " "Is any data loaded into shared memory?"); } @@ -397,10 +402,10 @@ template class SharedDataFacade final : public BaseDataFacade< bearing_range); } - std::pair - NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, - const int bearing = 0, - const int bearing_range = 180) override final + std::pair NearestPhantomNodeWithAlternativeFromBigComponent( + const util::FixedPointCoordinate &input_coordinate, + const int bearing = 0, + const int bearing_range = 180) override final { if (!m_static_rtree.get() || CURRENT_TIMESTAMP != m_static_rtree->first) { @@ -452,7 +457,6 @@ template class SharedDataFacade final : public BaseDataFacade< std::string GetTimestamp() const override final { return m_timestamp; } }; - } } } diff --git a/include/engine/datafacade/shared_datatype.hpp b/include/engine/datafacade/shared_datatype.hpp index b576008cc..84a9d266b 100644 --- a/include/engine/datafacade/shared_datatype.hpp +++ b/include/engine/datafacade/shared_datatype.hpp @@ -54,41 +54,41 @@ struct SharedDataLayout void PrintInformation() const { util::SimpleLogger().Write(logDEBUG) << "NAME_OFFSETS " - << ": " << GetBlockSize(NAME_OFFSETS); + << ": " << GetBlockSize(NAME_OFFSETS); util::SimpleLogger().Write(logDEBUG) << "NAME_BLOCKS " - << ": " << GetBlockSize(NAME_BLOCKS); + << ": " << GetBlockSize(NAME_BLOCKS); util::SimpleLogger().Write(logDEBUG) << "NAME_CHAR_LIST " - << ": " << GetBlockSize(NAME_CHAR_LIST); + << ": " << GetBlockSize(NAME_CHAR_LIST); util::SimpleLogger().Write(logDEBUG) << "NAME_ID_LIST " - << ": " << GetBlockSize(NAME_ID_LIST); + << ": " << GetBlockSize(NAME_ID_LIST); util::SimpleLogger().Write(logDEBUG) << "VIA_NODE_LIST " - << ": " << GetBlockSize(VIA_NODE_LIST); + << ": " << GetBlockSize(VIA_NODE_LIST); util::SimpleLogger().Write(logDEBUG) << "GRAPH_NODE_LIST " - << ": " << GetBlockSize(GRAPH_NODE_LIST); + << ": " << GetBlockSize(GRAPH_NODE_LIST); util::SimpleLogger().Write(logDEBUG) << "GRAPH_EDGE_LIST " - << ": " << GetBlockSize(GRAPH_EDGE_LIST); + << ": " << GetBlockSize(GRAPH_EDGE_LIST); util::SimpleLogger().Write(logDEBUG) << "COORDINATE_LIST " - << ": " << GetBlockSize(COORDINATE_LIST); + << ": " << GetBlockSize(COORDINATE_LIST); util::SimpleLogger().Write(logDEBUG) << "TURN_INSTRUCTION " - << ": " << GetBlockSize(TURN_INSTRUCTION); + << ": " << GetBlockSize(TURN_INSTRUCTION); util::SimpleLogger().Write(logDEBUG) << "TRAVEL_MODE " - << ": " << GetBlockSize(TRAVEL_MODE); + << ": " << GetBlockSize(TRAVEL_MODE); util::SimpleLogger().Write(logDEBUG) << "R_SEARCH_TREE " - << ": " << GetBlockSize(R_SEARCH_TREE); + << ": " << GetBlockSize(R_SEARCH_TREE); util::SimpleLogger().Write(logDEBUG) << "GEOMETRIES_INDEX " - << ": " << GetBlockSize(GEOMETRIES_INDEX); + << ": " << GetBlockSize(GEOMETRIES_INDEX); util::SimpleLogger().Write(logDEBUG) << "GEOMETRIES_LIST " - << ": " << GetBlockSize(GEOMETRIES_LIST); + << ": " << GetBlockSize(GEOMETRIES_LIST); util::SimpleLogger().Write(logDEBUG) << "GEOMETRIES_INDICATORS" - << ": " << GetBlockSize(GEOMETRIES_INDICATORS); + << ": " << GetBlockSize(GEOMETRIES_INDICATORS); util::SimpleLogger().Write(logDEBUG) << "HSGR_CHECKSUM " - << ": " << GetBlockSize(HSGR_CHECKSUM); + << ": " << GetBlockSize(HSGR_CHECKSUM); util::SimpleLogger().Write(logDEBUG) << "TIMESTAMP " - << ": " << GetBlockSize(TIMESTAMP); + << ": " << GetBlockSize(TIMESTAMP); util::SimpleLogger().Write(logDEBUG) << "FILE_INDEX_PATH " - << ": " << GetBlockSize(FILE_INDEX_PATH); + << ": " << GetBlockSize(FILE_INDEX_PATH); util::SimpleLogger().Write(logDEBUG) << "CORE_MARKER " - << ": " << GetBlockSize(CORE_MARKER); + << ": " << GetBlockSize(CORE_MARKER); } template inline void SetBlockSize(BlockID bid, uint64_t entries) @@ -171,7 +171,6 @@ struct SharedDataTimestamp SharedDataType data; unsigned timestamp; }; - } } } diff --git a/include/engine/douglas_peucker.hpp b/include/engine/douglas_peucker.hpp index c7e8dd0b2..df4fe921d 100644 --- a/include/engine/douglas_peucker.hpp +++ b/include/engine/douglas_peucker.hpp @@ -55,7 +55,6 @@ class DouglasPeucker void Run(RandomAccessIt begin, RandomAccessIt end, const unsigned zoom_level); void Run(std::vector &input_geometry, const unsigned zoom_level); }; - } } diff --git a/include/engine/geospatial_query.hpp b/include/engine/geospatial_query.hpp index efd8c2603..41307043a 100644 --- a/include/engine/geospatial_query.hpp +++ b/include/engine/geospatial_query.hpp @@ -77,10 +77,10 @@ template class GeospatialQuery // Returns the nearest phantom node. If this phantom node is not from a big component // a second phantom node is return that is the nearest coordinate in a big component. - std::pair - NearestPhantomNodeWithAlternativeFromBigComponent(const util::FixedPointCoordinate &input_coordinate, - const int bearing = 0, - const int bearing_range = 180) + std::pair NearestPhantomNodeWithAlternativeFromBigComponent( + const util::FixedPointCoordinate &input_coordinate, + const int bearing = 0, + const int bearing_range = 180) { bool has_small_component = false; bool has_big_component = false; @@ -139,9 +139,10 @@ template class GeospatialQuery { util::FixedPointCoordinate point_on_segment; double ratio; - const auto current_perpendicular_distance = util::coordinate_calculation::perpendicularDistance( - coordinates->at(data.u), coordinates->at(data.v), input_coordinate, point_on_segment, - ratio); + const auto current_perpendicular_distance = + util::coordinate_calculation::perpendicularDistance( + coordinates->at(data.u), coordinates->at(data.v), input_coordinate, + point_on_segment, ratio); auto transformed = PhantomNodeWithDistance{PhantomNode{data, point_on_segment}, current_perpendicular_distance}; @@ -163,8 +164,8 @@ template class GeospatialQuery const int filter_bearing, const int filter_bearing_range) { - const double forward_edge_bearing = - util::coordinate_calculation::bearing(coordinates->at(segment.u), coordinates->at(segment.v)); + const double forward_edge_bearing = util::coordinate_calculation::bearing( + coordinates->at(segment.u), coordinates->at(segment.v)); const double backward_edge_bearing = (forward_edge_bearing + 180) > 360 ? (forward_edge_bearing - 180) @@ -172,11 +173,11 @@ template class GeospatialQuery const bool forward_bearing_valid = util::bearing::CheckInBounds(std::round(forward_edge_bearing), filter_bearing, - filter_bearing_range) && + filter_bearing_range) && segment.forward_edge_based_node_id != SPECIAL_NODEID; const bool backward_bearing_valid = util::bearing::CheckInBounds(std::round(backward_edge_bearing), filter_bearing, - filter_bearing_range) && + filter_bearing_range) && segment.reverse_edge_based_node_id != SPECIAL_NODEID; return std::make_pair(forward_bearing_valid, backward_bearing_valid); } @@ -184,7 +185,6 @@ template class GeospatialQuery RTreeT &rtree; const std::shared_ptr coordinates; }; - } } diff --git a/include/engine/guidance/segment_compression.hpp b/include/engine/guidance/segment_compression.hpp index 7981dbcaa..b9eea766d 100644 --- a/include/engine/guidance/segment_compression.hpp +++ b/include/engine/guidance/segment_compression.hpp @@ -63,4 +63,4 @@ inline void CombineSimilarSegments(std::vector &segments) } // namespace engine } // namespace osrm -#endif //ENGINE_GUIDANCE_PROCESSING_SEGMENT_COMPRESSION_HPP_ +#endif // ENGINE_GUIDANCE_PROCESSING_SEGMENT_COMPRESSION_HPP_ diff --git a/include/engine/guidance/segment_list.hpp b/include/engine/guidance/segment_list.hpp index ff42b77e6..8ae9b6884 100644 --- a/include/engine/guidance/segment_list.hpp +++ b/include/engine/guidance/segment_list.hpp @@ -146,7 +146,8 @@ void SegmentList::AddLeg(const std::vector &leg_data, const extractor::TravelMode travel_mode = (traversed_in_reverse ? target_node.backward_travel_mode : target_node.forward_travel_mode); segments.emplace_back(target_node.location, target_node.name_id, segment_duration, 0.f, - is_via_leg ? extractor::TurnInstruction::ReachViaLocation : extractor::TurnInstruction::NoTurn, + is_via_leg ? extractor::TurnInstruction::ReachViaLocation + : extractor::TurnInstruction::NoTurn, true, true, travel_mode); } @@ -220,8 +221,8 @@ void SegmentList::Finalize(const bool extract_alternative, { // move down names by one, q&d hack segments[i - 1].name_id = segments[i].name_id; - segments[i].length = util::coordinate_calculation::greatCircleDistance(segments[i - 1].location, - segments[i].location); + segments[i].length = util::coordinate_calculation::greatCircleDistance( + segments[i - 1].location, segments[i].location); } float segment_length = 0.; diff --git a/include/engine/guidance/textual_route_annotation.hpp b/include/engine/guidance/textual_route_annotation.hpp index 5a13428ba..da9a9d8bc 100644 --- a/include/engine/guidance/textual_route_annotation.hpp +++ b/include/engine/guidance/textual_route_annotation.hpp @@ -21,13 +21,13 @@ namespace engine { namespace guidance { -template< typename DataFacadeT > -inline util::json::Array -AnnotateRoute(const std::vector &route_segments, DataFacadeT* facade) +template +inline util::json::Array AnnotateRoute(const std::vector &route_segments, + DataFacadeT *facade) { util::json::Array json_instruction_array; - if( route_segments.empty() ) - return json_instruction_array; + if (route_segments.empty()) + return json_instruction_array; // Segment information has following format: //["instruction id","streetname",length,position,time,"length","earth_direction",azimuth] std::int32_t necessary_segments_running_index = 0; @@ -42,7 +42,7 @@ AnnotateRoute(const std::vector &route_segments, DataFacadeT round_about = {std::numeric_limits::max(), 0, 0}; std::string temp_dist, temp_length, temp_duration, temp_bearing, temp_instruction; - //Generate annotations for every segment + // Generate annotations for every segment for (const SegmentInformation &segment : route_segments) { util::json::Array json_instruction_row; @@ -59,8 +59,8 @@ AnnotateRoute(const std::vector &route_segments, DataFacadeT std::string current_turn_instruction; if (extractor::TurnInstruction::LeaveRoundAbout == current_instruction) { - temp_instruction = - std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::EnterRoundAbout)); + temp_instruction = std::to_string(util::cast::enum_to_underlying( + extractor::TurnInstruction::EnterRoundAbout)); current_turn_instruction += temp_instruction; current_turn_instruction += "-"; temp_instruction = std::to_string(round_about.leave_at_exit + 1); @@ -110,9 +110,9 @@ AnnotateRoute(const std::vector &route_segments, DataFacadeT } util::json::Array json_last_instruction_row; - temp_instruction = - std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination)); - json_last_instruction_row.values.emplace_back( std::move(temp_instruction)); + temp_instruction = std::to_string( + util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination)); + json_last_instruction_row.values.emplace_back(std::move(temp_instruction)); json_last_instruction_row.values.push_back(""); json_last_instruction_row.values.push_back(0); json_last_instruction_row.values.push_back(necessary_segments_running_index - 1); diff --git a/include/engine/internal_route_result.hpp b/include/engine/internal_route_result.hpp index d4536b405..25a1c9605 100644 --- a/include/engine/internal_route_result.hpp +++ b/include/engine/internal_route_result.hpp @@ -19,7 +19,8 @@ struct PathData { PathData() : node(SPECIAL_NODEID), name_id(INVALID_EDGE_WEIGHT), segment_duration(INVALID_EDGE_WEIGHT), - turn_instruction(extractor::TurnInstruction::NoTurn), travel_mode(TRAVEL_MODE_INACCESSIBLE) + turn_instruction(extractor::TurnInstruction::NoTurn), + travel_mode(TRAVEL_MODE_INACCESSIBLE) { } @@ -65,7 +66,6 @@ struct InternalRouteResult { } }; - } } diff --git a/include/engine/map_matching/bayes_classifier.hpp b/include/engine/map_matching/bayes_classifier.hpp index af2c60b29..f3c2e8eee 100644 --- a/include/engine/map_matching/bayes_classifier.hpp +++ b/include/engine/map_matching/bayes_classifier.hpp @@ -94,7 +94,6 @@ class BayesClassifier double positive_apriori_probability; double negative_apriori_probability; }; - } } } diff --git a/include/engine/map_matching/hidden_markov_model.hpp b/include/engine/map_matching/hidden_markov_model.hpp index f7528d61a..c387c1faf 100644 --- a/include/engine/map_matching/hidden_markov_model.hpp +++ b/include/engine/map_matching/hidden_markov_model.hpp @@ -34,8 +34,7 @@ struct EmissionLogProbability double operator()(const double distance) const { - return -0.5 * (log_2_pi + (distance / sigma_z) * (distance / sigma_z)) - - log_sigma_z; + return -0.5 * (log_2_pi + (distance / sigma_z) * (distance / sigma_z)) - log_sigma_z; } }; @@ -116,8 +115,7 @@ template struct HiddenMarkovModel viterbi[initial_timestamp][s] = emission_log_probability(candidates_list[initial_timestamp][s].distance); parents[initial_timestamp][s] = std::make_pair(initial_timestamp, s); - pruned[initial_timestamp][s] = - viterbi[initial_timestamp][s] < MINIMAL_LOG_PROB; + pruned[initial_timestamp][s] = viterbi[initial_timestamp][s] < MINIMAL_LOG_PROB; suspicious[initial_timestamp][s] = false; breakage[initial_timestamp] = @@ -140,7 +138,6 @@ template struct HiddenMarkovModel return initial_timestamp; } }; - } } } diff --git a/include/engine/object_encoder.hpp b/include/engine/object_encoder.hpp index b97dbc509..c9fe21b04 100644 --- a/include/engine/object_encoder.hpp +++ b/include/engine/object_encoder.hpp @@ -63,7 +63,6 @@ struct ObjectEncoder } } }; - } } diff --git a/include/engine/phantom_node.hpp b/include/engine/phantom_node.hpp index 585d2edcd..1c258b8ef 100644 --- a/include/engine/phantom_node.hpp +++ b/include/engine/phantom_node.hpp @@ -34,7 +34,8 @@ struct PhantomNode PhantomNode(); - template PhantomNode(const OtherT &other, const util::FixedPointCoordinate &foot_point) + template + PhantomNode(const OtherT &other, const util::FixedPointCoordinate &foot_point) { forward_node_id = other.forward_edge_based_node_id; reverse_node_id = other.reverse_edge_based_node_id; @@ -137,7 +138,6 @@ inline std::ostream &operator<<(std::ostream &out, const PhantomNode &pn) << "loc: " << pn.location; return out; } - } } diff --git a/include/engine/plugins/distance_table.hpp b/include/engine/plugins/distance_table.hpp index d72253909..1a37cfd06 100644 --- a/include/engine/plugins/distance_table.hpp +++ b/include/engine/plugins/distance_table.hpp @@ -219,7 +219,6 @@ template class DistanceTablePlugin final : public BasePlugin std::string descriptor_string; DataFacadeT *facade; }; - } } } diff --git a/include/engine/plugins/hello_world.hpp b/include/engine/plugins/hello_world.hpp index 38a62b37c..1b79ca3e2 100644 --- a/include/engine/plugins/hello_world.hpp +++ b/include/engine/plugins/hello_world.hpp @@ -80,7 +80,6 @@ class HelloWorldPlugin final : public BasePlugin private: std::string descriptor_string; }; - } } } diff --git a/include/engine/plugins/match.hpp b/include/engine/plugins/match.hpp index 9df0aa2af..3dded7b99 100644 --- a/include/engine/plugins/match.hpp +++ b/include/engine/plugins/match.hpp @@ -37,7 +37,9 @@ template class MapMatchingPlugin : public BasePlugin using SubMatching = routing_algorithms::SubMatching; using SubMatchingList = routing_algorithms::SubMatchingList; using CandidateLists = routing_algorithms::CandidateLists; - using ClassifierT = map_matching::BayesClassifier; + using ClassifierT = map_matching::BayesClassifier; using TraceClassification = ClassifierT::ClassificationT; public: @@ -203,13 +205,13 @@ template class MapMatchingPlugin : public BasePlugin if (route_parameters.geometry || route_parameters.print_instructions) { using SegmentList = guidance::SegmentList; - //Passing false to extract_alternative extracts the route. + // Passing false to extract_alternative extracts the route. const constexpr bool EXTRACT_ROUTE = false; // by passing false to segment_list, we skip the douglas peucker simplification // and mark all segments as necessary within the generation process const constexpr bool NO_ROUTE_SIMPLIFICATION = false; SegmentList segment_list(raw_route, EXTRACT_ROUTE, route_parameters.zoom_level, - NO_ROUTE_SIMPLIFICATION, facade); + NO_ROUTE_SIMPLIFICATION, facade); if (route_parameters.geometry) { @@ -220,8 +222,7 @@ template class MapMatchingPlugin : public BasePlugin if (route_parameters.print_instructions) { subtrace.values["instructions"] = - guidance::AnnotateRoute( - segment_list.Get(), facade); + guidance::AnnotateRoute(segment_list.Get(), facade); } util::json::Object json_route_summary; @@ -379,7 +380,6 @@ template class MapMatchingPlugin : public BasePlugin int max_locations_map_matching; ClassifierT classifier; }; - } } } diff --git a/include/engine/plugins/nearest.hpp b/include/engine/plugins/nearest.hpp index 03604b1dc..0a41fa409 100644 --- a/include/engine/plugins/nearest.hpp +++ b/include/engine/plugins/nearest.hpp @@ -30,8 +30,7 @@ template class NearestPlugin final : public BasePlugin util::json::Object &json_result) override final { // check number of parameters - if (route_parameters.coordinates.empty() || - !route_parameters.coordinates.front().IsValid()) + if (route_parameters.coordinates.empty() || !route_parameters.coordinates.front().IsValid()) { return Status::Error; } @@ -101,7 +100,6 @@ template class NearestPlugin final : public BasePlugin DataFacadeT *facade; std::string descriptor_string; }; - } } } diff --git a/include/engine/plugins/plugin_base.hpp b/include/engine/plugins/plugin_base.hpp index a2c7eba8c..3f3e62719 100644 --- a/include/engine/plugins/plugin_base.hpp +++ b/include/engine/plugins/plugin_base.hpp @@ -112,7 +112,6 @@ class BasePlugin return snapped_phantoms; } }; - } } } diff --git a/include/engine/plugins/timestamp.hpp b/include/engine/plugins/timestamp.hpp index 1ec3d0a62..2bf4bdd50 100644 --- a/include/engine/plugins/timestamp.hpp +++ b/include/engine/plugins/timestamp.hpp @@ -36,7 +36,6 @@ template class TimestampPlugin final : public BasePlugin const DataFacadeT *facade; std::string descriptor_string; }; - } } } diff --git a/include/engine/plugins/trip.hpp b/include/engine/plugins/trip.hpp index 54632fdcd..e2705f9bc 100644 --- a/include/engine/plugins/trip.hpp +++ b/include/engine/plugins/trip.hpp @@ -149,8 +149,8 @@ template class RoundTripPlugin final : public BasePlugin } // Run TarjanSCC - auto wrapper = std::make_shared>(result_table.GetTable(), - number_of_locations); + auto wrapper = std::make_shared>( + result_table.GetTable(), number_of_locations); auto scc = extractor::TarjanSCC>(wrapper); scc.run(); @@ -301,13 +301,12 @@ template class RoundTripPlugin final : public BasePlugin if (component_size < BF_MAX_FEASABLE) { - scc_route = - trip::BruteForceTrip(start, end, number_of_locations, result_table); + scc_route = trip::BruteForceTrip(start, end, number_of_locations, result_table); } else { - scc_route = trip::FarthestInsertionTrip(start, end, number_of_locations, - result_table); + scc_route = + trip::FarthestInsertionTrip(start, end, number_of_locations, result_table); } // use this output if debugging of route is needed: @@ -366,7 +365,6 @@ template class RoundTripPlugin final : public BasePlugin return Status::Ok; } }; - } } } diff --git a/include/engine/plugins/viaroute.hpp b/include/engine/plugins/viaroute.hpp index 8e58c00f9..b2790a6c3 100644 --- a/include/engine/plugins/viaroute.hpp +++ b/include/engine/plugins/viaroute.hpp @@ -166,7 +166,6 @@ template class ViaRoutePlugin final : public BasePlugin return Status::Ok; } }; - } } } diff --git a/include/engine/polyline_compressor.hpp b/include/engine/polyline_compressor.hpp index 5d26a14fa..9a7ba4d02 100644 --- a/include/engine/polyline_compressor.hpp +++ b/include/engine/polyline_compressor.hpp @@ -25,7 +25,6 @@ class PolylineCompressor std::vector decode_string(const std::string &geometry_string) const; }; - } } diff --git a/include/engine/polyline_formatter.hpp b/include/engine/polyline_formatter.hpp index 861fec01f..b2c5afe24 100644 --- a/include/engine/polyline_formatter.hpp +++ b/include/engine/polyline_formatter.hpp @@ -19,7 +19,6 @@ struct PolylineFormatter util::json::Array printUnencodedString(const std::vector &polyline) const; }; - } } diff --git a/include/engine/route_name_extraction.hpp b/include/engine/route_name_extraction.hpp index df6a8ac89..dd28f97c1 100644 --- a/include/engine/route_name_extraction.hpp +++ b/include/engine/route_name_extraction.hpp @@ -28,7 +28,7 @@ template struct ExtractRouteNames const unsigned blocked_name_id) const { SegmentT result_segment; - result_segment.name_id = blocked_name_id; //make sure we get a valid name + result_segment.name_id = blocked_name_id; // make sure we get a valid name result_segment.length = 0; for (const SegmentT &segment : segment_list) @@ -139,7 +139,6 @@ template struct ExtractRouteNames return route_names; } }; - } } diff --git a/include/engine/routing_algorithms/alternative_path.hpp b/include/engine/routing_algorithms/alternative_path.hpp index ec82818f8..91634813f 100644 --- a/include/engine/routing_algorithms/alternative_path.hpp +++ b/include/engine/routing_algorithms/alternative_path.hpp @@ -564,7 +564,8 @@ class AlternativeRouting final const NodeID node = forward_heap.DeleteMin(); const int distance = forward_heap.GetKey(node); // const NodeID parentnode = forward_heap.GetData(node).parent; - // util::SimpleLogger().Write() << (is_forward_directed ? "[fwd] " : "[rev] ") << "settled edge (" + // util::SimpleLogger().Write() << (is_forward_directed ? "[fwd] " : "[rev] ") << "settled + // edge (" // << parentnode << "," << node << "), dist: " << distance; const int scaled_distance = @@ -588,10 +589,12 @@ class AlternativeRouting final { *middle_node = node; *upper_bound_to_shortest_path_distance = new_distance; - // util::SimpleLogger().Write() << "accepted middle_node " << *middle_node << " at + // util::SimpleLogger().Write() << "accepted middle_node " << *middle_node + // << " at // distance " << new_distance; // } else { - // util::SimpleLogger().Write() << "discarded middle_node " << *middle_node << " + // util::SimpleLogger().Write() << "discarded middle_node " << *middle_node + // << " // at distance " << new_distance; } } @@ -846,7 +849,6 @@ class AlternativeRouting final return (upper_bound <= t_test_path_length); } }; - } } } diff --git a/include/engine/routing_algorithms/direct_shortest_path.hpp b/include/engine/routing_algorithms/direct_shortest_path.hpp index 7c935928c..437d88d27 100644 --- a/include/engine/routing_algorithms/direct_shortest_path.hpp +++ b/include/engine/routing_algorithms/direct_shortest_path.hpp @@ -131,7 +131,6 @@ class DirectShortestPathRouting final raw_route_data.unpacked_path_segments.front()); } }; - } } } diff --git a/include/engine/routing_algorithms/map_matching.hpp b/include/engine/routing_algorithms/map_matching.hpp index 23edcedb5..f3422dd6d 100644 --- a/include/engine/routing_algorithms/map_matching.hpp +++ b/include/engine/routing_algorithms/map_matching.hpp @@ -147,8 +147,8 @@ class MapMatching final : public BasicRoutingInterface - MAX_BROKEN_STATES); + trace_split = + trace_split || (t - prev_unbroken_timestamps.back() > MAX_BROKEN_STATES); } if (trace_split) @@ -194,8 +194,8 @@ class MapMatching final : public BasicRoutingInterface(0u, prev_viterbi.size())) @@ -246,8 +246,7 @@ class MapMatching final : public BasicRoutingInterface SUSPICIOUS_DISTANCE_DELTA; + current_suspicious[s_prime] = d_t > SUSPICIOUS_DISTANCE_DELTA; model.breakage[t] = false; } } @@ -355,7 +354,6 @@ class MapMatching final : public BasicRoutingInterface class BasicRoutingInterface { private: @@ -231,7 +230,8 @@ template class BasicRoutingInterface { BOOST_ASSERT_MSG(!ed.shortcut, "original edge flagged as shortcut"); unsigned name_index = facade->GetNameIndexFromEdgeID(ed.id); - const extractor::TurnInstruction turn_instruction = facade->GetTurnInstructionForEdgeID(ed.id); + const extractor::TurnInstruction turn_instruction = + facade->GetTurnInstructionForEdgeID(ed.id); const extractor::TravelMode travel_mode = facade->GetTravelModeForEdgeID(ed.id); if (!facade->EdgeIsCompressed(ed.id)) @@ -260,7 +260,8 @@ template class BasicRoutingInterface for (std::size_t i = start_index; i < end_index; ++i) { unpacked_path.emplace_back(id_vector[i], name_index, - extractor::TurnInstruction::NoTurn, 0, travel_mode); + extractor::TurnInstruction::NoTurn, 0, + travel_mode); } unpacked_path.back().turn_instruction = turn_instruction; unpacked_path.back().segment_duration = ed.distance; @@ -304,9 +305,10 @@ template class BasicRoutingInterface { BOOST_ASSERT(i < id_vector.size()); BOOST_ASSERT(phantom_node_pair.target_phantom.forward_travel_mode > 0); - unpacked_path.emplace_back(PathData{ - id_vector[i], phantom_node_pair.target_phantom.name_id, extractor::TurnInstruction::NoTurn, - 0, phantom_node_pair.target_phantom.forward_travel_mode}); + unpacked_path.emplace_back( + PathData{id_vector[i], phantom_node_pair.target_phantom.name_id, + extractor::TurnInstruction::NoTurn, 0, + phantom_node_pair.target_phantom.forward_travel_mode}); } } @@ -658,16 +660,15 @@ template class BasicRoutingInterface { current_coordinate = facade->GetCoordinateOfNode(p.node); distance += util::coordinate_calculation::haversineDistance(previous_coordinate, - current_coordinate); + current_coordinate); previous_coordinate = current_coordinate; } distance += util::coordinate_calculation::haversineDistance(previous_coordinate, - target_phantom.location); + target_phantom.location); } return distance; } }; - } } } diff --git a/include/engine/routing_algorithms/shortest_path.hpp b/include/engine/routing_algorithms/shortest_path.hpp index 8a057d42d..2613c3227 100644 --- a/include/engine/routing_algorithms/shortest_path.hpp +++ b/include/engine/routing_algorithms/shortest_path.hpp @@ -521,7 +521,6 @@ class ShortestPathRouting final } } }; - } } } diff --git a/include/engine/search_engine.hpp b/include/engine/search_engine.hpp index fefc90368..c15b8535f 100644 --- a/include/engine/search_engine.hpp +++ b/include/engine/search_engine.hpp @@ -41,7 +41,6 @@ template class SearchEngine ~SearchEngine() {} }; - } } diff --git a/include/engine/search_engine_data.hpp b/include/engine/search_engine_data.hpp index 2e5b59da5..3112a780c 100644 --- a/include/engine/search_engine_data.hpp +++ b/include/engine/search_engine_data.hpp @@ -19,7 +19,8 @@ struct HeapData struct SearchEngineData { - using QueryHeap = util::BinaryHeap>; + using QueryHeap = + util::BinaryHeap>; using SearchEngineHeapPtr = boost::thread_specific_ptr; static SearchEngineHeapPtr forward_heap_1; @@ -35,7 +36,6 @@ struct SearchEngineData void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes); }; - } } diff --git a/include/engine/segment_information.hpp b/include/engine/segment_information.hpp index 527726f92..842f5a3e3 100644 --- a/include/engine/segment_information.hpp +++ b/include/engine/segment_information.hpp @@ -49,12 +49,11 @@ struct SegmentInformation const extractor::TravelMode travel_mode) : location(std::move(location)), name_id(name_id), duration(duration), length(length), pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction), - travel_mode(travel_mode), necessary(turn_instruction != extractor::TurnInstruction::NoTurn), - is_via_location(false) + travel_mode(travel_mode), + necessary(turn_instruction != extractor::TurnInstruction::NoTurn), is_via_location(false) { } }; - } } diff --git a/include/engine/trip/trip_brute_force.hpp b/include/engine/trip/trip_brute_force.hpp index 5cecabcac..351295cf8 100644 --- a/include/engine/trip/trip_brute_force.hpp +++ b/include/engine/trip/trip_brute_force.hpp @@ -77,7 +77,6 @@ std::vector BruteForceTrip(const NodeIDIterator start, return route; } - } } } diff --git a/include/engine/trip/trip_farthest_insertion.hpp b/include/engine/trip/trip_farthest_insertion.hpp index 2e3b401a4..35a0c7fd4 100644 --- a/include/engine/trip/trip_farthest_insertion.hpp +++ b/include/engine/trip/trip_farthest_insertion.hpp @@ -190,7 +190,6 @@ std::vector FarthestInsertionTrip(const NodeIDIterator &start, BOOST_ASSERT_MSG(static_cast(max_to) < number_of_locations, "start node"); return FindRoute(number_of_locations, component_size, start, end, dist_table, max_from, max_to); } - } } } diff --git a/include/engine/trip/trip_nearest_neighbour.hpp b/include/engine/trip/trip_nearest_neighbour.hpp index a7a5baeb3..7f2921765 100644 --- a/include/engine/trip/trip_nearest_neighbour.hpp +++ b/include/engine/trip/trip_nearest_neighbour.hpp @@ -92,7 +92,6 @@ std::vector NearestNeighbourTrip(const NodeIDIterator &start, } return route; } - } } } diff --git a/include/engine/trip/trip_tabu_search.hpp b/include/engine/trip/trip_tabu_search.hpp index d92763616..24ff7455d 100644 --- a/include/engine/trip/trip_tabu_search.hpp +++ b/include/engine/trip/trip_tabu_search.hpp @@ -34,7 +34,6 @@ void TabuSearchTrip(const PhantomNodeArray &phantom_node_vector, std::vector &min_loc_permutation) { } - } } } diff --git a/include/extractor/compressed_edge_container.hpp b/include/extractor/compressed_edge_container.hpp index 47146162c..ed9122dd2 100644 --- a/include/extractor/compressed_edge_container.hpp +++ b/include/extractor/compressed_edge_container.hpp @@ -43,7 +43,6 @@ class CompressedEdgeContainer std::vector m_free_list; std::unordered_map m_edge_id_to_list_index_map; }; - } } diff --git a/include/extractor/edge_based_graph_factory.hpp b/include/extractor/edge_based_graph_factory.hpp index 47aeecdcb..19a3d1ba8 100644 --- a/include/extractor/edge_based_graph_factory.hpp +++ b/include/extractor/edge_based_graph_factory.hpp @@ -117,7 +117,6 @@ class EdgeBasedGraphFactory void FlushVectorToStream(std::ofstream &edge_data_file, std::vector &original_edge_data_vector) const; }; - } } diff --git a/include/extractor/edge_based_node.hpp b/include/extractor/edge_based_node.hpp index aee2d6a34..c41c3b8e3 100644 --- a/include/extractor/edge_based_node.hpp +++ b/include/extractor/edge_based_node.hpp @@ -59,7 +59,7 @@ struct EdgeBasedNode } static inline util::FixedPointCoordinate Centroid(const util::FixedPointCoordinate &a, - const util::FixedPointCoordinate &b) + const util::FixedPointCoordinate &b) { util::FixedPointCoordinate centroid; // The coordinates of the midpoint are given by: @@ -89,7 +89,6 @@ struct EdgeBasedNode TravelMode forward_travel_mode : 4; TravelMode backward_travel_mode : 4; }; - } } diff --git a/include/extractor/external_memory_node.hpp b/include/extractor/external_memory_node.hpp index 544e59fdc..a4f9ca941 100644 --- a/include/extractor/external_memory_node.hpp +++ b/include/extractor/external_memory_node.hpp @@ -31,7 +31,6 @@ struct ExternalMemoryNodeSTXXLCompare value_type max_value(); value_type min_value(); }; - } } diff --git a/include/extractor/extraction_containers.hpp b/include/extractor/extraction_containers.hpp index 53177e0d6..848e4576e 100644 --- a/include/extractor/extraction_containers.hpp +++ b/include/extractor/extraction_containers.hpp @@ -65,7 +65,6 @@ class ExtractionContainers const std::string &names_file_name, lua_State *segment_state); }; - } } diff --git a/include/extractor/extraction_helper_functions.hpp b/include/extractor/extraction_helper_functions.hpp index 82a493b77..b7df3ca9b 100644 --- a/include/extractor/extraction_helper_functions.hpp +++ b/include/extractor/extraction_helper_functions.hpp @@ -94,7 +94,6 @@ unsigned parseDuration(const std::string &s) return std::numeric_limits::max(); } - } } diff --git a/include/extractor/extraction_node.hpp b/include/extractor/extraction_node.hpp index 82826e717..e82f298ba 100644 --- a/include/extractor/extraction_node.hpp +++ b/include/extractor/extraction_node.hpp @@ -13,7 +13,6 @@ struct ExtractionNode bool traffic_lights; bool barrier; }; - } } diff --git a/include/extractor/extraction_way.hpp b/include/extractor/extraction_way.hpp index f54b5fe77..ef88feaff 100644 --- a/include/extractor/extraction_way.hpp +++ b/include/extractor/extraction_way.hpp @@ -103,7 +103,6 @@ struct ExtractionWay TravelMode forward_travel_mode : 4; TravelMode backward_travel_mode : 4; }; - } } diff --git a/include/extractor/extractor_callbacks.hpp b/include/extractor/extractor_callbacks.hpp index a862f936c..673c2f601 100644 --- a/include/extractor/extractor_callbacks.hpp +++ b/include/extractor/extractor_callbacks.hpp @@ -51,7 +51,6 @@ class ExtractorCallbacks // warning: caller needs to take care of synchronization! void ProcessWay(const osmium::Way ¤t_way, const ExtractionWay &result_way); }; - } } diff --git a/include/extractor/extractor_options.hpp b/include/extractor/extractor_options.hpp index 05949f52f..2fbe3c894 100644 --- a/include/extractor/extractor_options.hpp +++ b/include/extractor/extractor_options.hpp @@ -52,7 +52,6 @@ struct ExtractorOptions static void GenerateOutputFilesNames(ExtractorConfig &extractor_config); }; - } } diff --git a/include/extractor/first_and_last_segment_of_way.hpp b/include/extractor/first_and_last_segment_of_way.hpp index d4ea8e457..df2ca92cc 100644 --- a/include/extractor/first_and_last_segment_of_way.hpp +++ b/include/extractor/first_and_last_segment_of_way.hpp @@ -53,7 +53,6 @@ struct FirstAndLastSegmentOfWayStxxlCompare value_type max_value() { return FirstAndLastSegmentOfWay::max_value(); } value_type min_value() { return FirstAndLastSegmentOfWay::min_value(); } }; - } } diff --git a/include/extractor/graph_compressor.hpp b/include/extractor/graph_compressor.hpp index 56496aefd..69d738e68 100644 --- a/include/extractor/graph_compressor.hpp +++ b/include/extractor/graph_compressor.hpp @@ -37,7 +37,6 @@ class GraphCompressor SpeedProfileProperties speed_profile; }; - } } diff --git a/include/extractor/import_edge.hpp b/include/extractor/import_edge.hpp index 095c9f95a..fc43e2a23 100644 --- a/include/extractor/import_edge.hpp +++ b/include/extractor/import_edge.hpp @@ -94,7 +94,6 @@ struct EdgeBasedEdge bool forward : 1; bool backward : 1; }; - } } diff --git a/include/extractor/internal_extractor_edge.hpp b/include/extractor/internal_extractor_edge.hpp index 2d3447fda..8e4a133bc 100644 --- a/include/extractor/internal_extractor_edge.hpp +++ b/include/extractor/internal_extractor_edge.hpp @@ -152,7 +152,6 @@ struct CmpEdgeByOSMTargetID value_type max_value() { return InternalExtractorEdge::max_osm_value(); } value_type min_value() { return InternalExtractorEdge::min_osm_value(); } }; - } } diff --git a/include/extractor/node_id.hpp b/include/extractor/node_id.hpp index f27fd656c..faaefb2ef 100644 --- a/include/extractor/node_id.hpp +++ b/include/extractor/node_id.hpp @@ -15,7 +15,6 @@ struct Cmp value_type max_value() { return MAX_OSM_NODEID; } value_type min_value() { return MIN_OSM_NODEID; } }; - } } diff --git a/include/extractor/original_edge_data.hpp b/include/extractor/original_edge_data.hpp index dd9273bb9..3e5c0016d 100644 --- a/include/extractor/original_edge_data.hpp +++ b/include/extractor/original_edge_data.hpp @@ -37,7 +37,6 @@ struct OriginalEdgeData bool compressed_geometry; TravelMode travel_mode; }; - } } diff --git a/include/extractor/query_node.hpp b/include/extractor/query_node.hpp index 512aeaca3..abd5d5d0d 100644 --- a/include/extractor/query_node.hpp +++ b/include/extractor/query_node.hpp @@ -59,7 +59,6 @@ struct QueryNode return std::numeric_limits::lowest(); } }; - } } diff --git a/include/extractor/raster_source.hpp b/include/extractor/raster_source.hpp index a4707253c..104462619 100644 --- a/include/extractor/raster_source.hpp +++ b/include/extractor/raster_source.hpp @@ -149,7 +149,6 @@ class SourceContainer std::vector LoadedSources; std::unordered_map LoadedSourcePaths; }; - } } diff --git a/include/extractor/restriction.hpp b/include/extractor/restriction.hpp index 690d92b2b..5916c85ea 100644 --- a/include/extractor/restriction.hpp +++ b/include/extractor/restriction.hpp @@ -108,7 +108,6 @@ struct CmpRestrictionContainerByTo value_type max_value() const { return InputRestrictionContainer::max_value(); } value_type min_value() const { return InputRestrictionContainer::min_value(); } }; - } } diff --git a/include/extractor/restriction_map.hpp b/include/extractor/restriction_map.hpp index e5a6a12ba..5b9a35fb4 100644 --- a/include/extractor/restriction_map.hpp +++ b/include/extractor/restriction_map.hpp @@ -64,7 +64,6 @@ template <> struct hash }; } - namespace osrm { namespace extractor @@ -157,7 +156,6 @@ class RestrictionMap std::unordered_set m_restriction_start_nodes; std::unordered_set m_no_turn_via_node_set; }; - } } diff --git a/include/extractor/restriction_parser.hpp b/include/extractor/restriction_parser.hpp index 2bbad8268..075964ba0 100644 --- a/include/extractor/restriction_parser.hpp +++ b/include/extractor/restriction_parser.hpp @@ -14,7 +14,6 @@ namespace osmium class Relation; } - namespace osrm { namespace extractor @@ -52,7 +51,6 @@ class RestrictionParser std::vector restriction_exceptions; bool use_turn_restrictions; }; - } } diff --git a/include/extractor/scripting_environment.hpp b/include/extractor/scripting_environment.hpp index 0f1342b62..d02c7cb26 100644 --- a/include/extractor/scripting_environment.hpp +++ b/include/extractor/scripting_environment.hpp @@ -34,7 +34,6 @@ class ScriptingEnvironment std::string file_name; tbb::enumerable_thread_specific> script_contexts; }; - } } diff --git a/include/extractor/speed_profile.hpp b/include/extractor/speed_profile.hpp index 65c4141b5..82aa34bd1 100644 --- a/include/extractor/speed_profile.hpp +++ b/include/extractor/speed_profile.hpp @@ -17,7 +17,6 @@ struct SpeedProfileProperties int u_turn_penalty; bool has_turn_penalty_function; }; - } } diff --git a/include/extractor/tarjan_scc.hpp b/include/extractor/tarjan_scc.hpp index a8b8eb6ba..c49f00fb7 100644 --- a/include/extractor/tarjan_scc.hpp +++ b/include/extractor/tarjan_scc.hpp @@ -147,7 +147,7 @@ template class TarjanSCC if (size_of_current_component > 1000) { util::SimpleLogger().Write() << "large component [" << component_index - << "]=" << size_of_current_component; + << "]=" << size_of_current_component; } ++component_index; @@ -178,7 +178,6 @@ template class TarjanSCC unsigned get_component_id(const NodeID node) const { return components_index[node]; } }; - } } diff --git a/include/extractor/travel_mode.hpp b/include/extractor/travel_mode.hpp index 62fc03b92..f5d5c23f9 100644 --- a/include/extractor/travel_mode.hpp +++ b/include/extractor/travel_mode.hpp @@ -7,11 +7,11 @@ namespace extractor { using TravelMode = unsigned char; - } } -namespace { +namespace +{ static const osrm::extractor::TravelMode TRAVEL_MODE_INACCESSIBLE = 0; static const osrm::extractor::TravelMode TRAVEL_MODE_DEFAULT = 1; } diff --git a/include/extractor/turn_instructions.hpp b/include/extractor/turn_instructions.hpp index ca3623504..f5f164f18 100644 --- a/include/extractor/turn_instructions.hpp +++ b/include/extractor/turn_instructions.hpp @@ -79,7 +79,6 @@ struct TurnInstructionsClass return true; } }; - } } diff --git a/include/osrm/coordinate.hpp b/include/osrm/coordinate.hpp index b36d57ca6..e1c7fef7d 100644 --- a/include/osrm/coordinate.hpp +++ b/include/osrm/coordinate.hpp @@ -67,7 +67,6 @@ std::ostream &operator<<(std::ostream &out, const FixedPointCoordinate &coordina } using util::FixedPointCoordinate; - } #endif /* COORDINATE_HPP_ */ diff --git a/include/osrm/json_container.hpp b/include/osrm/json_container.hpp index 7c8377d32..7ab25d544 100644 --- a/include/osrm/json_container.hpp +++ b/include/osrm/json_container.hpp @@ -98,8 +98,9 @@ struct Array } // namespace JSON } // namespace util -namespace json { - using namespace osrm::util::json; +namespace json +{ +using namespace osrm::util::json; } } // namespace osrm diff --git a/include/osrm/libosrm_config.hpp b/include/osrm/libosrm_config.hpp index 4606e6003..743c68225 100644 --- a/include/osrm/libosrm_config.hpp +++ b/include/osrm/libosrm_config.hpp @@ -45,7 +45,6 @@ struct LibOSRMConfig int max_locations_map_matching = -1; bool use_shared_memory = true; }; - } #endif // SERVER_CONFIG_HPP diff --git a/include/osrm/osrm.hpp b/include/osrm/osrm.hpp index 695403d73..3f3e55333 100644 --- a/include/osrm/osrm.hpp +++ b/include/osrm/osrm.hpp @@ -43,7 +43,8 @@ struct Object; } } -namespace engine { +namespace engine +{ struct RouteParameters; class OSRM { @@ -59,7 +60,6 @@ class OSRM } using engine::OSRM; - } #endif // OSRM_HPP diff --git a/include/osrm/route_parameters.hpp b/include/osrm/route_parameters.hpp index f7bc2a261..53c8629e7 100644 --- a/include/osrm/route_parameters.hpp +++ b/include/osrm/route_parameters.hpp @@ -119,11 +119,9 @@ struct RouteParameters std::vector is_destination; std::vector is_source; }; - } using engine::RouteParameters; - } #endif // ROUTE_PARAMETERS_HPP diff --git a/include/osrm/strong_typedef.hpp b/include/osrm/strong_typedef.hpp index f4c80865e..f33932a38 100644 --- a/include/osrm/strong_typedef.hpp +++ b/include/osrm/strong_typedef.hpp @@ -68,7 +68,6 @@ namespace osrm } \ }; \ } - } #endif // OSRM_STRONG_TYPEDEF_HPP diff --git a/include/server/api_grammar.hpp b/include/server/api_grammar.hpp index 7a04d884b..afa577e1c 100644 --- a/include/server/api_grammar.hpp +++ b/include/server/api_grammar.hpp @@ -102,7 +102,6 @@ template struct APIGrammar : qi::grammar http::reply current_reply; std::vector compressed_output; }; - } } diff --git a/include/server/http/compression_type.hpp b/include/server/http/compression_type.hpp index 2a71cfa54..7ff929c0e 100644 --- a/include/server/http/compression_type.hpp +++ b/include/server/http/compression_type.hpp @@ -14,7 +14,6 @@ enum compression_type gzip_rfc1952, deflate_rfc1951 }; - } } } diff --git a/include/server/http/header.hpp b/include/server/http/header.hpp index da43412bb..33cc4bb2f 100644 --- a/include/server/http/header.hpp +++ b/include/server/http/header.hpp @@ -27,7 +27,6 @@ struct header std::string name; std::string value; }; - } } } diff --git a/include/server/http/reply.hpp b/include/server/http/reply.hpp index 15ca91a13..8474a5c2d 100644 --- a/include/server/http/reply.hpp +++ b/include/server/http/reply.hpp @@ -38,7 +38,6 @@ class reply std::string status_to_string(reply::status_type status); boost::asio::const_buffer status_to_buffer(reply::status_type status); }; - } } } diff --git a/include/server/http/request.hpp b/include/server/http/request.hpp index 0e6fb7d59..1b86253f7 100644 --- a/include/server/http/request.hpp +++ b/include/server/http/request.hpp @@ -19,7 +19,6 @@ struct request std::string agent; boost::asio::ip::address endpoint; }; - } } } diff --git a/include/server/request_handler.hpp b/include/server/request_handler.hpp index 66d2cd2b1..900370a8a 100644 --- a/include/server/request_handler.hpp +++ b/include/server/request_handler.hpp @@ -35,7 +35,6 @@ class RequestHandler private: engine::OSRM *routing_machine; }; - } } diff --git a/include/server/request_parser.hpp b/include/server/request_parser.hpp index b4df13162..0b44849ae 100644 --- a/include/server/request_parser.hpp +++ b/include/server/request_parser.hpp @@ -17,7 +17,6 @@ namespace http struct request; } - class RequestParser { public: @@ -71,7 +70,6 @@ class RequestParser bool is_post_header; int content_length; }; - } } diff --git a/include/server/server.hpp b/include/server/server.hpp index 2d40a45b8..4e6758206 100644 --- a/include/server/server.hpp +++ b/include/server/server.hpp @@ -30,7 +30,8 @@ class Server static std::shared_ptr CreateServer(std::string &ip_address, int ip_port, unsigned requested_num_threads) { - util::SimpleLogger().Write() << "http 1.1 compression handled by zlib version " << zlibVersion(); + util::SimpleLogger().Write() << "http 1.1 compression handled by zlib version " + << zlibVersion(); const unsigned hardware_threads = std::max(1u, std::thread::hardware_concurrency()); const unsigned real_num_threads = std::min(hardware_threads, requested_num_threads); return std::make_shared(ip_address, ip_port, real_num_threads); @@ -93,7 +94,6 @@ class Server std::shared_ptr new_connection; RequestHandler request_handler; }; - } } diff --git a/include/util/bearing.hpp b/include/util/bearing.hpp index 190e97a08..f1ba6244f 100644 --- a/include/util/bearing.hpp +++ b/include/util/bearing.hpp @@ -90,7 +90,6 @@ inline bool CheckInBounds(const int A, const int B, const int range) } } } - } } diff --git a/include/util/binary_heap.hpp b/include/util/binary_heap.hpp index c7d57505f..f3c01f6b6 100644 --- a/include/util/binary_heap.hpp +++ b/include/util/binary_heap.hpp @@ -290,7 +290,6 @@ class BinaryHeap #endif } }; - } } diff --git a/include/util/cast.hpp b/include/util/cast.hpp index 479eaa2a4..e78f630b6 100644 --- a/include/util/cast.hpp +++ b/include/util/cast.hpp @@ -43,7 +43,6 @@ template inline std::string to_string_with_preci return rv; } } - } } diff --git a/include/util/compute_angle.hpp b/include/util/compute_angle.hpp index 40f820d9e..2662ed99e 100644 --- a/include/util/compute_angle.hpp +++ b/include/util/compute_angle.hpp @@ -16,7 +16,6 @@ struct ComputeAngle const FixedPointCoordinate &second, const FixedPointCoordinate &third) noexcept; }; - } } diff --git a/include/util/coordinate_calculation.hpp b/include/util/coordinate_calculation.hpp index 96548481b..1507d14f0 100644 --- a/include/util/coordinate_calculation.hpp +++ b/include/util/coordinate_calculation.hpp @@ -53,7 +53,6 @@ double radToDeg(const double radian); double bearing(const FixedPointCoordinate &first_coordinate, const FixedPointCoordinate &second_coordinate); } - } } diff --git a/include/util/datastore_options.hpp b/include/util/datastore_options.hpp index b467bb836..bd0902506 100644 --- a/include/util/datastore_options.hpp +++ b/include/util/datastore_options.hpp @@ -258,7 +258,6 @@ bool GenerateDataStoreOptions(const int argc, return true; } - } } diff --git a/include/util/deallocating_vector.hpp b/include/util/deallocating_vector.hpp index aa9ec3ea2..c8883b2c6 100644 --- a/include/util/deallocating_vector.hpp +++ b/include/util/deallocating_vector.hpp @@ -306,8 +306,7 @@ class DeallocatingVector else { // down-size const std::size_t number_of_necessary_buckets = 1 + (new_size / ELEMENTS_PER_BLOCK); - for (const auto bucket_index : - irange(number_of_necessary_buckets, bucket_list.size())) + for (const auto bucket_index : irange(number_of_necessary_buckets, bucket_list.size())) { if (nullptr != bucket_list[bucket_index]) { @@ -378,7 +377,6 @@ void swap(DeallocatingVector &lhs, DeallocatingVector &rhs) { lhs.swap(rhs); } - } } diff --git a/include/util/debug_geometry.hpp b/include/util/debug_geometry.hpp index b06ed3dc6..41a3ebc8d 100644 --- a/include/util/debug_geometry.hpp +++ b/include/util/debug_geometry.hpp @@ -40,7 +40,6 @@ inline void DEBUG_SIGNAL(const NodeID /* node */, } inline void DEBUG_TURNS_STOP() {} - } } @@ -60,7 +59,6 @@ namespace osrm namespace util { - boost::filesystem::ofstream debug_geometry_file; bool dg_output_debug_geometry = false; bool dg_first_debug_geometry = true; @@ -207,7 +205,6 @@ inline void DEBUG_TURNS_STOP() dg_debug_turns_file.close(); } } - } } diff --git a/include/util/dist_table_wrapper.hpp b/include/util/dist_table_wrapper.hpp index 3e23ce2ac..28a693938 100644 --- a/include/util/dist_table_wrapper.hpp +++ b/include/util/dist_table_wrapper.hpp @@ -62,7 +62,6 @@ template class DistTableWrapper std::vector table_; const std::size_t number_of_nodes_; }; - } } diff --git a/include/util/dynamic_graph.hpp b/include/util/dynamic_graph.hpp index c4219cf28..7df32a9fc 100644 --- a/include/util/dynamic_graph.hpp +++ b/include/util/dynamic_graph.hpp @@ -95,7 +95,7 @@ template class DynamicGraph for (const auto node : irange(0u, number_of_nodes)) { for (const auto i : irange(node_array[node].first_edge, - node_array[node].first_edge + node_array[node].edges)) + node_array[node].first_edge + node_array[node].edges)) { edge_list[i].target = graph[edge].target; BOOST_ASSERT(edge_list[i].target < number_of_nodes); @@ -320,7 +320,6 @@ template class DynamicGraph std::vector node_array; DeallocatingVector edge_list; }; - } } diff --git a/include/util/fingerprint.hpp b/include/util/fingerprint.hpp index 14b869871..df656cde1 100644 --- a/include/util/fingerprint.hpp +++ b/include/util/fingerprint.hpp @@ -33,7 +33,6 @@ class FingerPrint }; static_assert(std::is_trivial::value, "FingerPrint needs to be trivial."); - } } diff --git a/include/util/fixed_point_number.hpp b/include/util/fixed_point_number.hpp index ba4b111db..8216b4caf 100644 --- a/include/util/fixed_point_number.hpp +++ b/include/util/fixed_point_number.hpp @@ -187,7 +187,6 @@ class FixedPointNumber }; static_assert(4 == sizeof(FixedPointNumber<1>), "FP19 has wrong size != 4"); - } } diff --git a/include/util/floating_point.hpp b/include/util/floating_point.hpp index e7963e630..779f095db 100644 --- a/include/util/floating_point.hpp +++ b/include/util/floating_point.hpp @@ -16,7 +16,6 @@ template bool epsilon_compare(const FloatT number1, const Floa static_assert(std::is_floating_point::value, "type must be floating point"); return (std::abs(number1 - number2) < std::numeric_limits::epsilon()); } - } } diff --git a/include/util/graph_loader.hpp b/include/util/graph_loader.hpp index 6ff030b5a..b4d3f4f5e 100644 --- a/include/util/graph_loader.hpp +++ b/include/util/graph_loader.hpp @@ -84,7 +84,8 @@ NodeID loadNodesFromFile(std::istream &input_stream, extractor::ExternalMemoryNode current_node; for (NodeID i = 0; i < n; ++i) { - input_stream.read(reinterpret_cast(¤t_node), sizeof(extractor::ExternalMemoryNode)); + input_stream.read(reinterpret_cast(¤t_node), + sizeof(extractor::ExternalMemoryNode)); node_array.emplace_back(current_node.lat, current_node.lon, current_node.node_id); if (current_node.barrier) { @@ -106,7 +107,8 @@ NodeID loadNodesFromFile(std::istream &input_stream, /** * Reads a .osrm file and produces the edges. */ -NodeID loadEdgesFromFile(std::istream &input_stream, std::vector &edge_list) +NodeID loadEdgesFromFile(std::istream &input_stream, + std::vector &edge_list) { EdgeID m; input_stream.read(reinterpret_cast(&m), sizeof(unsigned)); @@ -196,7 +198,6 @@ unsigned readHSGRFromStream(const boost::filesystem::path &hsgr_file, return number_of_nodes; } - } } diff --git a/include/util/hilbert_value.hpp b/include/util/hilbert_value.hpp index 6c8af4f19..641782e85 100644 --- a/include/util/hilbert_value.hpp +++ b/include/util/hilbert_value.hpp @@ -23,7 +23,6 @@ class HilbertCode inline uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const; inline void TransposeCoordinate(uint32_t *X) const; }; - } } diff --git a/include/util/integer_range.hpp b/include/util/integer_range.hpp index cba88ad92..ee706bd8b 100644 --- a/include/util/integer_range.hpp +++ b/include/util/integer_range.hpp @@ -47,7 +47,6 @@ irange(const Integer first, { return range(first, last); } - } } diff --git a/include/util/iso_8601_duration_parser.hpp b/include/util/iso_8601_duration_parser.hpp index 493149c01..91f9d2dc4 100644 --- a/include/util/iso_8601_duration_parser.hpp +++ b/include/util/iso_8601_duration_parser.hpp @@ -76,7 +76,6 @@ template struct iso_8601_grammar : qi::grammar return temp; } }; - } } diff --git a/include/util/json_logger.hpp b/include/util/json_logger.hpp index 6b81cc6fc..aa72b54cf 100644 --- a/include/util/json_logger.hpp +++ b/include/util/json_logger.hpp @@ -55,7 +55,6 @@ class Logger boost::thread_specific_ptr map; }; - } } } diff --git a/include/util/json_util.hpp b/include/util/json_util.hpp index 2cf012eb2..d858f6b20 100644 --- a/include/util/json_util.hpp +++ b/include/util/json_util.hpp @@ -59,15 +59,13 @@ template <> Array make_array(const std::vector &vector) // Easy acces to object hierachies Value &get(Value &value) { return value; } -template -Value &get(Value &value, const char *key, Keys... keys) +template Value &get(Value &value, const char *key, Keys... keys) { using recursive_object_t = mapbox::util::recursive_wrapper; return get(value.get().get().values[key], keys...); } -template -Value &get(Value &value, unsigned key, Keys... keys) +template Value &get(Value &value, unsigned key, Keys... keys) { using recursive_array_t = mapbox::util::recursive_wrapper; return get(value.get().get().values[key], keys...); diff --git a/include/util/lua_util.hpp b/include/util/lua_util.hpp index 47339fdd8..4eb799e04 100644 --- a/include/util/lua_util.hpp +++ b/include/util/lua_util.hpp @@ -39,7 +39,6 @@ inline void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_ const std::string lua_code = "package.path = \"" + folder + "/?.lua;\" .. package.path"; luaL_dostring(lua_state, lua_code.c_str()); } - } } diff --git a/include/util/make_unique.hpp b/include/util/make_unique.hpp index 09a1dd924..74d4e3d0e 100644 --- a/include/util/make_unique.hpp +++ b/include/util/make_unique.hpp @@ -45,7 +45,6 @@ make_unique(size_t n) /// This function isn't used and is only here to provide better compile errors. template typename std::enable_if::value != 0>::type make_unique(Args &&...) = delete; - } } diff --git a/include/util/matching_debug_info.hpp b/include/util/matching_debug_info.hpp index dc8e561d7..e90053378 100644 --- a/include/util/matching_debug_info.hpp +++ b/include/util/matching_debug_info.hpp @@ -41,7 +41,7 @@ struct MatchingDebugInfo state.values["transitions"] = json::Array(); state.values["coordinate"] = json::make_array(elem_s.phantom_node.location.lat / COORDINATE_PRECISION, - elem_s.phantom_node.location.lon / COORDINATE_PRECISION); + elem_s.phantom_node.location.lon / COORDINATE_PRECISION); state.values["viterbi"] = json::clamp_float(engine::map_matching::IMPOSSIBLE_LOG_PROB); state.values["pruned"] = 0u; @@ -129,7 +129,6 @@ struct MatchingDebugInfo const json::Logger *logger; json::Value *object; }; - } } diff --git a/include/util/matrix_graph_wrapper.hpp b/include/util/matrix_graph_wrapper.hpp index 11b1f2586..52f7fd390 100644 --- a/include/util/matrix_graph_wrapper.hpp +++ b/include/util/matrix_graph_wrapper.hpp @@ -12,7 +12,8 @@ namespace osrm namespace util { -// This Wrapper provides all methods that are needed for extractor::TarjanSCC, when the graph is given in a +// This Wrapper provides all methods that are needed for extractor::TarjanSCC, when the graph is +// given in a // matrix representation (e.g. as output from a distance table call) template class MatrixGraphWrapper @@ -44,7 +45,6 @@ template class MatrixGraphWrapper const std::vector table_; const std::size_t number_of_nodes_; }; - } } diff --git a/include/util/mercator.hpp b/include/util/mercator.hpp index 230c1ad23..eda28a96c 100644 --- a/include/util/mercator.hpp +++ b/include/util/mercator.hpp @@ -12,7 +12,6 @@ struct mercator static double lat2y(const double latitude) noexcept; }; - } } diff --git a/include/util/node_based_graph.hpp b/include/util/node_based_graph.hpp index 09b082496..c1aa0323d 100644 --- a/include/util/node_based_graph.hpp +++ b/include/util/node_based_graph.hpp @@ -63,8 +63,8 @@ NodeBasedDynamicGraphFromEdges(std::size_t number_of_nodes, const std::vector &input_edge_list) { auto edges_list = directedEdgesFromCompressed( - input_edge_list, - [](NodeBasedDynamicGraph::InputEdge &output_edge, const extractor::NodeBasedEdge &input_edge) + input_edge_list, [](NodeBasedDynamicGraph::InputEdge &output_edge, + const extractor::NodeBasedEdge &input_edge) { output_edge.data.distance = static_cast(input_edge.weight); BOOST_ASSERT(output_edge.data.distance > 0); @@ -83,7 +83,6 @@ NodeBasedDynamicGraphFromEdges(std::size_t number_of_nodes, return graph; } - } } diff --git a/include/util/osrm_exception.hpp b/include/util/osrm_exception.hpp index fc84cb981..6c7c5e2f6 100644 --- a/include/util/osrm_exception.hpp +++ b/include/util/osrm_exception.hpp @@ -24,7 +24,6 @@ class exception final : public std::exception const char *what() const noexcept override { return message.c_str(); } const std::string message; }; - } } diff --git a/include/util/percent.hpp b/include/util/percent.hpp index 4f0d0e72c..d34a77d07 100644 --- a/include/util/percent.hpp +++ b/include/util/percent.hpp @@ -75,7 +75,6 @@ class Percent } } }; - } } diff --git a/include/util/range_algorithms.hpp b/include/util/range_algorithms.hpp index 47393b523..964595634 100644 --- a/include/util/range_algorithms.hpp +++ b/include/util/range_algorithms.hpp @@ -19,7 +19,6 @@ auto max_element(const Container &c) -> decltype(std::max_element(c.cbegin(), c. { return std::max_element(c.cbegin(), c.cend()); } - } } diff --git a/include/util/range_table.hpp b/include/util/range_table.hpp index 97cbc3abe..f06df1def 100644 --- a/include/util/range_table.hpp +++ b/include/util/range_table.hpp @@ -233,7 +233,6 @@ std::istream &operator>>(std::istream &in, RangeTable struct ShM SharedMemoryWrapper, std::vector>::type; }; - } } diff --git a/include/util/simple_logger.hpp b/include/util/simple_logger.hpp index 0b33f51fa..29301b9d5 100644 --- a/include/util/simple_logger.hpp +++ b/include/util/simple_logger.hpp @@ -48,7 +48,6 @@ class SimpleLogger std::ostringstream os; LogLevel level; }; - } } diff --git a/include/util/static_graph.hpp b/include/util/static_graph.hpp index 744dabb8b..c37b09e40 100644 --- a/include/util/static_graph.hpp +++ b/include/util/static_graph.hpp @@ -193,7 +193,6 @@ template class StaticGraph typename ShM::vector node_array; typename ShM::vector edge_array; }; - } } diff --git a/include/util/string_util.hpp b/include/util/string_util.hpp index 6a3c772bd..1a54c9475 100644 --- a/include/util/string_util.hpp +++ b/include/util/string_util.hpp @@ -126,7 +126,6 @@ inline std::size_t URIDecode(const std::string &input, std::string &output) } inline std::size_t URIDecodeInPlace(std::string &URI) { return URIDecode(URI, URI); } - } } diff --git a/include/util/timing_util.hpp b/include/util/timing_util.hpp index 44af92b89..537f0dc5e 100644 --- a/include/util/timing_util.hpp +++ b/include/util/timing_util.hpp @@ -64,7 +64,6 @@ class GlobalTimerFactory std::chrono::duration_cast(_X##_stop - _X##_start).count()) #define TIMER_MIN(_X) \ std::chrono::duration_cast(_X##_stop - _X##_start).count() - } } diff --git a/include/util/tribool.hpp b/include/util/tribool.hpp index ec7ca76a7..85282de88 100644 --- a/include/util/tribool.hpp +++ b/include/util/tribool.hpp @@ -12,7 +12,6 @@ enum class tribool : char no, indeterminate }; - } } #endif // TRIBOOL_HPP diff --git a/include/util/trigonometry_table.hpp b/include/util/trigonometry_table.hpp index 5c92829c0..69e0bb459 100644 --- a/include/util/trigonometry_table.hpp +++ b/include/util/trigonometry_table.hpp @@ -422,7 +422,6 @@ inline double atan2_lookup(double y, double x) } return angle; } - } } diff --git a/include/util/xor_fast_hash.hpp b/include/util/xor_fast_hash.hpp index 247c76ba6..5b7a103bb 100644 --- a/include/util/xor_fast_hash.hpp +++ b/include/util/xor_fast_hash.hpp @@ -89,7 +89,6 @@ class XORMiniHash return table1[byte1] ^ table2[byte2] ^ table3[byte3] ^ table4[byte4]; } }; - } } diff --git a/include/util/xor_fast_hash_storage.hpp b/include/util/xor_fast_hash_storage.hpp index 046580dc9..7fad54027 100644 --- a/include/util/xor_fast_hash_storage.hpp +++ b/include/util/xor_fast_hash_storage.hpp @@ -75,7 +75,6 @@ template class XORFastHashStorage XORFastHash fast_hasher; unsigned current_timestamp; }; - } } diff --git a/src/benchmarks/static_rtree.cpp b/src/benchmarks/static_rtree.cpp index ab6b019a7..54126c805 100644 --- a/src/benchmarks/static_rtree.cpp +++ b/src/benchmarks/static_rtree.cpp @@ -23,7 +23,8 @@ constexpr int32_t WORLD_MAX_LON = 180 * COORDINATE_PRECISION; using RTreeLeaf = extractor::EdgeBasedNode; using FixedPointCoordinateListPtr = std::shared_ptr>; -using BenchStaticRTree = util::StaticRTree::vector, false>; +using BenchStaticRTree = + util::StaticRTree::vector, false>; using BenchQuery = engine::GeospatialQuery; FixedPointCoordinateListPtr loadCoordinates(const boost::filesystem::path &nodes_file) @@ -56,7 +57,7 @@ void benchmarkQuery(const std::vector &queries, for (const auto &q : queries) { auto result = query(q); - (void) result; + (void)result; } TIMER_STOP(query); diff --git a/src/contractor/processing_chain.cpp b/src/contractor/processing_chain.cpp index b108522fa..f563de45b 100644 --- a/src/contractor/processing_chain.cpp +++ b/src/contractor/processing_chain.cpp @@ -42,7 +42,6 @@ template <> struct hash> }; } - namespace osrm { namespace contractor @@ -105,19 +104,20 @@ int Prepare::Run() util::SimpleLogger().Write() << "Preprocessing : " << TIMER_SEC(preparing) << " seconds"; util::SimpleLogger().Write() << "Contraction: " << ((max_edge_id + 1) / TIMER_SEC(contraction)) - << " nodes/sec and " << number_of_used_edges / TIMER_SEC(contraction) - << " edges/sec"; + << " nodes/sec and " + << number_of_used_edges / TIMER_SEC(contraction) << " edges/sec"; util::SimpleLogger().Write() << "finished preprocessing"; return 0; } -std::size_t Prepare::LoadEdgeExpandedGraph(std::string const &edge_based_graph_filename, - util::DeallocatingVector &edge_based_edge_list, - const std::string &edge_segment_lookup_filename, - const std::string &edge_penalty_filename, - const std::string &segment_speed_filename) +std::size_t Prepare::LoadEdgeExpandedGraph( + std::string const &edge_based_graph_filename, + util::DeallocatingVector &edge_based_edge_list, + const std::string &edge_segment_lookup_filename, + const std::string &edge_penalty_filename, + const std::string &segment_speed_filename) { util::SimpleLogger().Write() << "Opening " << edge_based_graph_filename; boost::filesystem::ifstream input_stream(edge_based_graph_filename, std::ios::binary); @@ -149,14 +149,16 @@ std::size_t Prepare::LoadEdgeExpandedGraph(std::string const &edge_based_graph_f input_stream.read((char *)&max_edge_id, sizeof(size_t)); edge_based_edge_list.resize(number_of_edges); - util::SimpleLogger().Write() << "Reading " << number_of_edges << " edges from the edge based graph"; + util::SimpleLogger().Write() << "Reading " << number_of_edges + << " edges from the edge based graph"; std::unordered_map, unsigned> segment_speed_lookup; if (update_edge_weights) { - util::SimpleLogger().Write() << "Segment speed data supplied, will update edge weights from " - << segment_speed_filename; + util::SimpleLogger().Write() + << "Segment speed data supplied, will update edge weights from " + << segment_speed_filename; io::CSVReader<3> csv_in(segment_speed_filename); csv_in.set_header("from_node", "to_node", "speed"); uint64_t from_node_id{}; @@ -218,8 +220,8 @@ std::size_t Prepare::LoadEdgeExpandedGraph(std::string const &edge_based_graph_f (segment_length * 10.) / (speed_iter->second / 3.6) + .5))); new_weight += new_segment_weight; - util::DEBUG_GEOMETRY_EDGE(new_segment_weight, segment_length, previous_osm_node_id, - this_osm_node_id); + util::DEBUG_GEOMETRY_EDGE(new_segment_weight, segment_length, + previous_osm_node_id, this_osm_node_id); } else { @@ -227,7 +229,7 @@ std::size_t Prepare::LoadEdgeExpandedGraph(std::string const &edge_based_graph_f new_weight += segment_weight; util::DEBUG_GEOMETRY_EDGE(segment_weight, segment_length, previous_osm_node_id, - this_osm_node_id); + this_osm_node_id); } previous_osm_node_id = this_osm_node_id; @@ -282,14 +284,15 @@ void Prepare::WriteCoreNodeMarker(std::vector &&in_is_core_node) const sizeof(char) * unpacked_bool_flags.size()); } -std::size_t Prepare::WriteContractedGraph(unsigned max_node_id, - const util::DeallocatingVector &contracted_edge_list) +std::size_t +Prepare::WriteContractedGraph(unsigned max_node_id, + const util::DeallocatingVector &contracted_edge_list) { // Sorting contracted edges in a way that the static query graph can read some in in-place. tbb::parallel_sort(contracted_edge_list.begin(), contracted_edge_list.end()); const unsigned contracted_edge_count = contracted_edge_list.size(); util::SimpleLogger().Write() << "Serializing compacted graph of " << contracted_edge_count - << " edges"; + << " edges"; const util::FingerPrint fingerprint = util::FingerPrint::GetValid(); boost::filesystem::ofstream hsgr_output_stream(config.graph_output_path, std::ios::binary); @@ -308,7 +311,8 @@ std::size_t Prepare::WriteContractedGraph(unsigned max_node_id, }(); util::SimpleLogger().Write(logDEBUG) << "input graph has " << (max_node_id + 1) << " nodes"; - util::SimpleLogger().Write(logDEBUG) << "contracted graph has " << (max_used_node_id + 1) << " nodes"; + util::SimpleLogger().Write(logDEBUG) << "contracted graph has " << (max_used_node_id + 1) + << " nodes"; std::vector::NodeArrayEntry> node_array; // make sure we have at least one sentinel @@ -355,7 +359,8 @@ std::size_t Prepare::WriteContractedGraph(unsigned max_node_id, if (node_array_size > 0) { hsgr_output_stream.write((char *)&node_array[0], - sizeof(util::StaticGraph::NodeArrayEntry) * node_array_size); + sizeof(util::StaticGraph::NodeArrayEntry) * + node_array_size); } // serialize all edges @@ -375,14 +380,14 @@ std::size_t Prepare::WriteContractedGraph(unsigned max_node_id, #ifndef NDEBUG if (current_edge.data.distance <= 0) { - util::SimpleLogger().Write(logWARNING) << "Edge: " << edge - << ",source: " << contracted_edge_list[edge].source - << ", target: " << contracted_edge_list[edge].target - << ", dist: " << current_edge.data.distance; + util::SimpleLogger().Write(logWARNING) + << "Edge: " << edge << ",source: " << contracted_edge_list[edge].source + << ", target: " << contracted_edge_list[edge].target + << ", dist: " << current_edge.data.distance; util::SimpleLogger().Write(logWARNING) << "Failed at adjacency list of node " - << contracted_edge_list[edge].source << "/" - << node_array.size() - 1; + << contracted_edge_list[edge].source << "/" + << node_array.size() - 1; return 1; } #endif @@ -398,11 +403,12 @@ std::size_t Prepare::WriteContractedGraph(unsigned max_node_id, /** \brief Build contracted graph. */ -void Prepare::ContractGraph(const unsigned max_edge_id, - util::DeallocatingVector &edge_based_edge_list, - util::DeallocatingVector &contracted_edge_list, - std::vector &is_core_node, - std::vector &inout_node_levels) const +void Prepare::ContractGraph( + const unsigned max_edge_id, + util::DeallocatingVector &edge_based_edge_list, + util::DeallocatingVector &contracted_edge_list, + std::vector &is_core_node, + std::vector &inout_node_levels) const { std::vector node_levels; node_levels.swap(inout_node_levels); diff --git a/src/extractor/compressed_edge_container.cpp b/src/extractor/compressed_edge_container.cpp index 9f20ac1ea..e34bb424e 100644 --- a/src/extractor/compressed_edge_container.cpp +++ b/src/extractor/compressed_edge_container.cpp @@ -186,16 +186,14 @@ void CompressedEdgeContainer::PrintStatistics() const longest_chain_length = std::max(longest_chain_length, (uint64_t)current_vector.size()); } - util::SimpleLogger().Write() << "Geometry successfully removed:" - "\n compressed edges: " - << compressed_edges - << "\n compressed geometries: " << compressed_geometries - << "\n longest chain length: " << longest_chain_length - << "\n cmpr ratio: " << ((float)compressed_edges / - std::max(compressed_geometries, (uint64_t)1)) - << "\n avg chain length: " - << (float)compressed_geometries / - std::max((uint64_t)1, compressed_edges); + util::SimpleLogger().Write() + << "Geometry successfully removed:" + "\n compressed edges: " + << compressed_edges << "\n compressed geometries: " << compressed_geometries + << "\n longest chain length: " << longest_chain_length << "\n cmpr ratio: " + << ((float)compressed_edges / std::max(compressed_geometries, (uint64_t)1)) + << "\n avg chain length: " + << (float)compressed_geometries / std::max((uint64_t)1, compressed_edges); } const CompressedEdgeContainer::EdgeBucket & diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index 8bae91dc1..6c2bedcc1 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -37,7 +37,8 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory( { } -void EdgeBasedGraphFactory::GetEdgeBasedEdges(util::DeallocatingVector &output_edge_list) +void EdgeBasedGraphFactory::GetEdgeBasedEdges( + util::DeallocatingVector &output_edge_list) { BOOST_ASSERT_MSG(0 == output_edge_list.size(), "Vector is not empty"); using std::swap; // Koenig swap @@ -321,7 +322,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes() BOOST_ASSERT(m_edge_based_node_list.size() == m_edge_based_node_is_startpoint.size()); util::SimpleLogger().Write() << "Generated " << m_edge_based_node_list.size() - << " nodes in edge-expanded graph"; + << " nodes in edge-expanded graph"; } /// Actually it also generates OriginalEdgeData and serializes them... @@ -451,7 +452,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( { distance += speed_profile.traffic_signal_penalty; - util::DEBUG_SIGNAL(node_v, m_node_info_list, speed_profile.traffic_signal_penalty); + util::DEBUG_SIGNAL(node_v, m_node_info_list, + speed_profile.traffic_signal_penalty); } // unpack last node of first segment if packed @@ -478,7 +480,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( util::DEBUG_UTURN(node_v, m_node_info_list, speed_profile.u_turn_penalty); } - util::DEBUG_TURN(node_v, m_node_info_list, first_coordinate, turn_angle, turn_penalty); + util::DEBUG_TURN(node_v, m_node_info_list, first_coordinate, turn_angle, + turn_penalty); distance += turn_penalty; @@ -546,8 +549,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( const QueryNode &from = m_node_info_list[previous]; const QueryNode &to = m_node_info_list[target_node.first]; const double segment_length = - util::coordinate_calculation::greatCircleDistance(from.lat, from.lon, - to.lat, to.lon); + util::coordinate_calculation::greatCircleDistance( + from.lat, from.lon, to.lat, to.lon); edge_segment_file.write(reinterpret_cast(&to.node_id), sizeof(to.node_id)); @@ -564,8 +567,9 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( static const unsigned node_count = 2; const QueryNode from = m_node_info_list[node_u]; const QueryNode to = m_node_info_list[node_v]; - const double segment_length = util::coordinate_calculation::greatCircleDistance( - from.lat, from.lon, to.lat, to.lon); + const double segment_length = + util::coordinate_calculation::greatCircleDistance(from.lat, from.lon, + to.lat, to.lon); edge_segment_file.write(reinterpret_cast(&node_count), sizeof(node_count)); edge_segment_file.write(reinterpret_cast(&from.node_id), @@ -591,15 +595,18 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( edge_data_file.write((char *)&original_edges_counter, sizeof(unsigned)); edge_data_file.close(); - util::SimpleLogger().Write() << "Generated " << m_edge_based_node_list.size() << " edge based nodes"; - util::SimpleLogger().Write() << "Node-based graph contains " << node_based_edge_counter << " edges"; + util::SimpleLogger().Write() << "Generated " << m_edge_based_node_list.size() + << " edge based nodes"; + util::SimpleLogger().Write() << "Node-based graph contains " << node_based_edge_counter + << " edges"; util::SimpleLogger().Write() << "Edge-expanded graph ..."; util::SimpleLogger().Write() << " contains " << m_edge_based_edge_list.size() << " edges"; util::SimpleLogger().Write() << " skips " << restricted_turns_counter << " turns, " - "defined by " - << m_restriction_map->size() << " restrictions"; + "defined by " + << m_restriction_map->size() << " restrictions"; util::SimpleLogger().Write() << " skips " << skipped_uturns_counter << " U turns"; - util::SimpleLogger().Write() << " skips " << skipped_barrier_turns_counter << " turns over barriers"; + util::SimpleLogger().Write() << " skips " << skipped_barrier_turns_counter + << " turns over barriers"; } int EdgeBasedGraphFactory::GetTurnPenalty(double angle, lua_State *lua_state) const diff --git a/src/extractor/extraction_containers.cpp b/src/extractor/extraction_containers.cpp index 72333644a..299d35f24 100644 --- a/src/extractor/extraction_containers.cpp +++ b/src/extractor/extraction_containers.cpp @@ -218,7 +218,7 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state) if (edge_iterator->result.osm_source_id < node_iterator->node_id) { util::SimpleLogger().Write(LogLevel::logWARNING) << "Found invalid node reference " - << edge_iterator->result.source; + << edge_iterator->result.source; edge_iterator->result.source = SPECIAL_NODEID; ++edge_iterator; continue; @@ -255,7 +255,7 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state) auto markSourcesInvalid = [](InternalExtractorEdge &edge) { util::SimpleLogger().Write(LogLevel::logWARNING) << "Found invalid node reference " - << edge.result.source; + << edge.result.source; edge.result.source = SPECIAL_NODEID; edge.result.osm_source_id = SPECIAL_OSM_NODEID; }; @@ -362,7 +362,7 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state) auto markTargetsInvalid = [](InternalExtractorEdge &edge) { util::SimpleLogger().Write(LogLevel::logWARNING) << "Found invalid node reference " - << edge.result.target; + << edge.result.target; edge.result.target = SPECIAL_NODEID; }; std::for_each(edge_iterator, all_edges_list_end_, markTargetsInvalid); @@ -614,8 +614,9 @@ void ExtractionContainers::PrepareRestrictions() if (way_start_and_end_iterator->way_id > OSMWayID(restrictions_iterator->restriction.from.way)) { - util::SimpleLogger().Write(LogLevel::logDEBUG) << "Restriction references invalid way: " - << restrictions_iterator->restriction.from.way; + util::SimpleLogger().Write(LogLevel::logDEBUG) + << "Restriction references invalid way: " + << restrictions_iterator->restriction.from.way; restrictions_iterator->restriction.from.node = SPECIAL_NODEID; ++restrictions_iterator; continue; @@ -630,8 +631,9 @@ void ExtractionContainers::PrepareRestrictions() auto via_id_iter = external_to_internal_node_id_map.find(via_node_id); if (via_id_iter == external_to_internal_node_id_map.end()) { - util::SimpleLogger().Write(LogLevel::logDEBUG) << "Restriction references invalid node: " - << restrictions_iterator->restriction.via.node; + util::SimpleLogger().Write(LogLevel::logDEBUG) + << "Restriction references invalid node: " + << restrictions_iterator->restriction.via.node; restrictions_iterator->restriction.via.node = SPECIAL_NODEID; ++restrictions_iterator; continue; @@ -691,8 +693,9 @@ void ExtractionContainers::PrepareRestrictions() if (way_start_and_end_iterator->way_id > OSMWayID(restrictions_iterator->restriction.to.way)) { - util::SimpleLogger().Write(LogLevel::logDEBUG) << "Restriction references invalid way: " - << restrictions_iterator->restriction.to.way; + util::SimpleLogger().Write(LogLevel::logDEBUG) + << "Restriction references invalid way: " + << restrictions_iterator->restriction.to.way; restrictions_iterator->restriction.to.way = SPECIAL_NODEID; ++restrictions_iterator; continue; diff --git a/src/extractor/extractor.cpp b/src/extractor/extractor.cpp index 053e5bd1c..693576877 100644 --- a/src/extractor/extractor.cpp +++ b/src/extractor/extractor.cpp @@ -219,12 +219,13 @@ int extractor::run() } } TIMER_STOP(parsing); - util::SimpleLogger().Write() << "Parsing finished after " << TIMER_SEC(parsing) << " seconds"; + util::SimpleLogger().Write() << "Parsing finished after " << TIMER_SEC(parsing) + << " seconds"; - util::SimpleLogger().Write() << "Raw input contains " << number_of_nodes.load() << " nodes, " - << number_of_ways.load() << " ways, and " - << number_of_relations.load() << " relations, and " - << number_of_others.load() << " unknown entities"; + util::SimpleLogger().Write() << "Raw input contains " << number_of_nodes.load() + << " nodes, " << number_of_ways.load() << " ways, and " + << number_of_relations.load() << " relations, and " + << number_of_others.load() << " unknown entities"; extractor_callbacks.reset(); @@ -238,7 +239,8 @@ int extractor::run() config.names_file_name, segment_state); TIMER_STOP(extracting); - util::SimpleLogger().Write() << "extraction finished after " << TIMER_SEC(extracting) << "s"; + util::SimpleLogger().Write() << "extraction finished after " << TIMER_SEC(extracting) + << "s"; } catch (const std::exception &e) { @@ -287,12 +289,11 @@ int extractor::run() WriteEdgeBasedGraph(config.edge_graph_output_path, max_edge_id, edge_based_edge_list); - util::SimpleLogger().Write() << "Expansion : " - << (number_of_node_based_nodes / TIMER_SEC(expansion)) - << " nodes/sec and " << ((max_edge_id + 1) / TIMER_SEC(expansion)) - << " edges/sec"; + util::SimpleLogger().Write() + << "Expansion : " << (number_of_node_based_nodes / TIMER_SEC(expansion)) + << " nodes/sec and " << ((max_edge_id + 1) / TIMER_SEC(expansion)) << " edges/sec"; util::SimpleLogger().Write() << "To prepare the data for routing, run: " - << "./osrm-prepare " << config.output_file_name << std::endl; + << "./osrm-prepare " << config.output_file_name << std::endl; } catch (const std::exception &e) { @@ -332,7 +333,7 @@ void extractor::SetupScriptingEnvironment(lua_State *lua_state, } speed_profile.traffic_signal_penalty = 10 * lua_tointeger(lua_state, -1); util::SimpleLogger().Write(logDEBUG) << "traffic_signal_penalty: " - << speed_profile.traffic_signal_penalty; + << speed_profile.traffic_signal_penalty; if (0 != luaL_dostring(lua_state, "return u_turn_penalty\n")) { @@ -455,7 +456,7 @@ extractor::LoadNodeBasedGraph(std::unordered_set &barrier_nodes, input_stream, barrier_list, traffic_light_list, internal_to_external_node_map); util::SimpleLogger().Write() << " - " << barrier_list.size() << " bollard nodes, " - << traffic_light_list.size() << " traffic lights"; + << traffic_light_list.size() << " traffic lights"; // insert into unordered sets for fast lookup barrier_nodes.insert(barrier_list.begin(), barrier_list.end()); @@ -556,8 +557,8 @@ void extractor::BuildRTree(std::vector node_based_edge_list, const std::vector &internal_to_external_node_map) { util::SimpleLogger().Write() << "constructing r-tree of " << node_based_edge_list.size() - << " edge elements build on-top of " - << internal_to_external_node_map.size() << " coordinates"; + << " edge elements build on-top of " + << internal_to_external_node_map.size() << " coordinates"; BOOST_ASSERT(node_is_startpoint.size() == node_based_edge_list.size()); @@ -579,16 +580,18 @@ void extractor::BuildRTree(std::vector node_based_edge_list, TIMER_START(construction); util::StaticRTree rtree(node_based_edge_list, config.rtree_nodes_output_path, - config.rtree_leafs_output_path, internal_to_external_node_map); + config.rtree_leafs_output_path, + internal_to_external_node_map); TIMER_STOP(construction); util::SimpleLogger().Write() << "finished r-tree construction in " << TIMER_SEC(construction) - << " seconds"; + << " seconds"; } -void extractor::WriteEdgeBasedGraph(std::string const &output_file_filename, - size_t const max_edge_id, - util::DeallocatingVector const &edge_based_edge_list) +void extractor::WriteEdgeBasedGraph( + std::string const &output_file_filename, + size_t const max_edge_id, + util::DeallocatingVector const &edge_based_edge_list) { std::ofstream file_out_stream; diff --git a/src/extractor/extractor_callbacks.cpp b/src/extractor/extractor_callbacks.cpp index 03f60134f..25cc24ead 100644 --- a/src/extractor/extractor_callbacks.cpp +++ b/src/extractor/extractor_callbacks.cpp @@ -85,7 +85,7 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti if (std::numeric_limits::max() == input_way.id()) { util::SimpleLogger().Write(logDEBUG) << "found bogus way with id: " << input_way.id() - << " of size " << input_way.nodes().size(); + << " of size " << input_way.nodes().size(); return; } @@ -123,7 +123,8 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti if (forward_weight_data.type == InternalExtractorEdge::WeightType::INVALID && backward_weight_data.type == InternalExtractorEdge::WeightType::INVALID) { - util::SimpleLogger().Write(logDEBUG) << "found way with bogus speed, id: " << input_way.id(); + util::SimpleLogger().Write(logDEBUG) << "found way with bogus speed, id: " + << input_way.id(); return; } diff --git a/src/extractor/extractor_options.cpp b/src/extractor/extractor_options.cpp index 90d9ee8e3..12081266c 100644 --- a/src/extractor/extractor_options.cpp +++ b/src/extractor/extractor_options.cpp @@ -108,7 +108,7 @@ ExtractorOptions::ParseArguments(int argc, char *argv[], ExtractorConfig &extrac if (boost::filesystem::is_regular_file(extractor_config.config_file_path)) { util::SimpleLogger().Write() << "Reading options from: " - << extractor_config.config_file_path.string(); + << extractor_config.config_file_path.string(); std::string ini_file_contents = util::read_file_lower_content(extractor_config.config_file_path); std::stringstream config_stream(ini_file_contents); diff --git a/src/extractor/graph_compressor.cpp b/src/extractor/graph_compressor.cpp index ec02fdc57..c288bf54b 100644 --- a/src/extractor/graph_compressor.cpp +++ b/src/extractor/graph_compressor.cpp @@ -183,9 +183,9 @@ void GraphCompressor::PrintStatistics(unsigned original_number_of_nodes, } } util::SimpleLogger().Write() << "Node compression ratio: " - << new_node_count / (double)original_number_of_nodes; + << new_node_count / (double)original_number_of_nodes; util::SimpleLogger().Write() << "Edge compression ratio: " - << new_edge_count / (double)original_number_of_edges; + << new_edge_count / (double)original_number_of_edges; } } } diff --git a/src/extractor/raster_source.cpp b/src/extractor/raster_source.cpp index 840e79449..2d369cb44 100644 --- a/src/extractor/raster_source.cpp +++ b/src/extractor/raster_source.cpp @@ -93,7 +93,7 @@ int SourceContainer::loadRasterSource(const std::string &path_string, if (itr != LoadedSourcePaths.end()) { util::SimpleLogger().Write() << "[source loader] Already loaded source '" << path_string - << "' at source_id " << itr->second; + << "' at source_id " << itr->second; return itr->second; } @@ -115,7 +115,8 @@ int SourceContainer::loadRasterSource(const std::string &path_string, LoadedSourcePaths.emplace(path_string, source_id); LoadedSources.push_back(std::move(source)); - util::SimpleLogger().Write() << "[source loader] ok, after " << TIMER_SEC(loading_source) << "s"; + util::SimpleLogger().Write() << "[source loader] ok, after " << TIMER_SEC(loading_source) + << "s"; return source_id; } diff --git a/src/extractor/restriction_parser.cpp b/src/extractor/restriction_parser.cpp index 2c3641a4c..3df9e0754 100644 --- a/src/extractor/restriction_parser.cpp +++ b/src/extractor/restriction_parser.cpp @@ -24,7 +24,8 @@ namespace osrm namespace extractor { -namespace { +namespace +{ int luaErrorCallback(lua_State *lua_state) { std::string error_msg = lua_tostring(lua_state, -1); @@ -70,7 +71,7 @@ void RestrictionParser::ReadRestrictionExceptions(lua_State *lua_state) boost::ref(restriction_exceptions)); const unsigned exception_count = restriction_exceptions.size(); util::SimpleLogger().Write() << "Found " << exception_count - << " exceptions to turn restrictions:"; + << " exceptions to turn restrictions:"; for (const std::string &str : restriction_exceptions) { util::SimpleLogger().Write() << " " << str; diff --git a/src/server/request_handler.cpp b/src/server/request_handler.cpp index a579a039d..4b83c83ee 100644 --- a/src/server/request_handler.cpp +++ b/src/server/request_handler.cpp @@ -53,18 +53,16 @@ void RequestHandler::handle_request(const http::request ¤t_request, time_stamp = localtime(<ime); // log timestamp - util::SimpleLogger().Write() << (time_stamp->tm_mday < 10 ? "0" : "") << time_stamp->tm_mday - << "-" << (time_stamp->tm_mon + 1 < 10 ? "0" : "") - << (time_stamp->tm_mon + 1) << "-" << 1900 + time_stamp->tm_year - << " " << (time_stamp->tm_hour < 10 ? "0" : "") - << time_stamp->tm_hour << ":" << (time_stamp->tm_min < 10 ? "0" : "") - << time_stamp->tm_min << ":" << (time_stamp->tm_sec < 10 ? "0" : "") - << time_stamp->tm_sec << " " << current_request.endpoint.to_string() - << " " << current_request.referrer - << (0 == current_request.referrer.length() ? "- " : " ") - << current_request.agent - << (0 == current_request.agent.length() ? "- " : " ") - << request_string; + util::SimpleLogger().Write() + << (time_stamp->tm_mday < 10 ? "0" : "") << time_stamp->tm_mday << "-" + << (time_stamp->tm_mon + 1 < 10 ? "0" : "") << (time_stamp->tm_mon + 1) << "-" + << 1900 + time_stamp->tm_year << " " << (time_stamp->tm_hour < 10 ? "0" : "") + << time_stamp->tm_hour << ":" << (time_stamp->tm_min < 10 ? "0" : "") + << time_stamp->tm_min << ":" << (time_stamp->tm_sec < 10 ? "0" : "") + << time_stamp->tm_sec << " " << current_request.endpoint.to_string() << " " + << current_request.referrer << (0 == current_request.referrer.length() ? "- " : " ") + << current_request.agent << (0 == current_request.agent.length() ? "- " : " ") + << request_string; engine::RouteParameters route_parameters; APIGrammarParser api_parser(&route_parameters); @@ -151,7 +149,7 @@ void RequestHandler::handle_request(const http::request ¤t_request, current_reply = http::reply::stock_reply(http::reply::internal_server_error); ; util::SimpleLogger().Write(logWARNING) << "[server error] code: " << e.what() - << ", uri: " << current_request.uri; + << ", uri: " << current_request.uri; } } diff --git a/src/tools/check-hsgr.cpp b/src/tools/check-hsgr.cpp index 4c6b3deb1..6f97d32ec 100644 --- a/src/tools/check-hsgr.cpp +++ b/src/tools/check-hsgr.cpp @@ -19,7 +19,6 @@ namespace tools using EdgeData = contractor::QueryEdge::EdgeData; using QueryGraph = util::StaticGraph; - } } @@ -44,10 +43,10 @@ int main(int argc, char *argv[]) unsigned m_number_of_nodes = readHSGRFromStream(hsgr_path, node_list, edge_list, &m_check_sum); osrm::util::SimpleLogger().Write() << "expecting " << m_number_of_nodes - << " nodes, checksum: " << m_check_sum; + << " nodes, checksum: " << m_check_sum; BOOST_ASSERT_MSG(0 != node_list.size(), "node list empty"); - osrm::util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " << edge_list.size() - << " edges"; + osrm::util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " + << edge_list.size() << " edges"; auto m_query_graph = std::make_shared(node_list, edge_list); BOOST_ASSERT_MSG(0 == node_list.size(), "node list not flushed"); @@ -67,18 +66,18 @@ int main(int argc, char *argv[]) const EdgeID edge_id_1 = m_query_graph->FindEdgeInEitherDirection(node_u, data.id); if (SPECIAL_EDGEID == edge_id_1) { - throw osrm::util::exception("cannot find first segment of edge (" + - std::to_string(node_u) + "," + std::to_string(data.id) + - "," + std::to_string(node_v) + "), eid: " + - std::to_string(eid)); + throw osrm::util::exception( + "cannot find first segment of edge (" + std::to_string(node_u) + "," + + std::to_string(data.id) + "," + std::to_string(node_v) + "), eid: " + + std::to_string(eid)); } const EdgeID edge_id_2 = m_query_graph->FindEdgeInEitherDirection(data.id, node_v); if (SPECIAL_EDGEID == edge_id_2) { - throw osrm::util::exception("cannot find second segment of edge (" + - std::to_string(node_u) + "," + std::to_string(data.id) + - "," + std::to_string(node_v) + "), eid: " + - std::to_string(eid)); + throw osrm::util::exception( + "cannot find second segment of edge (" + std::to_string(node_u) + "," + + std::to_string(data.id) + "," + std::to_string(node_v) + "), eid: " + + std::to_string(eid)); } } progress.printStatus(node_u); diff --git a/src/tools/components.cpp b/src/tools/components.cpp index ffefa984f..ae6da2126 100644 --- a/src/tools/components.cpp +++ b/src/tools/components.cpp @@ -66,7 +66,7 @@ std::size_t loadGraph(const char *path, std::vector barrier_node_list; auto number_of_nodes = util::loadNodesFromFile(input_stream, barrier_node_list, - traffic_light_node_list, coordinate_list); + traffic_light_node_list, coordinate_list); util::loadEdgesFromFile(input_stream, edge_list); @@ -116,17 +116,20 @@ int main(int argc, char *argv[]) auto number_of_nodes = osrm::tools::loadGraph(argv[1], coordinate_list, graph_edge_list); tbb::parallel_sort(graph_edge_list.begin(), graph_edge_list.end()); - const auto graph = std::make_shared(number_of_nodes, graph_edge_list); + const auto graph = + std::make_shared(number_of_nodes, graph_edge_list); graph_edge_list.clear(); graph_edge_list.shrink_to_fit(); osrm::util::SimpleLogger().Write() << "Starting SCC graph traversal"; - auto tarjan = osrm::util::make_unique>(graph); + auto tarjan = + osrm::util::make_unique>(graph); tarjan->run(); osrm::util::SimpleLogger().Write() << "identified: " << tarjan->get_number_of_components() - << " many components"; - osrm::util::SimpleLogger().Write() << "identified " << tarjan->get_size_one_count() << " size 1 SCCs"; + << " many components"; + osrm::util::SimpleLogger().Write() << "identified " << tarjan->get_size_one_count() + << " size 1 SCCs"; // output TIMER_START(SCC_RUN_SETUP); @@ -141,8 +144,7 @@ int main(int argc, char *argv[]) OGRRegisterAll(); const char *psz_driver_name = "ESRI Shapefile"; - auto *po_driver = - OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(psz_driver_name); + auto *po_driver = OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(psz_driver_name); if (nullptr == po_driver) { throw osrm::util::exception("ESRI Shapefile driver not available"); @@ -164,8 +166,8 @@ int main(int argc, char *argv[]) throw osrm::util::exception("Layer creation failed."); } TIMER_STOP(SCC_RUN_SETUP); - osrm::util::SimpleLogger().Write() << "shapefile setup took " << TIMER_MSEC(SCC_RUN_SETUP) / 1000. - << "s"; + osrm::util::SimpleLogger().Write() << "shapefile setup took " + << TIMER_MSEC(SCC_RUN_SETUP) / 1000. << "s"; uint64_t total_network_length = 0; percentage.reinit(graph->GetNumberOfNodes()); @@ -196,12 +198,15 @@ int main(int argc, char *argv[]) if (size_of_containing_component < 1000) { OGRLineString line_string; - line_string.addPoint(coordinate_list[source].lon / osrm::COORDINATE_PRECISION, - coordinate_list[source].lat / osrm::COORDINATE_PRECISION); - line_string.addPoint(coordinate_list[target].lon / osrm::COORDINATE_PRECISION, - coordinate_list[target].lat / osrm::COORDINATE_PRECISION); + line_string.addPoint( + coordinate_list[source].lon / osrm::COORDINATE_PRECISION, + coordinate_list[source].lat / osrm::COORDINATE_PRECISION); + line_string.addPoint( + coordinate_list[target].lon / osrm::COORDINATE_PRECISION, + coordinate_list[target].lat / osrm::COORDINATE_PRECISION); - OGRFeature *po_feature = OGRFeature::CreateFeature(po_layer->GetLayerDefn()); + OGRFeature *po_feature = + OGRFeature::CreateFeature(po_layer->GetLayerDefn()); po_feature->SetGeometry(&line_string); if (OGRERR_NONE != po_layer->CreateFeature(po_feature)) @@ -216,12 +221,12 @@ int main(int argc, char *argv[]) OGRSpatialReference::DestroySpatialReference(po_srs); OGRDataSource::DestroyDataSource(po_datasource); TIMER_STOP(SCC_OUTPUT); - osrm::util::SimpleLogger().Write() << "generating output took: " << TIMER_MSEC(SCC_OUTPUT) / 1000. - << "s"; + osrm::util::SimpleLogger().Write() + << "generating output took: " << TIMER_MSEC(SCC_OUTPUT) / 1000. << "s"; - osrm::util::SimpleLogger().Write() << "total network distance: " - << static_cast(total_network_length / 100 / 1000.) - << " km"; + osrm::util::SimpleLogger().Write() + << "total network distance: " + << static_cast(total_network_length / 100 / 1000.) << " km"; osrm::util::SimpleLogger().Write() << "finished component analysis"; } diff --git a/src/tools/contract.cpp b/src/tools/contract.cpp index 151965281..508f77bf8 100644 --- a/src/tools/contract.cpp +++ b/src/tools/contract.cpp @@ -18,7 +18,8 @@ int main(int argc, char *argv[]) try util::LogPolicy::GetInstance().Unmute(); contractor::ContractorConfig contractor_config; - const contractor::return_code result = contractor::ContractorOptions::ParseArguments(argc, argv, contractor_config); + const contractor::return_code result = + contractor::ContractorOptions::ParseArguments(argc, argv, contractor_config); if (contractor::return_code::fail == result) { @@ -42,9 +43,9 @@ int main(int argc, char *argv[]) try if (recommended_num_threads != contractor_config.requested_num_threads) { - util::SimpleLogger().Write(logWARNING) << "The recommended number of threads is " - << recommended_num_threads - << "! This setting may have performance side-effects."; + util::SimpleLogger().Write(logWARNING) + << "The recommended number of threads is " << recommended_num_threads + << "! This setting may have performance side-effects."; } if (!boost::filesystem::is_regular_file(contractor_config.osrm_input_path)) @@ -56,14 +57,15 @@ int main(int argc, char *argv[]) try if (!boost::filesystem::is_regular_file(contractor_config.profile_path)) { - util::SimpleLogger().Write(logWARNING) << "Profile " << contractor_config.profile_path.string() - << " not found!"; + util::SimpleLogger().Write(logWARNING) + << "Profile " << contractor_config.profile_path.string() << " not found!"; return EXIT_FAILURE; } util::SimpleLogger().Write() << "Input file: " - << contractor_config.osrm_input_path.filename().string(); - util::SimpleLogger().Write() << "Profile: " << contractor_config.profile_path.filename().string(); + << contractor_config.osrm_input_path.filename().string(); + util::SimpleLogger().Write() << "Profile: " + << contractor_config.profile_path.filename().string(); util::SimpleLogger().Write() << "Threads: " << contractor_config.requested_num_threads; tbb::task_scheduler_init init(contractor_config.requested_num_threads); diff --git a/src/tools/datastore.cpp b/src/tools/datastore.cpp index b459465f2..41e11dcfe 100644 --- a/src/tools/datastore.cpp +++ b/src/tools/datastore.cpp @@ -37,8 +37,11 @@ using namespace osrm::engine::datafacade; using namespace osrm::datastore; using namespace osrm; -using RTreeLeaf = typename engine::datafacade::BaseDataFacade::RTreeLeaf; -using RTreeNode = util::StaticRTree::vector, true>::TreeNode; +using RTreeLeaf = + typename engine::datafacade::BaseDataFacade::RTreeLeaf; +using RTreeNode = util::StaticRTree::vector, + true>::TreeNode; using QueryGraph = util::StaticGraph; namespace osrm @@ -75,7 +78,6 @@ void deleteRegion(const SharedDataType region) util::SimpleLogger().Write(logWARNING) << "could not delete shared memory region " << name; } } - } } @@ -89,7 +91,8 @@ int main(const int argc, const char *argv[]) try const bool lock_flags = MCL_CURRENT | MCL_FUTURE; if (-1 == mlockall(lock_flags)) { - util::SimpleLogger().Write(logWARNING) << "Process " << argv[0] << " could not request RAM lock"; + util::SimpleLogger().Write(logWARNING) << "Process " << argv[0] + << " could not request RAM lock"; } #endif @@ -237,9 +240,9 @@ int main(const int argc, const char *argv[]) try shared_layout_ptr->SetBlockSize(SharedDataLayout::NAME_ID_LIST, number_of_original_edges); shared_layout_ptr->SetBlockSize(SharedDataLayout::TRAVEL_MODE, - number_of_original_edges); + number_of_original_edges); shared_layout_ptr->SetBlockSize(SharedDataLayout::TURN_INSTRUCTION, - number_of_original_edges); + number_of_original_edges); // note: there are 32 geometry indicators in one unsigned block shared_layout_ptr->SetBlockSize(SharedDataLayout::GEOMETRIES_INDICATORS, number_of_original_edges); @@ -256,7 +259,7 @@ int main(const int argc, const char *argv[]) try else { util::SimpleLogger().Write(logWARNING) << ".hsgr was prepared with different build. " - "Reprocess to get rid of this warning."; + "Reprocess to get rid of this warning."; } // load checksum @@ -292,7 +295,8 @@ int main(const int argc, const char *argv[]) try boost::filesystem::ifstream timestamp_stream(timestamp_path); if (!timestamp_stream) { - util::SimpleLogger().Write(logWARNING) << timestamp_path << " not found. setting to default"; + util::SimpleLogger().Write(logWARNING) << timestamp_path + << " not found. setting to default"; } else { @@ -323,7 +327,7 @@ int main(const int argc, const char *argv[]) try unsigned coordinate_list_size = 0; nodes_input_stream.read((char *)&coordinate_list_size, sizeof(unsigned)); shared_layout_ptr->SetBlockSize(SharedDataLayout::COORDINATE_LIST, - coordinate_list_size); + coordinate_list_size); // load geometries sizes std::ifstream geometry_input_stream(geometries_data_path.string().c_str(), std::ios::binary); @@ -339,8 +343,8 @@ int main(const int argc, const char *argv[]) try shared_layout_ptr->SetBlockSize(SharedDataLayout::GEOMETRIES_LIST, number_of_compressed_geometries); // allocate shared memory block - util::SimpleLogger().Write() << "allocating shared memory of " << shared_layout_ptr->GetSizeOfLayout() - << " bytes"; + util::SimpleLogger().Write() << "allocating shared memory of " + << shared_layout_ptr->GetSizeOfLayout() << " bytes"; SharedMemory *shared_memory = SharedMemoryFactory::Get(data_region, shared_layout_ptr->GetSizeOfLayout()); char *shared_memory_ptr = static_cast(shared_memory->Ptr()); @@ -403,11 +407,13 @@ int main(const int argc, const char *argv[]) try unsigned *name_id_ptr = shared_layout_ptr->GetBlockPtr( shared_memory_ptr, SharedDataLayout::NAME_ID_LIST); - extractor::TravelMode *travel_mode_ptr = shared_layout_ptr->GetBlockPtr( - shared_memory_ptr, SharedDataLayout::TRAVEL_MODE); + extractor::TravelMode *travel_mode_ptr = + shared_layout_ptr->GetBlockPtr(shared_memory_ptr, + SharedDataLayout::TRAVEL_MODE); - extractor::TurnInstruction *turn_instructions_ptr = shared_layout_ptr->GetBlockPtr( - shared_memory_ptr, SharedDataLayout::TURN_INSTRUCTION); + extractor::TurnInstruction *turn_instructions_ptr = + shared_layout_ptr->GetBlockPtr( + shared_memory_ptr, SharedDataLayout::TURN_INSTRUCTION); unsigned *geometries_indicator_ptr = shared_layout_ptr->GetBlockPtr( shared_memory_ptr, SharedDataLayout::GEOMETRIES_INDICATORS); @@ -575,8 +581,9 @@ int main(const int argc, const char *argv[]) try catch (const std::bad_alloc &e) { util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what(); - util::SimpleLogger().Write(logWARNING) << "Please provide more memory or disable locking the virtual " - "address space (note: this makes OSRM swap, i.e. slow)"; + util::SimpleLogger().Write(logWARNING) + << "Please provide more memory or disable locking the virtual " + "address space (note: this makes OSRM swap, i.e. slow)"; return EXIT_FAILURE; } catch (const std::exception &e) diff --git a/src/tools/extract.cpp b/src/tools/extract.cpp index 7f317cb8d..a4edf8ba0 100644 --- a/src/tools/extract.cpp +++ b/src/tools/extract.cpp @@ -15,7 +15,8 @@ int main(int argc, char *argv[]) try util::LogPolicy::GetInstance().Unmute(); extractor::ExtractorConfig extractor_config; - const extractor::return_code result = extractor::ExtractorOptions::ParseArguments(argc, argv, extractor_config); + const extractor::return_code result = + extractor::ExtractorOptions::ParseArguments(argc, argv, extractor_config); if (extractor::return_code::fail == result) { @@ -37,15 +38,15 @@ int main(int argc, char *argv[]) try if (!boost::filesystem::is_regular_file(extractor_config.input_path)) { - util::SimpleLogger().Write(logWARNING) << "Input file " << extractor_config.input_path.string() - << " not found!"; + util::SimpleLogger().Write(logWARNING) + << "Input file " << extractor_config.input_path.string() << " not found!"; return EXIT_FAILURE; } if (!boost::filesystem::is_regular_file(extractor_config.profile_path)) { - util::SimpleLogger().Write(logWARNING) << "Profile " << extractor_config.profile_path.string() - << " not found!"; + util::SimpleLogger().Write(logWARNING) + << "Profile " << extractor_config.profile_path.string() << " not found!"; return EXIT_FAILURE; } return extractor::extractor(extractor_config).run(); diff --git a/src/tools/io-benchmark.cpp b/src/tools/io-benchmark.cpp index dda28000e..edd128d1b 100644 --- a/src/tools/io-benchmark.cpp +++ b/src/tools/io-benchmark.cpp @@ -44,7 +44,6 @@ void runStatistics(std::vector &timings_vector, Statistics &stats) timings_vector.begin(), 0.0); stats.dev = std::sqrt(primary_sq_sum / timings_vector.size() - (stats.mean * stats.mean)); } - } } @@ -66,7 +65,8 @@ int main(int argc, char *argv[]) { if (1 == argc) { - osrm::util::SimpleLogger().Write(logWARNING) << "usage: " << argv[0] << " /path/on/device"; + osrm::util::SimpleLogger().Write(logWARNING) << "usage: " << argv[0] + << " /path/on/device"; return -1; } @@ -90,7 +90,8 @@ int main(int argc, char *argv[]) fcntl(fileno(fd), F_NOCACHE, 1); fcntl(fileno(fd), F_RDAHEAD, 0); TIMER_START(write_1gb); - write(fileno(fd), (char *)random_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); + write(fileno(fd), (char *)random_array, + osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); TIMER_STOP(write_1gb); fclose(fd); #endif @@ -102,7 +103,8 @@ int main(int argc, char *argv[]) throw osrm::util::exception("Could not open random data file"); } TIMER_START(write_1gb); - int ret = write(file_desc, random_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); + int ret = + write(file_desc, random_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); if (0 > ret) { throw osrm::util::exception("could not write random data file"); @@ -111,10 +113,11 @@ int main(int argc, char *argv[]) close(file_desc); #endif delete[] random_array; - osrm::util::SimpleLogger().Write(logDEBUG) << "writing raw 1GB took " << TIMER_SEC(write_1gb) - << "s"; + osrm::util::SimpleLogger().Write(logDEBUG) << "writing raw 1GB took " + << TIMER_SEC(write_1gb) << "s"; osrm::util::SimpleLogger().Write() << "raw write performance: " << std::setprecision(5) - << std::fixed << 1024 * 1024 / TIMER_SEC(write_1gb) << "MB/sec"; + << std::fixed << 1024 * 1024 / TIMER_SEC(write_1gb) + << "MB/sec"; osrm::util::SimpleLogger().Write(logDEBUG) << "finished creation of random data. Flush disk cache now!"; @@ -146,7 +149,8 @@ int main(int argc, char *argv[]) osrm::util::SimpleLogger().Write(logDEBUG) << "opened, error: " << strerror(errno); return -1; } - char *raw_array = (char *)memalign(512, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); + char *raw_array = + (char *)memalign(512, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); #endif TIMER_START(read_1gb); #ifdef __APPLE__ @@ -155,18 +159,21 @@ int main(int argc, char *argv[]) fd = fopen(test_path.string().c_str(), "r"); #endif #ifdef __linux__ - int ret = read(file_desc, raw_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); + int ret = + read(file_desc, raw_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)); osrm::util::SimpleLogger().Write(logDEBUG) << "read " << ret - << " bytes, error: " << strerror(errno); + << " bytes, error: " << strerror(errno); close(file_desc); file_desc = open(test_path.string().c_str(), O_RDONLY | O_DIRECT | O_SYNC); osrm::util::SimpleLogger().Write(logDEBUG) << "opened, error: " << strerror(errno); #endif TIMER_STOP(read_1gb); - osrm::util::SimpleLogger().Write(logDEBUG) << "reading raw 1GB took " << TIMER_SEC(read_1gb) << "s"; - osrm::util::SimpleLogger().Write() << "raw read performance: " << std::setprecision(5) << std::fixed - << 1024 * 1024 / TIMER_SEC(read_1gb) << "MB/sec"; + osrm::util::SimpleLogger().Write(logDEBUG) << "reading raw 1GB took " + << TIMER_SEC(read_1gb) << "s"; + osrm::util::SimpleLogger().Write() << "raw read performance: " << std::setprecision(5) + << std::fixed << 1024 * 1024 / TIMER_SEC(read_1gb) + << "MB/sec"; std::vector timing_results_raw_random; osrm::util::SimpleLogger().Write(logDEBUG) << "running 1000 random I/Os of 4KB"; @@ -178,7 +185,8 @@ int main(int argc, char *argv[]) lseek(file_desc, 0, SEEK_SET); #endif // make 1000 random access, time each I/O seperately - unsigned number_of_blocks = (osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned) - 1) / 4096; + unsigned number_of_blocks = + (osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned) - 1) / 4096; std::random_device rd; std::default_random_engine e1(rd()); std::uniform_int_distribution uniform_dist(0, number_of_blocks - 1); @@ -205,13 +213,15 @@ int main(int argc, char *argv[]) if (((off_t)-1) == ret1) { osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset; - osrm::util::SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno); + osrm::util::SimpleLogger().Write(logWARNING) << "seek error " + << strerror(errno); throw osrm::util::exception("seek error"); } if (-1 == ret2) { osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset; - osrm::util::SimpleLogger().Write(logWARNING) << "read error " << strerror(errno); + osrm::util::SimpleLogger().Write(logWARNING) << "read error " + << strerror(errno); throw osrm::util::exception("read error"); } timing_results_raw_random.push_back(TIMER_SEC(random_access)); @@ -227,12 +237,12 @@ int main(int argc, char *argv[]) random_csv.close(); osrm::tools::runStatistics(timing_results_raw_random, stats); - osrm::util::SimpleLogger().Write() << "raw random I/O: " << std::setprecision(5) << std::fixed - << "min: " << stats.min << "ms, " - << "mean: " << stats.mean << "ms, " - << "med: " << stats.med << "ms, " - << "max: " << stats.max << "ms, " - << "dev: " << stats.dev << "ms"; + osrm::util::SimpleLogger().Write() << "raw random I/O: " << std::setprecision(5) + << std::fixed << "min: " << stats.min << "ms, " + << "mean: " << stats.mean << "ms, " + << "med: " << stats.med << "ms, " + << "max: " << stats.max << "ms, " + << "dev: " << stats.dev << "ms"; std::vector timing_results_raw_seq; #ifdef __APPLE__ @@ -266,13 +276,15 @@ int main(int argc, char *argv[]) if (((off_t)-1) == ret1) { osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset; - osrm::util::SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno); + osrm::util::SimpleLogger().Write(logWARNING) << "seek error " + << strerror(errno); throw osrm::util::exception("seek error"); } if (-1 == ret2) { osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset; - osrm::util::SimpleLogger().Write(logWARNING) << "read error " << strerror(errno); + osrm::util::SimpleLogger().Write(logWARNING) << "read error " + << strerror(errno); throw osrm::util::exception("read error"); } timing_results_raw_seq.push_back(TIMER_SEC(read_every_100)); @@ -296,12 +308,12 @@ int main(int argc, char *argv[]) } seq_csv.close(); osrm::tools::runStatistics(timing_results_raw_seq, stats); - osrm::util::SimpleLogger().Write() << "raw sequential I/O: " << std::setprecision(5) << std::fixed - << "min: " << stats.min << "ms, " - << "mean: " << stats.mean << "ms, " - << "med: " << stats.med << "ms, " - << "max: " << stats.max << "ms, " - << "dev: " << stats.dev << "ms"; + osrm::util::SimpleLogger().Write() << "raw sequential I/O: " << std::setprecision(5) + << std::fixed << "min: " << stats.min << "ms, " + << "mean: " << stats.mean << "ms, " + << "med: " << stats.med << "ms, " + << "max: " << stats.max << "ms, " + << "dev: " << stats.dev << "ms"; if (boost::filesystem::exists(test_path)) { diff --git a/src/tools/simpleclient.cpp b/src/tools/simpleclient.cpp index 65198ee05..f00b302d6 100644 --- a/src/tools/simpleclient.cpp +++ b/src/tools/simpleclient.cpp @@ -61,7 +61,8 @@ int main(int argc, const char *argv[]) } catch (std::exception ¤t_exception) { - osrm::util::SimpleLogger().Write(logWARNING) << "caught exception: " << current_exception.what(); + osrm::util::SimpleLogger().Write(logWARNING) << "caught exception: " + << current_exception.what(); return -1; } return 0; diff --git a/src/tools/springclean.cpp b/src/tools/springclean.cpp index f242e5ed2..7408e7d2c 100644 --- a/src/tools/springclean.cpp +++ b/src/tools/springclean.cpp @@ -63,10 +63,13 @@ int main() osrm::util::SimpleLogger().Write() << "Releasing all locks"; osrm::util::SimpleLogger().Write() << "ATTENTION! BE CAREFUL!"; osrm::util::SimpleLogger().Write() << "----------------------"; - osrm::util::SimpleLogger().Write() << "This tool may put osrm-routed into an undefined state!"; - osrm::util::SimpleLogger().Write() << "Type 'Y' to acknowledge that you know what your are doing."; - osrm::util::SimpleLogger().Write() << "\n\nDo you want to purge all shared memory allocated " - << "by osrm-datastore? [type 'Y' to confirm]"; + osrm::util::SimpleLogger().Write() + << "This tool may put osrm-routed into an undefined state!"; + osrm::util::SimpleLogger().Write() + << "Type 'Y' to acknowledge that you know what your are doing."; + osrm::util::SimpleLogger().Write() + << "\n\nDo you want to purge all shared memory allocated " + << "by osrm-datastore? [type 'Y' to confirm]"; const auto letter = getchar(); if (letter != 'Y') diff --git a/src/util/coordinate.cpp b/src/util/coordinate.cpp index 4a35c7ed4..da1f9db9e 100644 --- a/src/util/coordinate.cpp +++ b/src/util/coordinate.cpp @@ -52,7 +52,8 @@ bool FixedPointCoordinate::operator==(const FixedPointCoordinate &other) const std::ostream &operator<<(std::ostream &out, const FixedPointCoordinate &coordinate) { - out << "(" << static_cast(coordinate.lat / COORDINATE_PRECISION) << "," << static_cast(coordinate.lon / COORDINATE_PRECISION) << ")"; + out << "(" << static_cast(coordinate.lat / COORDINATE_PRECISION) << "," + << static_cast(coordinate.lon / COORDINATE_PRECISION) << ")"; return out; } } diff --git a/src/util/osrm_exception.cpp b/src/util/osrm_exception.cpp index a987bc75d..91ca7c4f5 100644 --- a/src/util/osrm_exception.cpp +++ b/src/util/osrm_exception.cpp @@ -17,6 +17,5 @@ namespace util { void exception::anchor() const {} - } } diff --git a/unit_tests/engine/douglas_peucker.cpp b/unit_tests/engine/douglas_peucker.cpp index 0a5bc0a87..4c165c1a6 100644 --- a/unit_tests/engine/douglas_peucker.cpp +++ b/unit_tests/engine/douglas_peucker.cpp @@ -15,8 +15,8 @@ using namespace osrm::engine; SegmentInformation getTestInfo(int lat, int lon, bool necessary) { - return SegmentInformation(util::FixedPointCoordinate(lat, lon), 0, 0, 0, extractor::TurnInstruction::HeadOn, - necessary, false, 0); + return SegmentInformation(util::FixedPointCoordinate(lat, lon), 0, 0, 0, + extractor::TurnInstruction::HeadOn, necessary, false, 0); } BOOST_AUTO_TEST_CASE(all_necessary_test)