Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10 * Reformat using clang-format-10.0.09
This commit is contained in:
@@ -119,5 +119,5 @@ std::vector<util::Coordinate> douglasPeucker(std::vector<util::Coordinate>::cons
|
||||
|
||||
return simplified_geometry;
|
||||
}
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -27,5 +27,5 @@ bool EngineConfig::IsValid() const
|
||||
storage_config.IsValid()) &&
|
||||
limits_valid;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -39,7 +39,7 @@ unsigned calculateOverviewZoomLevel(const std::vector<LegGeometry> &leg_geometri
|
||||
|
||||
return util::viewport::getFittedZoom(south_west, north_east);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::vector<util::Coordinate> assembleOverview(const std::vector<LegGeometry> &leg_geometries,
|
||||
const bool use_simplification)
|
||||
|
||||
@@ -48,7 +48,7 @@ std::pair<short, short> getArriveBearings(const LegGeometry &leg_geometry,
|
||||
return std::make_pair<short, short>(
|
||||
std::round(util::coordinate_calculation::bearing(pre_turn_coordinate, turn_coordinate)), 0);
|
||||
}
|
||||
} // ns detail
|
||||
} // ns engine
|
||||
} // ns guidance
|
||||
} // ns detail
|
||||
} // namespace detail
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -181,9 +181,10 @@ bool isUTurn(const RouteStepIterator step_prior_to_intersection,
|
||||
const auto only_allowed_turn = (numberOfAllowedTurns(*step_leaving_intersection) == 1) &&
|
||||
noIntermediaryIntersections(*step_entering_intersection);
|
||||
|
||||
return collapsable || isLinkRoad(*step_prior_to_intersection,
|
||||
*step_entering_intersection,
|
||||
*step_leaving_intersection) ||
|
||||
return collapsable ||
|
||||
isLinkRoad(*step_prior_to_intersection,
|
||||
*step_entering_intersection,
|
||||
*step_leaving_intersection) ||
|
||||
only_allowed_turn;
|
||||
}
|
||||
|
||||
|
||||
@@ -706,8 +706,9 @@ void applyOverrides(const datafacade::BaseDataFacade &facade,
|
||||
<< " direction was "
|
||||
<< osrm::guidance::instructionModifierToString(
|
||||
step_to_update->maneuver.instruction.direction_modifier)
|
||||
<< " now " << osrm::guidance::instructionModifierToString(
|
||||
maneuver_relation.direction)
|
||||
<< " now "
|
||||
<< osrm::guidance::instructionModifierToString(
|
||||
maneuver_relation.direction)
|
||||
<< std::endl;
|
||||
step_to_update->maneuver.instruction.direction_modifier =
|
||||
maneuver_relation.direction;
|
||||
|
||||
@@ -38,29 +38,30 @@ std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps)
|
||||
|
||||
// suppresses name segments that announce already known names or announce a name that will be
|
||||
// only available for a very short time
|
||||
const auto reduce_verbosity_if_possible = [suppress, can_be_extended_to](
|
||||
RouteStepIterator ¤t_turn_itr, RouteStepIterator &previous_turn_itr) {
|
||||
if (haveSameName(*previous_turn_itr, *current_turn_itr))
|
||||
suppress(*previous_turn_itr, *current_turn_itr);
|
||||
else
|
||||
{
|
||||
// remember the location of the name change so we can advance the previous turn
|
||||
const auto location_of_name_change = current_turn_itr;
|
||||
auto distance = current_turn_itr->distance;
|
||||
// sum up all distances that can be relevant to the name change
|
||||
while (can_be_extended_to(*(current_turn_itr + 1)) &&
|
||||
distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
{
|
||||
++current_turn_itr;
|
||||
distance += current_turn_itr->distance;
|
||||
}
|
||||
|
||||
if (distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
const auto reduce_verbosity_if_possible =
|
||||
[suppress, can_be_extended_to](RouteStepIterator ¤t_turn_itr,
|
||||
RouteStepIterator &previous_turn_itr) {
|
||||
if (haveSameName(*previous_turn_itr, *current_turn_itr))
|
||||
suppress(*previous_turn_itr, *current_turn_itr);
|
||||
else
|
||||
previous_turn_itr = location_of_name_change;
|
||||
}
|
||||
};
|
||||
{
|
||||
// remember the location of the name change so we can advance the previous turn
|
||||
const auto location_of_name_change = current_turn_itr;
|
||||
auto distance = current_turn_itr->distance;
|
||||
// sum up all distances that can be relevant to the name change
|
||||
while (can_be_extended_to(*(current_turn_itr + 1)) &&
|
||||
distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
{
|
||||
++current_turn_itr;
|
||||
distance += current_turn_itr->distance;
|
||||
}
|
||||
|
||||
if (distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
suppress(*previous_turn_itr, *current_turn_itr);
|
||||
else
|
||||
previous_turn_itr = location_of_name_change;
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_ASSERT(!hasTurnType(steps.back()) && hasWaypointType(steps.back()));
|
||||
for (auto previous_turn_itr = steps.begin(), current_turn_itr = std::next(previous_turn_itr);
|
||||
|
||||
+2
-2
@@ -57,5 +57,5 @@ bool operator==(const Hint &lhs, const Hint &rhs)
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const Hint &hint) { return out << hint.ToBase64(); }
|
||||
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -207,7 +207,6 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
{
|
||||
return routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -314,6 +313,6 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -60,6 +60,6 @@ Status NearestPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -156,6 +156,6 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "guidance/turn_instruction.hpp"
|
||||
|
||||
#include "engine/plugins/plugin_base.hpp"
|
||||
#include "engine/plugins/plugin_base.hpp"
|
||||
#include "engine/plugins/tile.hpp"
|
||||
|
||||
@@ -661,7 +660,7 @@ void encodeVectorTile(const DataFacadeBase &facade,
|
||||
|
||||
tile.serialize(pbf_buffer);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
const api::TileParameters ¶meters,
|
||||
@@ -697,6 +696,6 @@ Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -204,8 +204,9 @@ Status TripPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
}
|
||||
BOOST_ASSERT(phantom_node_pairs.size() == number_of_locations);
|
||||
|
||||
if (fixed_start && fixed_end && (source_id >= parameters.coordinates.size() ||
|
||||
destination_id >= parameters.coordinates.size()))
|
||||
if (fixed_start && fixed_end &&
|
||||
(source_id >= parameters.coordinates.size() ||
|
||||
destination_id >= parameters.coordinates.size()))
|
||||
{
|
||||
return Error("InvalidValue", "Invalid source or destination value.", result);
|
||||
}
|
||||
@@ -278,6 +279,6 @@ Status TripPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -183,6 +183,6 @@ Status ViaRoutePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithm
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -75,6 +75,6 @@ std::int32_t decode_polyline_integer(std::string::const_iterator &first,
|
||||
result = ((result & 1) == 1) ? ~(result >> 1) : (result >> 1);
|
||||
return static_cast<std::int32_t>(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace detail
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -558,7 +558,7 @@ bool viaNodeCandidatePassesTTest(SearchEngineData<Algorithm> &engine_working_dat
|
||||
}
|
||||
return (upper_bound <= t_test_path_weight);
|
||||
}
|
||||
} // anon. namespace
|
||||
} // namespace
|
||||
|
||||
InternalManyRoutesResult alternativePathSearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||
const DataFacade<Algorithm> &facade,
|
||||
@@ -853,4 +853,4 @@ InternalManyRoutesResult alternativePathSearch(SearchEngineData<Algorithm> &engi
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm}
|
||||
} // namespace osrm
|
||||
|
||||
@@ -443,9 +443,8 @@ void forwardRoutingStep(const DataFacade<Algorithm> &facade,
|
||||
auto new_duration = source_duration + target_duration;
|
||||
auto new_distance = source_distance + target_distance;
|
||||
|
||||
if (new_weight >= 0 &&
|
||||
std::tie(new_weight, new_duration, new_distance) <
|
||||
std::tie(current_weight, current_duration, current_distance))
|
||||
if (new_weight >= 0 && std::tie(new_weight, new_duration, new_distance) <
|
||||
std::tie(current_weight, current_duration, current_distance))
|
||||
{
|
||||
current_weight = new_weight;
|
||||
current_duration = new_duration;
|
||||
|
||||
@@ -65,7 +65,7 @@ inline void initializeHeap<mld::Algorithm>(SearchEngineData<mld::Algorithm> &eng
|
||||
const auto border_nodes_number = facade.GetMaxBorderNodeID() + 1;
|
||||
engine_working_data.InitializeOrClearFirstThreadLocalStorage(nodes_number, border_nodes_number);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
template <typename Algorithm>
|
||||
SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
|
||||
|
||||
@@ -130,5 +130,5 @@ void SearchEngineData<MLD>::InitializeOrClearManyToManyThreadLocalStorage(
|
||||
many_to_many_heap.reset(new ManyToManyQueryHeap(number_of_nodes, number_of_boundary_nodes));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
Reference in New Issue
Block a user