From 3c2b18cf20452a01b39a8509950e64fd04257015 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Thu, 9 Jul 2015 15:01:44 +0300 Subject: [PATCH] clang-format --- indexer/indexer_tests/test_mwm_set.hpp | 2 -- indexer/mwm_set.hpp | 2 +- map/framework.cpp | 3 +-- .../pedestrian_routing_benchmarks.cpp | 6 ++++-- routing/cross_mwm_road_graph.cpp | 10 +++++----- routing/osrm_router.cpp | 3 ++- routing/road_graph_router.cpp | 19 +++++++++---------- routing/road_graph_router.hpp | 11 +++++------ routing/routing_mapping.cpp | 4 ++-- routing/routing_mapping.h | 5 ++--- 10 files changed, 31 insertions(+), 34 deletions(-) diff --git a/indexer/indexer_tests/test_mwm_set.hpp b/indexer/indexer_tests/test_mwm_set.hpp index 436f51802f..5ff84960c6 100644 --- a/indexer/indexer_tests/test_mwm_set.hpp +++ b/indexer/indexer_tests/test_mwm_set.hpp @@ -10,10 +10,8 @@ using platform::CountryFile; using platform::LocalCountryFile; - namespace tests { - class MwmValue : public MwmSet::MwmValueBase { }; diff --git a/indexer/mwm_set.hpp b/indexer/mwm_set.hpp index 7f28096c09..a8ee7137ef 100644 --- a/indexer/mwm_set.hpp +++ b/indexer/mwm_set.hpp @@ -64,7 +64,7 @@ public: MwmTypeT GetType() const; /// Returns the lock counter value for test needs. - uint8_t GetLockCount() {return m_numRefs;} + uint8_t GetLockCount() { return m_numRefs; } private: inline void SetStatus(Status status) { m_status = status; } diff --git a/map/framework.cpp b/map/framework.cpp index d625ea510b..0d1b67dbca 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2177,8 +2177,7 @@ void Framework::SetRouter(RouterType type) } else { - router.reset(new OsrmRouter(&m_model.GetIndex(), countryFileGetter, - routingVisualizerFn)); + router.reset(new OsrmRouter(&m_model.GetIndex(), countryFileGetter, routingVisualizerFn)); fetcher.reset(new OnlineAbsentCountriesFetcher(countryFileGetter, localFileGetter)); } diff --git a/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp b/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp index 98d5730fec..3673c42069 100644 --- a/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp +++ b/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp @@ -58,7 +58,8 @@ private: shared_ptr const m_model; }; -unique_ptr CreatePedestrianAStarTestRouter(Index & index, routing::TMwmFileByPointFn const & countryFileFn) +unique_ptr CreatePedestrianAStarTestRouter( + Index & index, routing::TMwmFileByPointFn const & countryFileFn) { unique_ptr vehicleModelFactory(new SimplifiedPedestrianModelFactory()); @@ -67,7 +68,8 @@ unique_ptr CreatePedestrianAStarTestRouter(Index & index, rout return router; } -unique_ptr CreatePedestrianAStarBidirectionalTestRouter(Index & index, routing::TMwmFileByPointFn const & countryFileFn) +unique_ptr CreatePedestrianAStarBidirectionalTestRouter( + Index & index, routing::TMwmFileByPointFn const & countryFileFn) { unique_ptr vehicleModelFactory(new SimplifiedPedestrianModelFactory()); unique_ptr algorithm(new routing::AStarBidirectionalRoutingAlgorithm(nullptr)); diff --git a/routing/cross_mwm_road_graph.cpp b/routing/cross_mwm_road_graph.cpp index f28ce8a1c4..036820a55b 100644 --- a/routing/cross_mwm_road_graph.cpp +++ b/routing/cross_mwm_road_graph.cpp @@ -136,11 +136,11 @@ BorderCross CrossMwmGraph::FindNextMwmNode(OutgoingCrossNode const & startNode, if (ms::DistanceOnEarth(startPoint.y, startPoint.x, targetPoint.y, targetPoint.x) < kMwmCrossingNodeEqualityRadiusMeters) { - BorderCross const cross(CrossNode(startNode.m_nodeId, - currentMapping->GetCountryFile().GetNameWithoutExt(), - MercatorBounds::FromLatLon(targetPoint.y, targetPoint.x)), - CrossNode(i->m_nodeId, nextMwm, - MercatorBounds::FromLatLon(targetPoint.y, targetPoint.x))); + BorderCross const cross( + CrossNode(startNode.m_nodeId, currentMapping->GetCountryFile().GetNameWithoutExt(), + MercatorBounds::FromLatLon(targetPoint.y, targetPoint.x)), + CrossNode(i->m_nodeId, nextMwm, + MercatorBounds::FromLatLon(targetPoint.y, targetPoint.x))); m_cachedNextNodes.insert(make_pair(startPoint, cross)); return cross; } diff --git a/routing/osrm_router.cpp b/routing/osrm_router.cpp index b1814540cd..30809c2d4d 100644 --- a/routing/osrm_router.cpp +++ b/routing/osrm_router.cpp @@ -537,7 +537,8 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, startMapping->LoadCrossContext(); auto out_iterators = startMapping->m_crossContext.GetOutgoingIterators(); for (auto i = out_iterators.first; i != out_iterators.second; ++i) - if (startMapping->m_crossContext.GetOutgoingMwmName(*i) == targetMapping->GetCountryFile().GetNameWithoutExt()) + if (startMapping->m_crossContext.GetOutgoingMwmName(*i) == + targetMapping->GetCountryFile().GetNameWithoutExt()) { route.AddAbsentCountry(targetMapping->GetCountryFile().GetNameWithoutExt()); return targetMapping->GetError(); diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index 8b4ee987a6..d64d118bea 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -55,16 +55,15 @@ string GetCountryForMwmFile(string const & mwmName) RoadGraphRouter::~RoadGraphRouter() {} -RoadGraphRouter::RoadGraphRouter(string const & name, - Index & index, +RoadGraphRouter::RoadGraphRouter(string const & name, Index & index, unique_ptr && vehicleModelFactory, unique_ptr && algorithm, TMwmFileByPointFn const & countryFileFn) - : m_name(name) - , m_index(index) - , m_vehicleModelFactory(move(vehicleModelFactory)) - , m_algorithm(move(algorithm)) - , m_countryFileFn(countryFileFn) + : m_name(name), + m_index(index), + m_vehicleModelFactory(move(vehicleModelFactory)), + m_algorithm(move(algorithm)), + m_countryFileFn(countryFileFn) { } @@ -159,9 +158,9 @@ unique_ptr CreatePedestrianAStarRouter(Index & index, return router; } -unique_ptr CreatePedestrianAStarBidirectionalRouter(Index & index, - TMwmFileByPointFn const & countryFileFn, - TRoutingVisualizerFn const & visualizerFn) +unique_ptr CreatePedestrianAStarBidirectionalRouter( + Index & index, TMwmFileByPointFn const & countryFileFn, + TRoutingVisualizerFn const & visualizerFn) { unique_ptr vehicleModelFactory(new PedestrianModelFactory()); unique_ptr algorithm(new AStarBidirectionalRoutingAlgorithm(visualizerFn)); diff --git a/routing/road_graph_router.hpp b/routing/road_graph_router.hpp index 6ad8678925..8e4905ff13 100644 --- a/routing/road_graph_router.hpp +++ b/routing/road_graph_router.hpp @@ -24,8 +24,7 @@ typedef function TMwmFileByPointFn; class RoadGraphRouter : public IRouter { public: - RoadGraphRouter(string const & name, - Index & index, + RoadGraphRouter(string const & name, Index & index, unique_ptr && vehicleModelFactory, unique_ptr && algorithm, TMwmFileByPointFn const & countryFileFn); @@ -57,12 +56,12 @@ private: unique_ptr m_roadGraph; shared_ptr m_vehicleModel; }; - + unique_ptr CreatePedestrianAStarRouter(Index & index, TMwmFileByPointFn const & countryFileFn, TRoutingVisualizerFn const & visualizerFn); -unique_ptr CreatePedestrianAStarBidirectionalRouter(Index & index, - TMwmFileByPointFn const & countryFileFn, - TRoutingVisualizerFn const & visualizerFn); +unique_ptr CreatePedestrianAStarBidirectionalRouter( + Index & index, TMwmFileByPointFn const & countryFileFn, + TRoutingVisualizerFn const & visualizerFn); } // namespace routing diff --git a/routing/routing_mapping.cpp b/routing/routing_mapping.cpp index 115132f3a7..939936dd16 100644 --- a/routing/routing_mapping.cpp +++ b/routing/routing_mapping.cpp @@ -136,8 +136,8 @@ TRoutingMappingPtr RoutingIndexManager::GetMappingByName(string const & mapName) return mapIter->second; // Or load and check file. - TRoutingMappingPtr newMapping = make_shared(platform::CountryFile(mapName), - m_index); + TRoutingMappingPtr newMapping = + make_shared(platform::CountryFile(mapName), m_index); m_mapping.insert(make_pair(mapName, newMapping)); return newMapping; } diff --git a/routing/routing_mapping.h b/routing/routing_mapping.h index f3680972b4..212da39a4d 100644 --- a/routing/routing_mapping.h +++ b/routing/routing_mapping.h @@ -46,7 +46,7 @@ struct RoutingMapping void FreeCrossContext(); - bool IsValid() const {return m_handle.IsAlive() && m_error == IRouter::ResultCode::NoError;} + bool IsValid() const { return m_handle.IsAlive() && m_error == IRouter::ResultCode::NoError; } IRouter::ResultCode GetError() const {return m_error;} @@ -105,8 +105,7 @@ public: class RoutingIndexManager { public: - RoutingIndexManager(TCountryFileFn const & countryFileFn, - MwmSet * index) + RoutingIndexManager(TCountryFileFn const & countryFileFn, MwmSet * index) : m_countryFileFn(countryFileFn), m_index(index) { ASSERT(index, ());