From 9e2a9b55e185b92074b32d3df336920f33b29e5a Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 1 Feb 2015 17:59:23 -0500 Subject: Reduce gettext wide/narrow and string/char* conversions --- src/gettext.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/gettext.cpp') diff --git a/src/gettext.cpp b/src/gettext.cpp index 0c0e520ca..688a22570 100644 --- a/src/gettext.cpp +++ b/src/gettext.cpp @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "gettext.h" #include "util/string.h" +#include "log.h" #if USE_GETTEXT && defined(_MSC_VER) #include @@ -116,9 +117,9 @@ const char* MSVC_LocaleLookup(const char* raw_shortname) { /******************************************************************************/ #ifdef _MSC_VER -void init_gettext(const char *path,std::string configured_language,int argc, char** argv) { +void init_gettext(const char *path, const std::string &configured_language, int argc, char** argv) { #else -void init_gettext(const char *path,std::string configured_language) { +void init_gettext(const char *path, const std::string &configured_language) { #endif #if USE_GETTEXT /** first try to set user override environment **/ @@ -173,15 +174,15 @@ void init_gettext(const char *path,std::string configured_language) { } if (!CreateProcess(appname.c_str(), - (char*) ptr_parameters, - NULL, - NULL, - false, - DETACHED_PROCESS | CREATE_UNICODE_ENVIRONMENT, - NULL, - NULL, - &startupinfo, - &processinfo)) { + (char*) ptr_parameters, + NULL, + NULL, + false, + DETACHED_PROCESS | CREATE_UNICODE_ENVIRONMENT, + NULL, + NULL, + &startupinfo, + &processinfo)) { char buffer[1024]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, @@ -261,9 +262,6 @@ void init_gettext(const char *path,std::string configured_language) { setlocale(LC_NUMERIC,"C"); infostream << "Message locale is now set to: " - << setlocale(LC_ALL,0) << std::endl; + << setlocale(LC_ALL, 0) << std::endl; } - - - -- cgit v1.2.3