Fixes various compiler diagnostics

Found with LLVM 3.9.1 and then fixed the most severe categories.
This commit is contained in:
Daniel J. Hofmann
2017-01-06 13:21:54 +01:00
committed by Daniel J. H
parent b5d5f309a3
commit 1153b78c06
12 changed files with 19 additions and 24 deletions
+5 -5
View File
@@ -906,7 +906,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
auto speed_iter =
find(segment_speed_lookup,
SegmentSpeedSource{
previous_osm_node_id, segmentblocks[i].this_osm_node_id, {0, 0}});
{previous_osm_node_id, segmentblocks[i].this_osm_node_id}, {0, 0}});
if (speed_iter != segment_speed_lookup.end())
{
if (speed_iter->speed_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<int>(turn_iter->penalty_source.penalty * 10);
+1 -6
View File
@@ -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<LegGeometry> &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<util::Coordinate> assembleOverview(const std::vector<LegGeometry> &l
} // namespace guidance
} // namespace engine
} // namespace osrm
#endif
@@ -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));
+1 -1
View File
@@ -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());
+1 -1
View File
@@ -55,7 +55,7 @@ boost::optional<ParameterT> 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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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"