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/llappdelegate-objc.mm | 2 +- indra/newview/llappviewermacosx.cpp | 3 ++- indra/newview/llpanelexperiencelisteditor.cpp | 9 ++++++++- indra/newview/llpresetsmanager.cpp | 3 +-- indra/newview/llviewerstats.cpp | 3 ++- 5 files changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 8188c6c3f9..aebae4c434 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -97,7 +97,7 @@ callWindowUnhide(); } -- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender { // run one frame to assess state if (!pumpMainLoop()) diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index bb3bcf2886..d472f8926b 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -302,7 +302,8 @@ void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze) std::string appname = gDirUtilp->getExecutableFilename(); std::string str[] = { "-pid", pid_str.str(), "-dumpdir", logdir, "-procname", appname.c_str() }; std::vector< std::string > args( str, str + ( sizeof ( str ) / sizeof ( std::string ) ) ); - LL_WARNS() << "about to launch mac-crash-logger" << pid_str << " " << logdir << " " << appname << LL_ENDL; + LL_WARNS() << "about to launch mac-crash-logger" << pid_str.str() + << " " << logdir << " " << appname << LL_ENDL; launchApplication(&command_str, &args); } diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 32ec4930ab..0fdb9a57f3 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -39,6 +39,8 @@ #include "llagent.h" #include "lltextbox.h" #include "lltrans.h" +#include "llsdutil.h" +#include static LLPanelInjector t_panel_experience_list_editor("panel_experience_list_editor"); @@ -94,7 +96,12 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids ) { mExperienceIds.clear(); - mExperienceIds.insert(experience_ids.beginArray(), experience_ids.endArray()); + BOOST_FOREACH(LLSD uuid, llsd::inArray(experience_ids)) + { + // Using insert(range) doesn't work here because the conversion from + // LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry. + mExperienceIds.insert(uuid.asUUID()); + } onItems(); } 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 { diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index f52c82dab7..e918c7352c 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -307,7 +307,8 @@ U32Bytes gTotalWorldData, U32 gSimPingCount = 0; U32Bits gObjectData; F32Milliseconds gAvgSimPing(0.f); -U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; +// rely on default initialization +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY]; extern U32 gVisCompared; extern U32 gVisTested; -- 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') 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