diff --git a/include/engine/api/tile_parameters.hpp b/include/engine/api/tile_parameters.hpp index 728beede7..b62e1036f 100644 --- a/include/engine/api/tile_parameters.hpp +++ b/include/engine/api/tile_parameters.hpp @@ -68,7 +68,7 @@ struct TileParameters final const auto valid_z = z < 20 && z >= 12; return valid_x && valid_y && valid_z; - }; + } }; } } diff --git a/include/engine/routing_algorithms/map_matching.hpp b/include/engine/routing_algorithms/map_matching.hpp index 971b4b019..7d93af3c1 100644 --- a/include/engine/routing_algorithms/map_matching.hpp +++ b/include/engine/routing_algorithms/map_matching.hpp @@ -396,7 +396,7 @@ class MapMatching final : public BasicRoutingInterfacespeed_source.speed > 0) @@ -947,10 +947,10 @@ EdgeID Contractor::LoadEdgeExpandedGraph( continue; } - auto turn_iter = - find(turn_penalty_lookup, - TurnPenaltySource{ - penaltyblock->from_id, penaltyblock->via_id, penaltyblock->to_id, {0, 0}}); + auto turn_iter = find( + turn_penalty_lookup, + TurnPenaltySource{ + {penaltyblock->from_id, penaltyblock->via_id, penaltyblock->to_id}, {0, 0}}); if (turn_iter != turn_penalty_lookup.end()) { int new_turn_weight = static_cast(turn_iter->penalty_source.penalty * 10); diff --git a/src/engine/guidance/assemble_overview.cpp b/src/engine/guidance/assemble_overview.cpp index 97d3d694c..8086ba1ee 100644 --- a/src/engine/guidance/assemble_overview.cpp +++ b/src/engine/guidance/assemble_overview.cpp @@ -1,6 +1,3 @@ -#ifndef ENGINE_GUIDANCE_ASSEMBLE_OVERVIEW_HPP -#define ENGINE_GUIDANCE_ASSEMBLE_OVERVIEW_HPP - #include "engine/douglas_peucker.hpp" #include "engine/guidance/leg_geometry.hpp" #include "util/viewport.hpp" @@ -30,7 +27,7 @@ unsigned calculateOverviewZoomLevel(const std::vector &leg_geometri for (const auto &leg_geometry : leg_geometries) { - for (const auto coord : leg_geometry.locations) + for (const auto &coord : leg_geometry.locations) { south_west.lon = std::min(south_west.lon, coord.lon); south_west.lat = std::min(south_west.lat, coord.lat); @@ -96,5 +93,3 @@ std::vector assembleOverview(const std::vector &l } // namespace guidance } // namespace engine } // namespace osrm - -#endif diff --git a/src/extractor/guidance/turn_classification.cpp b/src/extractor/guidance/turn_classification.cpp index 746672344..56ab44af3 100644 --- a/src/extractor/guidance/turn_classification.cpp +++ b/src/extractor/guidance/turn_classification.cpp @@ -32,7 +32,7 @@ classifyIntersection(Intersection intersection) DiscreteBearing last_discrete_bearing = util::guidance::BearingClass::getDiscreteBearing( std::round(intersection.back().bearing)); - for (const auto road : intersection) + for (const auto &road : intersection) { const DiscreteBearing discrete_bearing = util::guidance::BearingClass::getDiscreteBearing(std::round(road.bearing)); diff --git a/src/extractor/guidance/turn_lane_data.cpp b/src/extractor/guidance/turn_lane_data.cpp index 654dd0755..18c27e223 100644 --- a/src/extractor/guidance/turn_lane_data.cpp +++ b/src/extractor/guidance/turn_lane_data.cpp @@ -106,7 +106,7 @@ LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description // transform the map into the lane data vector LaneDataVector lane_data; lane_data.reserve(lane_map.size()); - for (const auto tag : lane_map) + for (const auto &tag : lane_map) lane_data.push_back({tag.first, tag.second.first, tag.second.second, false}); std::sort(lane_data.begin(), lane_data.end()); diff --git a/src/server/api/parameters_parser.cpp b/src/server/api/parameters_parser.cpp index 9363e4a91..a2c6767bd 100644 --- a/src/server/api/parameters_parser.cpp +++ b/src/server/api/parameters_parser.cpp @@ -55,7 +55,7 @@ boost::optional parseParameters(std::string::iterator &iter, // iterator to the failing position. Extract the position from the exception ourselves. iter = failure.first; } - catch (const boost::numeric::bad_numeric_cast &e) + catch (const boost::numeric::bad_numeric_cast &) { // this can happen if we get bad numeric values in the request, just handle // as normal parser error diff --git a/src/storage/storage.cpp b/src/storage/storage.cpp index bc7e9a6cb..17d9f681a 100644 --- a/src/storage/storage.cpp +++ b/src/storage/storage.cpp @@ -102,7 +102,7 @@ Storage::ReturnCode Storage::Run(int max_wait) } } // hard unlock in case of any exception. - catch (boost::interprocess::lock_exception &ex) + catch (boost::interprocess::lock_exception &) { barriers.current_region_mutex.unlock_upgradable(); // make sure we exit here because this is bad diff --git a/src/util/assert.cpp b/src/util/assert.cpp index 03c37adc5..6210ad9a0 100644 --- a/src/util/assert.cpp +++ b/src/util/assert.cpp @@ -6,7 +6,7 @@ namespace { // We hard-abort on assertion violations. -void assertion_failed_msg_helper( +[[noreturn]] void assertion_failed_msg_helper( char const *expr, char const *msg, char const *function, char const *file, long line) { std::cerr << "[assert] " << file << ":" << line << "\nin: " << function << ": " << expr << "\n"