diff --git a/Include/osrm/ServerConfig.h b/Include/osrm/ServerConfig.h index a3ffb11e2..3c48f3c56 100644 --- a/Include/osrm/ServerConfig.h +++ b/Include/osrm/ServerConfig.h @@ -1,6 +1,6 @@ /* -Copyright (c) 2014, Project OSRM, Dennis Luxen, others +Copyright (c) 2015, Project OSRM, Dennis Luxen, others All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -33,19 +33,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. struct ServerConfig { ServerConfig() - : use_shared_memory(false) - , max_locations_distance_table(100) + : max_locations_distance_table(100) + , use_shared_memory(false) {} - ServerConfig(const ServerPaths paths, const bool flag, const int max) + ServerConfig(const ServerPaths &paths, const bool flag, const int max) : server_paths(paths) - , use_shared_memory(flag) , max_locations_distance_table(max) + , use_shared_memory(flag) {} ServerPaths server_paths; - bool use_shared_memory; int max_locations_distance_table; + bool use_shared_memory; }; #endif // SERVER_CONFIG_H diff --git a/Library/OSRM_impl.cpp b/Library/OSRM_impl.cpp index 8604878ae..6b3a2e11f 100644 --- a/Library/OSRM_impl.cpp +++ b/Library/OSRM_impl.cpp @@ -57,7 +57,7 @@ namespace boost { namespace interprocess { class named_mutex; } } #include #include -OSRM_impl::OSRM_impl(ServerConfig serverConfig) +OSRM_impl::OSRM_impl(ServerConfig &serverConfig) { if (serverConfig.use_shared_memory) { diff --git a/Library/OSRM_impl.h b/Library/OSRM_impl.h index bf28c8bf9..94aa123a9 100644 --- a/Library/OSRM_impl.h +++ b/Library/OSRM_impl.h @@ -49,7 +49,7 @@ class OSRM_impl using PluginMap = std::unordered_map; public: - OSRM_impl(ServerConfig serverConfig); + OSRM_impl(ServerConfig &serverConfig); OSRM_impl(const OSRM_impl &) = delete; virtual ~OSRM_impl(); void RunQuery(RouteParameters &route_parameters, http::Reply &reply); diff --git a/Util/ProgramOptions.h b/Util/ProgramOptions.h index 1f9a2404b..ae50cd97f 100644 --- a/Util/ProgramOptions.h +++ b/Util/ProgramOptions.h @@ -278,7 +278,7 @@ inline unsigned GenerateServerProgramOptions(const int argc, } if (1 > max_locations_distance_table) { - throw OSRMException("Max location for distance table must be a positive number"); + throw osrm::exception("Max location for distance table must be a positive number"); } SimpleLogger().Write() << visible_options;