Skip to content

Commit

Permalink
Revert "remove implicitly defined inline keywords from header-impleme…
Browse files Browse the repository at this point in the history
…nted functions in Util/ headers"

This reverts commit dc35e97.
  • Loading branch information
DennisOSRM committed Nov 17, 2014
1 parent 9b50127 commit e938bd3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Server/Http/CompressionType.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ enum CompressionType
gzipRFC1952,
deflateRFC1951 };

} // namespace http
}

#endif // COMPRESSION_TYPE_H
10 changes: 5 additions & 5 deletions Util/BoostFileSystemFix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> & values,
// boost::filesystem::path *,
Expand All @@ -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 &current_path = boost::filesystem::current_path())
{
Expand Down Expand Up @@ -115,15 +115,15 @@ 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);

return path(buffer);
}

path unique_path(const path &) { return temp_directory_path(); }
inline path unique_path(const path &) { return temp_directory_path(); }

#endif
}
Expand All @@ -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))
{
Expand Down
4 changes: 0 additions & 4 deletions Util/DataStoreOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string>

// 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");
Expand Down
2 changes: 1 addition & 1 deletion Util/IniFileUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string>

// 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<char>(config_stream)),
Expand Down
4 changes: 2 additions & 2 deletions Util/LuaUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {
template <typename T> void LUA_print(T output) { std::cout << "[LUA] " << output << std::endl; }

// Check if the lua function <name> 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];
Expand All @@ -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();
Expand Down
16 changes: 8 additions & 8 deletions Util/ProgramOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
10 changes: 5 additions & 5 deletions Util/StringUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <int length, int precision> static char *printInt(char *buffer, int value)
template <int length, int precision> static inline char *printInt(char *buffer, int value)
{
bool minus = true;
if (value > 0)
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -120,7 +120,7 @@ static std::string originals[] = {"&", "\"", "<", ">", "'", "[", "]", "\\"};
static std::string entities[] = {
"&amp;", "&quot;", "&lt;", "&gt;", "&#39;", "&91;", "&93;", " &#92;"};

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);
Expand All @@ -144,15 +144,15 @@ 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)
{
return boost::starts_with(input, prefix);
}

std::string GetRandomString()
inline std::string GetRandomString()
{
std::string s;
s.resize(128);
Expand Down
4 changes: 2 additions & 2 deletions Util/container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ template <typename T> void sort_unique_resize(std::vector<T> &vector)
vector.resize(number_of_unique_elements);
}

// template <typename T> void sort_unique_resize_shrink_vector(std::vector<T> &vector)
// template <typename T> inline void sort_unique_resize_shrink_vector(std::vector<T> &vector)
// {
// sort_unique_resize(vector);
// vector.shrink_to_fit();
// }

// template <typename T> void remove_consecutive_duplicates_from_vector(std::vector<T> &vector)
// template <typename T> inline void remove_consecutive_duplicates_from_vector(std::vector<T> &vector)
// {
// const auto number_of_unique_elements = std::unique(vector.begin(), vector.end()) - vector.begin();
// vector.resize(number_of_unique_elements);
Expand Down

0 comments on commit e938bd3

Please sign in to comment.