diff --git a/RoutingAlgorithms/AlternativePathRouting.h b/RoutingAlgorithms/AlternativePathRouting.h index 1b7e1465b..14f0e3701 100644 --- a/RoutingAlgorithms/AlternativePathRouting.h +++ b/RoutingAlgorithms/AlternativePathRouting.h @@ -271,8 +271,8 @@ template class AlternativeRouting : private BasicRoutingInte int length_of_via_path = 0, sharing_of_via_path = 0; ComputeLengthAndSharingOfViaPath( node, &length_of_via_path, &sharing_of_via_path, packed_shortest_path); - const int maximum_allowed_sharing = - upper_bound_to_shortest_path_distance * VIAPATH_GAMMA; + const int maximum_allowed_sharing = static_cast( + upper_bound_to_shortest_path_distance * VIAPATH_GAMMA); if (sharing_of_via_path <= maximum_allowed_sharing && length_of_via_path <= upper_bound_to_shortest_path_distance * (1 + VIAPATH_EPSILON)) { @@ -774,11 +774,12 @@ template class AlternativeRouting : private BasicRoutingInte int t_test_path_length = unpacked_until_distance; unpacked_until_distance = 0; // Traverse path s-->v - for (unsigned i = 0, packed_path_length = packed_v_t_path.size() - 1; + BOOST_ASSERT(!packed_v_t_path.empty()); + for (unsigned i = 0, packed_path_length = static_cast(packed_v_t_path.size() - 1); (i < packed_path_length) && unpack_stack.empty(); ++i) { - EdgeID edgeID = + const EdgeID edgeID = facade->FindEdgeInEitherDirection(packed_v_t_path[i], packed_v_t_path[i + 1]); int length_of_current_edge = facade->GetEdgeData(edgeID).distance; if (length_of_current_edge + unpacked_until_distance >= T_threshold) diff --git a/Server/RequestHandler.cpp b/Server/RequestHandler.cpp index 6c9541f82..37c2544a5 100644 --- a/Server/RequestHandler.cpp +++ b/Server/RequestHandler.cpp @@ -87,7 +87,7 @@ void RequestHandler::handle_request(const http::Request &req, http::Reply &reply { reply = http::Reply::StockReply(http::Reply::badRequest); reply.content.clear(); - const int position = std::distance(request.begin(), iter); + const unsigned position = static_cast(std::distance(request.begin(), iter)); JSON::Object json_result; json_result.values["status"] = 400; std::string message = "Query string malformed close to position "; @@ -112,7 +112,7 @@ void RequestHandler::handle_request(const http::Request &req, http::Reply &reply } // set headers - reply.headers.emplace_back("Content-Length", UintToString(reply.content.size())); + reply.headers.emplace_back("Content-Length", UintToString(static_cast(reply.content.size()))); if ("gpx" == route_parameters.output_format) { // gpx file reply.headers.emplace_back("Content-Type", "application/gpx+xml; charset=UTF-8");