From ae0b3149badf369eb2b1f10aba830eef8b4af9b4 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 23 Feb 2017 16:49:49 -0500 Subject: DRTVWR-418: Fix a round of compile errors surfaced by -std=c++11. These are mostly things that were in fact erroneous, but accepted by older compilers. This changeset has not yet been built with Visual Studio 2013 or Linux gcc, even with -std=c++11. This changeset has not been built *without* -std=c++11. It should be used in conjunction with a corresponding change to LL_BUILD_DARWIN_BASE_SWITCHES in viewer-build-variables/variables. This is a work in progress. We do not assert that this changeset completes the work needed to turn on -std=c++11, even on the Mac. --- indra/newview/llpresetsmanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llpresetsmanager.cpp') diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index f40b3e0295..214d221716 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -165,8 +165,7 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n } else if(PRESETS_CAMERA == subdirectory) { - name_list = boost::assign::list_of - ("Placeholder"); + name_list = {"Placeholder"}; } else { -- cgit v1.2.3 From ccc42830ee51e4721e6fb9f09ca6953672de7f53 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 8 May 2017 10:05:15 -0400 Subject: DRTVWR-418: Fix vector assignment for C++03. For the time being we're still compiling for production with C++03. Although assigning an initializer list to a vector is valid C++11, in C++03 mode clang rejects it. --- indra/newview/llpresetsmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpresetsmanager.cpp') diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 214d221716..76d721ecdc 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -165,7 +165,8 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n } else if(PRESETS_CAMERA == subdirectory) { - name_list = {"Placeholder"}; + name_list.clear(); + name_list.push_back("Placeholder"); } else { -- cgit v1.2.3 From 5002bf5660f41685fc0549880994f4b35440d535 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 20 Dec 2017 22:51:26 -0500 Subject: MAINT-8087: Use env vars from VMP for AppData\Roaming and Local. On Windows, when logged in with a non-ASCII username, every one of the three documented APIs -- SHGetSpecialFolderPath(), SHGetFolderPath() and SHGetKnownFolderPath() -- fails to retrieve any pathname at all. We cannot account for the fact that the oldest of these continues to work with the release viewer and within a Python script (though not, curiously, from a Python interactive session). With a non-ASCII username, they consistently fail when called from an Alex Ivy viewer build: "The filename, directory name, or volume label syntax is incorrect." Empirically, with a non-ASCII username, the preset APPDATA and LOCALAPPDATA environment variables are also useless, e.g. c:\Users\??????\AppData\Roaming where those are, yup, actual question marks. Empirically, the VMP is able to successfully call SHGetFolderPath() to retrieve both AppData\Roaming and AppData\Local. Therefore, we make the VMP set the APPDATA and LOCALAPPDATA environment variables to the UTF-8 encoded correct pathnames. Instead of calling SHGetSomethingFolderPath() at all, make LLDir_Win32 retrieve those environment variables. Make LLFile::mkdir() treat "directory already exists" as a success case. Every single call fell into one of two categories: either it didn't check success at all, or it tested specially to exempt errno == EEXIST. Migrate that test into mkdir(); eliminate it from call sites. Make LLDir::append() and add() convenience functions accept variadic arguments. Replace add(add()...) constructs, as well as clumsy concatenations of directory names and getDirDelimiter(), with simple variadic add() calls. --- indra/newview/llpresetsmanager.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpresetsmanager.cpp') diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 76d721ecdc..96818d5a21 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -78,16 +78,10 @@ std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory) std::string presets_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR); std::string full_path; - if (!gDirUtilp->fileExists(presets_path)) - { - LLFile::mkdir(presets_path); - } + LLFile::mkdir(presets_path); full_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, subdirectory); - if (!gDirUtilp->fileExists(full_path)) - { - LLFile::mkdir(full_path); - } + LLFile::mkdir(full_path); return full_path; } -- cgit v1.2.3