diff --git a/Server/Http/CompressionType.h b/Server/Http/CompressionType.h index 74d0b629b..3836cd749 100644 --- a/Server/Http/CompressionType.h +++ b/Server/Http/CompressionType.h @@ -36,6 +36,6 @@ enum CompressionType gzipRFC1952, deflateRFC1951 }; -} // namespace http +} #endif // COMPRESSION_TYPE_H diff --git a/Util/BoostFileSystemFix.h b/Util/BoostFileSystemFix.h index d7049cc2e..06f6fcc38 100644 --- a/Util/BoostFileSystemFix.h +++ b/Util/BoostFileSystemFix.h @@ -50,7 +50,7 @@ namespace filesystem // exists. The validate() function must be defined in the same namespace // as the target type, (boost::filesystem::path in this case), otherwise // it is not called -// void validate( +// inline void validate( // boost::any & v, // const std::vector & values, // boost::filesystem::path *, @@ -68,7 +68,7 @@ namespace filesystem // adapted from: // http://stackoverflow.com/questions/1746136/how-do-i-normalize-a-pathname-using-boostfilesystem -boost::filesystem::path +inline boost::filesystem::path portable_canonical(const boost::filesystem::path &relative_path, const boost::filesystem::path ¤t_path = boost::filesystem::current_path()) { @@ -115,7 +115,7 @@ portable_canonical(const boost::filesystem::path &relative_path, #if BOOST_FILESYSTEM_VERSION < 3 -path temp_directory_path() +inline path temp_directory_path() { char *buffer; buffer = tmpnam(nullptr); @@ -123,7 +123,7 @@ path temp_directory_path() return path(buffer); } -path unique_path(const path &) { return temp_directory_path(); } +inline path unique_path(const path &) { return temp_directory_path(); } #endif } @@ -133,7 +133,7 @@ path unique_path(const path &) { return temp_directory_path(); } #define BOOST_FILESYSTEM_VERSION 3 #endif -void AssertPathExists(const boost::filesystem::path &path) +inline void AssertPathExists(const boost::filesystem::path &path) { if (!boost::filesystem::is_regular_file(path)) { diff --git a/Util/DataStoreOptions.h b/Util/DataStoreOptions.h index a591da46b..f67b12d72 100644 --- a/Util/DataStoreOptions.h +++ b/Util/DataStoreOptions.h @@ -43,11 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include // generate boost::program_options object for the routing part -<<<<<<< HEAD bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths) -======= -bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths, bool & springclean) ->>>>>>> remove implicitly defined inline keywords from header-implemented functions in Util/ headers { // declare a group of options that will be allowed only on command line boost::program_options::options_description generic_options("Options"); diff --git a/Util/IniFileUtil.h b/Util/IniFileUtil.h index 6e843c8d1..ea1d7a13b 100644 --- a/Util/IniFileUtil.h +++ b/Util/IniFileUtil.h @@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include // support old capitalized option names by down-casing them with a regex replace -std::string ReadIniFileAndLowerContents(const boost::filesystem::path &path) +inline std::string ReadIniFileAndLowerContents(const boost::filesystem::path &path) { boost::filesystem::fstream config_stream(path); std::string ini_file_content((std::istreambuf_iterator(config_stream)), diff --git a/Util/LuaUtil.h b/Util/LuaUtil.h index d385c39b5..5c502c956 100644 --- a/Util/LuaUtil.h +++ b/Util/LuaUtil.h @@ -43,7 +43,7 @@ extern "C" { template void LUA_print(T output) { std::cout << "[LUA] " << output << std::endl; } // Check if the lua function is defined -bool lua_function_exists(lua_State *lua_state, const char *name) +inline bool lua_function_exists(lua_State *lua_state, const char *name) { luabind::object globals_table = luabind::globals(lua_state); luabind::object lua_function = globals_table[name]; @@ -53,7 +53,7 @@ bool lua_function_exists(lua_State *lua_state, const char *name) // Add the folder contain the script to the lua load path, so script can easily require() other lua // scripts inside that folder, or subfolders. // See http://lua-users.org/wiki/PackagePath for details on the package.path syntax. -void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_name) +inline void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_name) { const boost::filesystem::path profile_path(file_name); std::string folder = profile_path.parent_path().string(); diff --git a/Util/ProgramOptions.h b/Util/ProgramOptions.h index 2e0ec4964..bde9766a6 100644 --- a/Util/ProgramOptions.h +++ b/Util/ProgramOptions.h @@ -144,14 +144,14 @@ inline void populate_base_path(ServerPaths &server_paths) } // generate boost::program_options object for the routing part -unsigned GenerateServerProgramOptions(const int argc, - const char *argv[], - ServerPaths &paths, - std::string &ip_address, - int &ip_port, - int &requested_num_threads, - bool &use_shared_memory, - bool &trial) +inline unsigned GenerateServerProgramOptions(const int argc, + const char *argv[], + ServerPaths &paths, + std::string &ip_address, + int &ip_port, + int &requested_num_threads, + bool &use_shared_memory, + bool &trial) { // declare a group of options that will be allowed only on command line boost::program_options::options_description generic_options("Options"); diff --git a/Util/StringUtil.h b/Util/StringUtil.h index f0b2f018e..3c9375ca7 100644 --- a/Util/StringUtil.h +++ b/Util/StringUtil.h @@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // precision: position after decimal point // length: maximum number of digits including comma and decimals // work with negative values to prevent overflowing when taking -value -template static char *printInt(char *buffer, int value) +template static inline char *printInt(char *buffer, int value) { bool minus = true; if (value > 0) @@ -76,7 +76,7 @@ inline void replaceAll(std::string &s, const std::string &sub, const std::string boost::replace_all(s, sub, other); } -std::string EscapeJSONString(const std::string &input) +inline std::string EscapeJSONString(const std::string &input) { std::string output; output.reserve(input.size()); @@ -120,7 +120,7 @@ static std::string originals[] = {"&", "\"", "<", ">", "'", "[", "]", "\\"}; static std::string entities[] = { "&", """, "<", ">", "'", "&91;", "&93;", " \"}; -std::size_t URIDecode(const std::string &input, std::string &output) +inline std::size_t URIDecode(const std::string &input, std::string &output) { auto src_iter = input.begin(); output.resize(input.size() + 1); @@ -144,7 +144,7 @@ std::size_t URIDecode(const std::string &input, std::string &output) return decoded_length; } -std::size_t URIDecodeInPlace(std::string &URI) { return URIDecode(URI, URI); } +inline std::size_t URIDecodeInPlace(std::string &URI) { return URIDecode(URI, URI); } // TODO: remove after switch to libosmium inline bool StringStartsWith(const std::string &input, const std::string &prefix) @@ -152,7 +152,7 @@ inline bool StringStartsWith(const std::string &input, const std::string &prefix return boost::starts_with(input, prefix); } -std::string GetRandomString() +inline std::string GetRandomString() { std::string s; s.resize(128); diff --git a/Util/container.hpp b/Util/container.hpp index 2ab3a6872..343ebe9ba 100644 --- a/Util/container.hpp +++ b/Util/container.hpp @@ -41,13 +41,13 @@ template void sort_unique_resize(std::vector &vector) vector.resize(number_of_unique_elements); } -// template void sort_unique_resize_shrink_vector(std::vector &vector) +// template inline void sort_unique_resize_shrink_vector(std::vector &vector) // { // sort_unique_resize(vector); // vector.shrink_to_fit(); // } -// template void remove_consecutive_duplicates_from_vector(std::vector &vector) +// template inline void remove_consecutive_duplicates_from_vector(std::vector &vector) // { // const auto number_of_unique_elements = std::unique(vector.begin(), vector.end()) - vector.begin(); // vector.resize(number_of_unique_elements);