diff --git a/routing_algorithms/alternative_path.hpp b/routing_algorithms/alternative_path.hpp index 327bb329f..5e56147f6 100644 --- a/routing_algorithms/alternative_path.hpp +++ b/routing_algorithms/alternative_path.hpp @@ -429,7 +429,7 @@ class AlternativeRouting final // partial unpacking, compute sharing // First partially unpack s-->v until paths deviate, note length of common path. const int64_t s_v_min_path_size = - std::min(packed_s_v_path.size(), packed_shortest_path.size()) - 1; + static_cast(std::min(packed_s_v_path.size(), packed_shortest_path.size())) - 1; for (const int64_t current_node : osrm::irange(0, s_v_min_path_size)) { if (packed_s_v_path[current_node] == packed_shortest_path[current_node] && @@ -455,7 +455,8 @@ class AlternativeRouting final } // traverse partially unpacked edge and note common prefix const int64_t packed_path_length = - std::min(partially_unpacked_via_path.size(), partially_unpacked_shortest_path.size()) - + static_cast(std::min(partially_unpacked_via_path.size(), + partially_unpacked_shortest_path.size())) - 1; for (int64_t current_node = 0; (current_node < packed_path_length) && (partially_unpacked_via_path[current_node] == @@ -471,8 +472,8 @@ class AlternativeRouting final } // Second, partially unpack v-->t in reverse order until paths deviate and note lengths - int64_t via_path_index = packed_v_t_path.size() - 1; - int64_t shortest_path_index = packed_shortest_path.size() - 1; + int64_t via_path_index = static_cast(packed_v_t_path.size()) - 1; + int64_t shortest_path_index = static_cast(packed_shortest_path.size()) - 1; for (; via_path_index > 0 && shortest_path_index > 0; --via_path_index, --shortest_path_index) { diff --git a/util/json_renderer.hpp b/util/json_renderer.hpp index cf3318059..09d7bb251 100644 --- a/util/json_renderer.hpp +++ b/util/json_renderer.hpp @@ -76,7 +76,7 @@ struct Renderer : mapbox::util::static_visitor<> void operator()(const Array &array) const { out << "["; - for (auto it = array.values.cend(), end = array.values.cend(); it != end;) + for (auto it = array.values.cbegin(), end = array.values.cend(); it != end;) { mapbox::util::apply_visitor(Renderer(out), *it); if (++it != end) diff --git a/util/routed_options.hpp b/util/routed_options.hpp index 0edb7fe6c..93320f07e 100644 --- a/util/routed_options.hpp +++ b/util/routed_options.hpp @@ -80,16 +80,7 @@ inline void populate_base_path(ServerPaths &server_paths) if (path_iterator == server_paths.end() || !boost::filesystem::is_regular_file(path_iterator->second)) { - if (path_iterator == server_paths.end()) - { - SimpleLogger().Write() << "hsgrdata unset"; - } - if (!boost::filesystem::is_regular_file(path_iterator->second)) - { - SimpleLogger().Write() << "not a regular file"; - } - - throw osrm::exception(".hsgr not found: " + path_iterator->second.string()); + throw osrm::exception(".hsgr not found"); } path_iterator = server_paths.find("nodesdata");