Code review changes: stylistic changes, and removed redundant call to set locale.

This commit is contained in:
Christopher Gilbert 2016-08-30 16:13:21 +01:00
parent 1b9147d7db
commit a91bca7937
2 changed files with 8 additions and 6 deletions

View File

@ -53,10 +53,11 @@ void version()
exit(0); exit(0);
} }
void setEnv() { void setEnv()
std::setlocale(LC_ALL, "C"); {
#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) #if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if (!std::setlocale(LC_ALL, "")) { if (!std::setlocale(LC_ALL, ""))
{
setenv("LC_ALL", "C", 1); setenv("LC_ALL", "C", 1);
} }
#endif #endif

View File

@ -27,10 +27,11 @@
using namespace std; using namespace std;
void setEnv() { void setEnv()
std::setlocale(LC_ALL, "C"); {
#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) #if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if (!std::setlocale(LC_ALL, "")) { if (!std::setlocale(LC_ALL, ""))
{
setenv("LC_ALL", "C", 1); setenv("LC_ALL", "C", 1);
} }
#endif #endif