Mercurial > irccd
diff common/path.cpp @ 23:03068f5ed79d
Misc: various style issues, #419
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 14 Feb 2016 16:15:48 +0100 |
parents | 1158cffe5a5e |
children |
line wrap: on
line diff
--- a/common/path.cpp Fri Feb 12 21:02:28 2016 +0100 +++ b/common/path.cpp Sun Feb 14 16:15:48 2016 +0100 @@ -91,7 +91,7 @@ result.resize(size); if (!(size = GetModuleFileNameA(nullptr, &result[0], size))) - throw std::runtime_error{"GetModuleFileName error"}; + throw std::runtime_error("GetModuleFileName error"); result.resize(size); @@ -109,7 +109,7 @@ auto size = readlink("/proc/self/exe", &result[0], 2048); if (size < 0) - throw std::invalid_argument{std::strerror(errno)}; + throw std::invalid_argument(std::strerror(errno)); result.resize(size); @@ -127,7 +127,7 @@ result.resize(size); if (sysctl(mib.data(), 4, &result[0], &size, nullptr, 0) < 0) - throw std::runtime_error{std::strerror(errno)}; + throw std::runtime_error(std::strerror(errno)); result.resize(size); @@ -144,7 +144,7 @@ result.resize(size); if ((size = proc_pidpath(getpid(), &result[0], size)) == 0) - throw std::runtime_error{std::strerror(errno)}; + throw std::runtime_error(std::strerror(errno)); result.resize(size); @@ -381,9 +381,9 @@ } // !namespace #if defined(IRCCD_SYSTEM_WINDOWS) -const char Separator{';'}; +const char Separator(';'); #else -const char Separator{':'}; +const char Separator(':'); #endif void setApplicationPath(const std::string &argv0) @@ -424,9 +424,8 @@ } /* Not found in PATH? add dummy value */ - if (base.empty()) { + if (base.empty()) base = std::string(".") + fs::Separator + WITH_BINDIR + fs::Separator + "dummy"; - } } }