diff --git a/routing_algorithms/map_matching.hpp b/routing_algorithms/map_matching.hpp index 4246539ef..89c4e357c 100644 --- a/routing_algorithms/map_matching.hpp +++ b/routing_algorithms/map_matching.hpp @@ -272,7 +272,7 @@ class MapMatching final : public BasicRoutingInterface= sub_matching_begin && model.breakage[parent_timestamp_index]) { - parent_timestamp_index--; + --parent_timestamp_index; } // matchings that only consist of one candidate are invalid diff --git a/server/api_grammar.hpp b/server/api_grammar.hpp index 5c7dcde45..a629cfbf7 100644 --- a/server/api_grammar.hpp +++ b/server/api_grammar.hpp @@ -65,12 +65,6 @@ template struct APIGrammar : qi::grammar> qi::lit("t") >> '=' >> qi::uint_[boost::bind(&HandlerT::addTimestamp, handler, ::_1)]; - matching_beta = (-qi::lit('&')) >> qi::lit("matching_beta") >> '=' >> - qi::short_[boost::bind(&HandlerT::setMatchingBeta, handler, ::_1)]; - gps_precision = (-qi::lit('&')) >> qi::lit("gps_precision") >> '=' >> - qi::short_[boost::bind(&HandlerT::setGPSPrecision, handler, ::_1)]; - classify = (-qi::lit('&')) >> qi::lit("classify") >> '=' >> - qi::bool_[boost::bind(&HandlerT::setClassify, handler, ::_1)]; u = (-qi::lit('&')) >> qi::lit("u") >> '=' >> qi::bool_[boost::bind(&HandlerT::setUTurn, handler, ::_1)]; uturns = (-qi::lit('&')) >> qi::lit("uturns") >> '=' >> @@ -83,6 +77,12 @@ template struct APIGrammar : qi::grammar> qi::lit("num_results") >> '=' >> qi::short_[boost::bind(&HandlerT::setNumberOfResults, handler, ::_1)]; + matching_beta = (-qi::lit('&')) >> qi::lit("matching_beta") >> '=' >> + qi::short_[boost::bind(&HandlerT::setMatchingBeta, handler, ::_1)]; + gps_precision = (-qi::lit('&')) >> qi::lit("gps_precision") >> '=' >> + qi::short_[boost::bind(&HandlerT::setGPSPrecision, handler, ::_1)]; + classify = (-qi::lit('&')) >> qi::lit("classify") >> '=' >> + qi::bool_[boost::bind(&HandlerT::setClassify, handler, ::_1)]; string = +(qi::char_("a-zA-Z")); stringwithDot = +(qi::char_("a-zA-Z0-9_.-")); @@ -92,8 +92,8 @@ template struct APIGrammar : qi::grammar api_call, query; qi::rule service, zoom, output, string, jsonp, checksum, location, - hint, timestamp, matching_beta, gps_precision, classify, stringwithDot, stringwithPercent, language, instruction, geometry, cmp, alt_route, u, - uturns, old_API, num_results; + hint, timestamp, stringwithDot, stringwithPercent, language, instruction, geometry, cmp, alt_route, u, + uturns, old_API, num_results, matching_beta, gps_precision, classify; HandlerT *handler; }; diff --git a/util/json_logger.hpp b/util/json_logger.hpp index 872a926d5..03f8a171a 100644 --- a/util/json_logger.hpp +++ b/util/json_logger.hpp @@ -1,6 +1,6 @@ /* -Copyright (c) 2015, Project OSRM, Dennis Luxen, others +Copyright (c) 2015, Project OSRM contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -37,6 +37,8 @@ namespace osrm namespace json { +// Used to append additional debugging information to the JSON response in a +// thread safe manner. class Logger { using MapT = std::unordered_map; @@ -74,4 +76,4 @@ class Logger } } -#endif /* SIMPLE_LOGGER_HPP */ +#endif /* JSON_LOGGER_HPP */ diff --git a/util/json_util.hpp b/util/json_util.hpp index 461148ea3..bfb8a8bc4 100644 --- a/util/json_util.hpp +++ b/util/json_util.hpp @@ -30,8 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include #include +#include namespace osrm { @@ -53,18 +53,10 @@ template T clamp_float(T d) return d; } -void append_to_array(osrm::json::Array &a) {} -template -void append_to_array(osrm::json::Array &a, T value, Args... args) -{ - a.values.emplace_back(value); - append_to_array(a, args...); -} - template osrm::json::Array make_array(Args... args) { osrm::json::Array a; - append_to_array(a, args...); + append_to_container(a.values, args...); return a; }