diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a110c018ec0a77c59f67cd7ec152e4ce72b646ac..0835f9751e278ba16bd51d4eb2dc5cd338e412cb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,13 +11,15 @@ jobs: build: strategy: matrix: - runner: [windows-large] + runner: [windows-large, macos-12-xl] configuration: [ReleaseOS] addrsize: [64] include: - runner: windows-large configuration: ReleaseOS addrsize: 32 + - runner: macos-12-xl + developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" runs-on: ${{ matrix.runner }} env: AUTOBUILD_CONFIGURATION: ${{ matrix.configuration }} @@ -25,8 +27,10 @@ jobs: AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables AUTOBUILD_VSVER: "170" # vs2k22 + DEVELOPER_DIR: ${{ matrix.developer_dir }} LOGFAIL: debug # Show details when tests fail GIT_REF: ${{ github.head_ref || github.ref }} + LL_SKIP_REQUIRE_SYSROOT: 1 steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/autobuild.xml b/autobuild.xml index c103345458916b3163e165c50504fb8c99eba1c3..e0fa8c5d22bf599d145be2f3e45efbcb0248bd3a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2749,6 +2749,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <string>RelWithDebInfo</string> <string>-project</string> <string>Alchemy.xcodeproj</string> + <string>-parallelizeTargets</string> </array> </map> <key>configure</key> @@ -2780,6 +2781,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <string>RelWithDebInfo</string> <string>-project</string> <string>Alchemy.xcodeproj</string> + <string>-parallelizeTargets</string> </array> </map> <key>configure</key> @@ -2805,6 +2807,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <string>Release</string> <string>-project</string> <string>Alchemy.xcodeproj</string> + <string>-parallelizeTargets</string> </array> </map> <key>configure</key> @@ -2834,6 +2837,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <string>Release</string> <string>-project</string> <string>Alchemy.xcodeproj</string> + <string>-parallelizeTargets</string> </array> </map> <key>configure</key> diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 4848017d3b141481bfb5173642468d43e3ee8c76..c75c4310b292c5497588c3c2516a5bfc9174eee3 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -2,7 +2,7 @@ include_guard() -# FMODSTUDIO can be set when launching the make using the argument -DFMODSTUDIO:BOOL=ON +# FMODSTUDIO can be set when launching the make using the argument -DUSE_FMODSTUDIO:BOOL=ON # When building using proprietary binaries though (i.e. having access to LL private servers), # we always build with FMODSTUDIO. if (INSTALL_PROPRIETARY) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 71fcb4c87b88427b208abbd2d668d143f0ceb2a9..1e2794d9c2c6ed5b5d21f48ff8a2f50de5a9e6e1 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -130,6 +130,13 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}") endif() + if (DARWIN) + # test binaries always need to be signed for local development + set_target_properties(PROJECT_${project}_TEST_${name} + PROPERTIES + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") + endif () + # # Setup test targets # @@ -227,6 +234,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST if (DARWIN) SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" BUILD_WITH_INSTALL_RPATH 1 INSTALL_RPATH "@executable_path/Resources" ) diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 31d99d03b0f84b747a0b391f4612e807b4c63e89..b7e37bb25568dbeac6b01dc02d27f745eb91692b 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -80,14 +80,9 @@ struct LLContextStatus LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status); -#if ENABLE_DEBUG_MACRO -#define dumpStack(tag) \ - static const bool enable_log = debugLoggingEnabled(tag); \ - if (enable_log) \ - { \ - LLCallStack cs; \ - LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \ - } -#else -#define dumpStack(tag) -#endif +#define dumpStack(tag) \ + LL_DEBUGS(tag) << "STACK:\n" \ + << "====================\n" \ + << LLCallStack() \ + << "====================" \ + << LL_ENDL; diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index cce6c447480f933b6613fa7e621bcc4d292b4d4e..60560bcfb11ac59ac14660726dee3dc6dfd6fbda 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1615,20 +1615,5 @@ namespace LLError } } -bool debugLoggingEnabled(const std::string& tag) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_APP; - LLMutexTrylock lock(getMutex<LOG_MUTEX>(), 5); - if (!lock.isLocked()) - { - return false; - } - - SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - LLError::ELevel level = LLError::LEVEL_DEBUG; - bool res = checkLevelMap(s->mTagLevelMap, tag, level); - return res; -} - diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index ef9b2c797c4f6e1787fad7980a6d895492ac713a..fcfa569ccf193339485fd5aa97946c1734e44a21 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -508,7 +508,29 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; #define LL_VLOGS(level, ...) llvlog(level, false, ##__VA_ARGS__) #define LL_VLOGS_ONCE(level, ...) llvlog(level, true, ##__VA_ARGS__) -// Check at run-time whether logging is enabled, without generating output +/* +// Check at run-time whether logging is enabled, without generating output. +Resist the temptation to add a function like this because it incurs the +expense of locking and map-searching every time control reaches it. bool debugLoggingEnabled(const std::string& tag); +Instead of: + +if debugLoggingEnabled("SomeTag") +{ + // ... presumably expensive operation ... + LL_DEBUGS("SomeTag") << ... << LL_ENDL; +} + +Use this: + +LL_DEBUGS("SomeTag"); +// ... presumably expensive operation ... +LL_CONT << ...; +LL_ENDL; + +LL_DEBUGS("SomeTag") performs the locking and map-searching ONCE, then caches +the result in a static variable. +*/ + #endif // LL_LLERROR_H diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index 1321615805bfec449bedcd91b464962a67ce1fef..372278c51aed4c0c88f1ccc64881e98dc29a7857 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -191,75 +191,6 @@ LLSD& drill_ref( LLSD& blob, const LLSD& path); } -/***************************************************************************** -* LLSDArray -*****************************************************************************/ -/** - * Construct an LLSD::Array inline, with implicit conversion to LLSD. Usage: - * - * @code - * void somefunc(const LLSD&); - * ... - * somefunc(LLSDArray("text")(17)(3.14)); - * @endcode - * - * For completeness, LLSDArray() with no args constructs an empty array, so - * <tt>LLSDArray()("text")(17)(3.14)</tt> produces an array equivalent to the - * above. But for most purposes, LLSD() is already equivalent to an empty - * array, and if you explicitly want an empty isArray(), there's - * LLSD::emptyArray(). However, supporting a no-args LLSDArray() constructor - * follows the principle of least astonishment. - */ -class LLSDArray -{ -public: - LLSDArray(): - _data(LLSD::emptyArray()) - {} - - /** - * Need an explicit copy constructor. Consider the following: - * - * @code - * LLSD array_of_arrays(LLSDArray(LLSDArray(17)(34)) - * (LLSDArray("x")("y"))); - * @endcode - * - * The coder intends to construct [[17, 34], ["x", "y"]]. - * - * With the compiler's implicit copy constructor, s/he gets instead - * [17, 34, ["x", "y"]]. - * - * The expression LLSDArray(17)(34) constructs an LLSDArray with those two - * values. The reader assumes it should be converted to LLSD, as we always - * want with LLSDArray, before passing it to the @em outer LLSDArray - * constructor! This copy constructor makes that happen. - */ - LLSDArray(const LLSDArray& inner): - _data(LLSD::emptyArray()) - { - _data.append(inner); - } - - LLSDArray(const LLSD& value): - _data(LLSD::emptyArray()) - { - _data.append(value); - } - - LLSDArray& operator()(const LLSD& value) - { - _data.append(value); - return *this; - } - - operator LLSD() const { return _data; } - LLSD get() const { return _data; } - -private: - LLSD _data; -}; - namespace llsd { diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp index 42e82c753b3a08d0b8e754b1ca2ad4b64ffa638a..04260936707f435d51d343c0c3bea2390a108755 100644 --- a/indra/llcommon/tests/lleventdispatcher_test.cpp +++ b/indra/llcommon/tests/lleventdispatcher_test.cpp @@ -343,7 +343,7 @@ namespace tut lleventdispatcher_data(): work("test dispatcher", "op"), // map {d=double, array=[3 elements]} - required(LLSDMap("d", LLSD::Real(0))("array", LLSDArray(LLSD())(LLSD())(LLSD()))), + required(LLSDMap("d", LLSD::Real(0))("array", llsd::array(LLSD(), LLSD(), LLSD()))), // first several params are required, last couple optional partial_offset(3) { @@ -432,8 +432,8 @@ namespace tut // freena(), methodna(), cmethodna(), smethodna() all take same param list. // Same for freenb() et al. - params = LLSDMap("a", LLSDArray("b")("i")("f")("d")("cp")) - ("b", LLSDArray("s")("uuid")("date")("uri")("bin")); + params = LLSDMap("a", llsd::array("b", "i", "f", "d", "cp")) + ("b", llsd::array("s", "uuid", "date", "uri", "bin")); debug("params:\n", params, "\n" "params[\"a\"]:\n", @@ -450,12 +450,12 @@ namespace tut // LLDate values are, as long as they're different from the // LLUUID() and LLDate() default values so inspect() will report // them. - dft_array_full = LLSDMap("a", LLSDArray(true)(17)(3.14)(123456.78)("classic")) - ("b", LLSDArray("string") - (LLUUID::generateNewID()) - (LLDate::now()) - (LLURI("http://www.ietf.org/rfc/rfc3986.txt")) - (binary)); + dft_array_full = LLSDMap("a", llsd::array(true, 17, 3.14, 123456.78, "classic")) + ("b", llsd::array("string", + LLUUID::generateNewID(), + LLDate::now(), + LLURI("http://www.ietf.org/rfc/rfc3986.txt"), + binary)); debug("dft_array_full:\n", dft_array_full); // Partial defaults arrays. @@ -721,7 +721,7 @@ namespace tut { set_test_name("map-style registration with non-array params"); // Pass "param names" as scalar or as map - LLSD attempts(LLSDArray(17)(LLSDMap("pi", 3.14)("two", 2))); + LLSD attempts(llsd::array(17, LLSDMap("pi", 3.14)("two", 2))); for (LLSD ae : inArray(attempts)) { std::string threw = catch_what<std::exception>([this, &ae](){ @@ -736,7 +736,7 @@ namespace tut { set_test_name("map-style registration with badly-formed defaults"); std::string threw = catch_what<std::exception>([this](){ - work.add("freena_err", "freena", freena, LLSDArray("a")("b"), 17); + work.add("freena_err", "freena", freena, llsd::array("a", "b"), 17); }); ensure_has(threw, "must be a map or an array"); } @@ -747,8 +747,8 @@ namespace tut set_test_name("map-style registration with too many array defaults"); std::string threw = catch_what<std::exception>([this](){ work.add("freena_err", "freena", freena, - LLSDArray("a")("b"), - LLSDArray(17)(0.9)("gack")); + llsd::array("a", "b"), + llsd::array(17, 0.9, "gack")); }); ensure_has(threw, "shorter than"); } @@ -759,7 +759,7 @@ namespace tut set_test_name("map-style registration with too many map defaults"); std::string threw = catch_what<std::exception>([this](){ work.add("freena_err", "freena", freena, - LLSDArray("a")("b"), + llsd::array("a", "b"), LLSDMap("b", 17)("foo", 3.14)("bar", "sinister")); }); ensure_has(threw, "nonexistent params"); @@ -796,7 +796,7 @@ namespace tut void object::test<8>() { set_test_name("query Callables with/out required params"); - LLSD names(LLSDArray("free1")("Dmethod1")("Dcmethod1")("method1")); + LLSD names(llsd::array("free1", "Dmethod1", "Dcmethod1", "method1")); for (LLSD nm : inArray(names)) { LLSD metadata(getMetadata(nm)); @@ -819,13 +819,13 @@ namespace tut { set_test_name("query array-style functions/methods"); // Associate each registered name with expected arity. - LLSD expected(LLSDArray - (LLSDArray - (0)(LLSDArray("free0_array")("smethod0_array")("method0_array"))) - (LLSDArray - (5)(LLSDArray("freena_array")("smethodna_array")("methodna_array"))) - (LLSDArray - (5)(LLSDArray("freenb_array")("smethodnb_array")("methodnb_array")))); + LLSD expected(llsd::array + (llsd::array + (0, llsd::array("free0_array", "smethod0_array", "method0_array")), + llsd::array + (5, llsd::array("freena_array", "smethodna_array", "methodna_array")), + llsd::array + (5, llsd::array("freenb_array", "smethodnb_array", "methodnb_array")))); for (LLSD ae : inArray(expected)) { LLSD::Integer arity(ae[0].asInteger()); @@ -851,7 +851,7 @@ namespace tut set_test_name("query map-style no-params functions/methods"); // - (Free function | non-static method), map style, no params (ergo // no defaults) - LLSD names(LLSDArray("free0_map")("smethod0_map")("method0_map")); + LLSD names(llsd::array("free0_map", "smethod0_map", "method0_map")); for (LLSD nm : inArray(names)) { LLSD metadata(getMetadata(nm)); @@ -875,13 +875,13 @@ namespace tut // there should (!) be no difference beween array defaults and map // defaults. Verify, so we can ignore the distinction for all other // tests. - LLSD equivalences(LLSDArray - (LLSDArray("freena_map_adft")("freena_map_mdft")) - (LLSDArray("freenb_map_adft")("freenb_map_mdft")) - (LLSDArray("smethodna_map_adft")("smethodna_map_mdft")) - (LLSDArray("smethodnb_map_adft")("smethodnb_map_mdft")) - (LLSDArray("methodna_map_adft")("methodna_map_mdft")) - (LLSDArray("methodnb_map_adft")("methodnb_map_mdft"))); + LLSD equivalences(llsd::array + (llsd::array("freena_map_adft", "freena_map_mdft"), + llsd::array("freenb_map_adft", "freenb_map_mdft"), + llsd::array("smethodna_map_adft", "smethodna_map_mdft"), + llsd::array("smethodnb_map_adft", "smethodnb_map_mdft"), + llsd::array("methodna_map_adft", "methodna_map_mdft"), + llsd::array("methodnb_map_adft", "methodnb_map_mdft"))); for (LLSD eq : inArray(equivalences)) { LLSD adft(eq[0]); @@ -951,42 +951,42 @@ namespace tut debug("skipreq:\n", skipreq); - LLSD groups(LLSDArray // array of groups + LLSD groups(llsd::array // array of groups - (LLSDArray // group - (LLSDArray("freena_map_allreq")("smethodna_map_allreq")("methodna_map_allreq")) - (LLSDArray(allreq["a"])(LLSD()))) // required, optional + (llsd::array // group + (llsd::array("freena_map_allreq", "smethodna_map_allreq", "methodna_map_allreq"), + llsd::array(allreq["a"], LLSD())), // required, optional - (LLSDArray // group - (LLSDArray("freenb_map_allreq")("smethodnb_map_allreq")("methodnb_map_allreq")) - (LLSDArray(allreq["b"])(LLSD()))) // required, optional + llsd::array // group + (llsd::array("freenb_map_allreq", "smethodnb_map_allreq", "methodnb_map_allreq"), + llsd::array(allreq["b"], LLSD())), // required, optional - (LLSDArray // group - (LLSDArray("freena_map_leftreq")("smethodna_map_leftreq")("methodna_map_leftreq")) - (LLSDArray(leftreq["a"])(rightdft["a"]))) // required, optional + llsd::array // group + (llsd::array("freena_map_leftreq", "smethodna_map_leftreq", "methodna_map_leftreq"), + llsd::array(leftreq["a"], rightdft["a"])), // required, optional - (LLSDArray // group - (LLSDArray("freenb_map_leftreq")("smethodnb_map_leftreq")("methodnb_map_leftreq")) - (LLSDArray(leftreq["b"])(rightdft["b"]))) // required, optional + llsd::array // group + (llsd::array("freenb_map_leftreq", "smethodnb_map_leftreq", "methodnb_map_leftreq"), + llsd::array(leftreq["b"], rightdft["b"])), // required, optional - (LLSDArray // group - (LLSDArray("freena_map_skipreq")("smethodna_map_skipreq")("methodna_map_skipreq")) - (LLSDArray(skipreq["a"])(dft_map_partial["a"]))) // required, optional + llsd::array // group + (llsd::array("freena_map_skipreq", "smethodna_map_skipreq", "methodna_map_skipreq"), + llsd::array(skipreq["a"], dft_map_partial["a"])), // required, optional - (LLSDArray // group - (LLSDArray("freenb_map_skipreq")("smethodnb_map_skipreq")("methodnb_map_skipreq")) - (LLSDArray(skipreq["b"])(dft_map_partial["b"]))) // required, optional + llsd::array // group + (llsd::array("freenb_map_skipreq", "smethodnb_map_skipreq", "methodnb_map_skipreq"), + llsd::array(skipreq["b"], dft_map_partial["b"])), // required, optional - // We only need mention the full-map-defaults ("_mdft" suffix) - // registrations, having established their equivalence with the - // full-array-defaults ("_adft" suffix) registrations in another test. - (LLSDArray // group - (LLSDArray("freena_map_mdft")("smethodna_map_mdft")("methodna_map_mdft")) - (LLSDArray(LLSD::emptyMap())(dft_map_full["a"]))) // required, optional + // We only need mention the full-map-defaults ("_mdft" suffix) + // registrations, having established their equivalence with the + // full-array-defaults ("_adft" suffix) registrations in another test. + llsd::array // group + (llsd::array("freena_map_mdft", "smethodna_map_mdft", "methodna_map_mdft"), + llsd::array(LLSD::emptyMap(), dft_map_full["a"])), // required, optional - (LLSDArray // group - (LLSDArray("freenb_map_mdft")("smethodnb_map_mdft")("methodnb_map_mdft")) - (LLSDArray(LLSD::emptyMap())(dft_map_full["b"])))); // required, optional + llsd::array // group + (llsd::array("freenb_map_mdft", "smethodnb_map_mdft", "methodnb_map_mdft"), + llsd::array(LLSD::emptyMap(), dft_map_full["b"])))); // required, optional for (LLSD grp : inArray(groups)) { @@ -1075,7 +1075,7 @@ namespace tut // with 'required'. LLSD answer(42); // LLSD value matching 'required' according to llsd_matches() rules. - LLSD matching(LLSDMap("d", 3.14)("array", LLSDArray("answer")(true)(answer))); + LLSD matching(LLSDMap("d", 3.14)("array", llsd::array("answer", true, answer))); // Okay, walk through 'tests'. for (const CallablesTriple& tr : tests) { @@ -1112,17 +1112,17 @@ namespace tut call_exc("free0_map", 17, map_exc); // Passing an array to a map-style function works now! No longer an // error case! -// call_exc("free0_map", LLSDArray("a")("b"), map_exc); +// call_exc("free0_map", llsd::array("a", "b"), map_exc); } template<> template<> void object::test<18>() { set_test_name("call no-args functions"); - LLSD names(LLSDArray - ("free0_array")("free0_map") - ("smethod0_array")("smethod0_map") - ("method0_array")("method0_map")); + LLSD names(llsd::array + ("free0_array", "free0_map", + "smethod0_array", "smethod0_map", + "method0_array", "method0_map")); for (LLSD name : inArray(names)) { // Look up the Vars instance for this function. @@ -1140,10 +1140,10 @@ namespace tut } // Break out this data because we use it in a couple different tests. - LLSD array_funcs(LLSDArray - (LLSDMap("a", "freena_array") ("b", "freenb_array")) - (LLSDMap("a", "smethodna_array")("b", "smethodnb_array")) - (LLSDMap("a", "methodna_array") ("b", "methodnb_array"))); + LLSD array_funcs(llsd::array + (LLSDMap("a", "freena_array") ("b", "freenb_array"), + LLSDMap("a", "smethodna_array")("b", "smethodnb_array"), + LLSDMap("a", "methodna_array") ("b", "methodnb_array"))); template<> template<> void object::test<19>() @@ -1151,7 +1151,7 @@ namespace tut set_test_name("call array-style functions with too-short arrays"); // Could have two different too-short arrays, one for *na and one for // *nb, but since they both take 5 params... - LLSD tooshort(LLSDArray("this")("array")("too")("short")); + LLSD tooshort(llsd::array("this", "array", "too", "short")); for (const LLSD& funcsab : inArray(array_funcs)) { for (const llsd::MapEntry& e : inMap(funcsab)) @@ -1170,12 +1170,12 @@ namespace tut { binary.push_back((U8)h); } - LLSD args(LLSDMap("a", LLSDArray(true)(17)(3.14)(123.456)("char*")) - ("b", LLSDArray("string") - (LLUUID("01234567-89ab-cdef-0123-456789abcdef")) - (LLDate("2011-02-03T15:07:00Z")) - (LLURI("http://secondlife.com")) - (binary))); + LLSD args(LLSDMap("a", llsd::array(true, 17, 3.14, 123.456, "char*")) + ("b", llsd::array("string", + LLUUID("01234567-89ab-cdef-0123-456789abcdef"), + LLDate("2011-02-03T15:07:00Z"), + LLURI("http://secondlife.com"), + binary))); LLSD argsplus(args); argsplus["a"].append("bogus"); argsplus["b"].append("bogus"); @@ -1189,7 +1189,7 @@ namespace tut debug("expect: ", expect); // Use substantially the same logic for args and argsplus - LLSD argsarrays(LLSDArray(args)(argsplus)); + LLSD argsarrays(llsd::array(args, argsplus)); // So i==0 selects 'args', i==1 selects argsplus for (LLSD::Integer i(0), iend(argsarrays.size()); i < iend; ++i) { @@ -1234,8 +1234,8 @@ namespace tut set_test_name("call map-style functions with (full | oversized) (arrays | maps)"); const char binary[] = "\x99\x88\x77\x66\x55"; LLSD array_full(LLSDMap - ("a", LLSDArray(false)(255)(98.6)(1024.5)("pointer")) - ("b", LLSDArray("object")(LLUUID::generateNewID())(LLDate::now())(LLURI("http://wiki.lindenlab.com/wiki"))(LLSD::Binary(boost::begin(binary), boost::end(binary))))); + ("a", llsd::array(false, 255, 98.6, 1024.5, "pointer")) + ("b", llsd::array("object", LLUUID::generateNewID(), LLDate::now(), LLURI("http://wiki.lindenlab.com/wiki"), LLSD::Binary(boost::begin(binary), boost::end(binary))))); LLSD array_overfull(array_full); for (LLSD::String a : ab) { @@ -1278,20 +1278,20 @@ namespace tut // parameter defaults should make NO DIFFERENCE WHATSOEVER. Every call // should pass all params. LLSD names(LLSDMap - ("a", LLSDArray - ("freena_map_allreq") ("smethodna_map_allreq") ("methodna_map_allreq") - ("freena_map_leftreq")("smethodna_map_leftreq")("methodna_map_leftreq") - ("freena_map_skipreq")("smethodna_map_skipreq")("methodna_map_skipreq") - ("freena_map_adft") ("smethodna_map_adft") ("methodna_map_adft") - ("freena_map_mdft") ("smethodna_map_mdft") ("methodna_map_mdft")) - ("b", LLSDArray - ("freenb_map_allreq") ("smethodnb_map_allreq") ("methodnb_map_allreq") - ("freenb_map_leftreq")("smethodnb_map_leftreq")("methodnb_map_leftreq") - ("freenb_map_skipreq")("smethodnb_map_skipreq")("methodnb_map_skipreq") - ("freenb_map_adft") ("smethodnb_map_adft") ("methodnb_map_adft") - ("freenb_map_mdft") ("smethodnb_map_mdft") ("methodnb_map_mdft"))); + ("a", llsd::array + ("freena_map_allreq", "smethodna_map_allreq", "methodna_map_allreq", + "freena_map_leftreq", "smethodna_map_leftreq", "methodna_map_leftreq", + "freena_map_skipreq", "smethodna_map_skipreq", "methodna_map_skipreq", + "freena_map_adft", "smethodna_map_adft", "methodna_map_adft", + "freena_map_mdft", "smethodna_map_mdft", "methodna_map_mdft")) + ("b", llsd::array + ("freenb_map_allreq", "smethodnb_map_allreq", "methodnb_map_allreq", + "freenb_map_leftreq", "smethodnb_map_leftreq", "methodnb_map_leftreq", + "freenb_map_skipreq", "smethodnb_map_skipreq", "methodnb_map_skipreq", + "freenb_map_adft", "smethodnb_map_adft", "methodnb_map_adft", + "freenb_map_mdft", "smethodnb_map_mdft", "methodnb_map_mdft"))); // Treat (full | overfull) (array | map) the same. - LLSD argssets(LLSDArray(array_full)(array_overfull)(map_full)(map_overfull)); + LLSD argssets(llsd::array(array_full, array_overfull, map_full, map_overfull)); for (const LLSD& args : inArray(argssets)) { for (LLSD::String a : ab) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 810980c412b4da3e3634c456eda7464d66117a40..f90d7ce22a116caa91f1479df3d82448169d4da5 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1816,10 +1816,10 @@ namespace tut { set_test_name("verify sequence to Python"); - LLSD cdata(LLSDArray(17)(3.14) - ("This string\n" - "has several\n" - "lines.")); + LLSD cdata(llsd::array(17, 3.14, + "This string\n" + "has several\n" + "lines.")); const char pydata[] = "def verify(iterable):\n" diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index cd9d26e6607daf01f3e6c8bcb8ffd714eab55fb3..c549507e61ddeb8459f1001aeb94c2902d1fbc5f 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -440,8 +440,8 @@ LLSD LLSettingsDay::defaults() } LLSD tracks; - tracks.append(LLSDArray(waterTrack)); - tracks.append(LLSDArray(skyTrack)); + tracks.append(llsd::array(waterTrack)); + tracks.append(llsd::array(skyTrack)); dfltsetting[SETTING_TRACKS] = tracks; dfltsetting[SETTING_FRAMES] = frames; diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 375f8a65e16a7a9758a1fa4ca8717ef8e294f620..45eafc0268576f56d9b5fbbdebf23c8489fffbe5 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -154,24 +154,24 @@ LLSettingsSky::validation_list_t legacyHazeValidationList() { legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_AMBIENT, false, LLSD::TypeArray, boost::bind(&LLSettingsBase::Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(3.0f)(3.0f)(3.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(3.0f, 3.0f, 3.0f, "*")))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_BLUE_DENSITY, false, LLSD::TypeArray, boost::bind(&LLSettingsBase::Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(3.0f)(3.0f)(3.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(3.0f, 3.0f, 3.0f, "*")))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_BLUE_HORIZON, false, LLSD::TypeArray, boost::bind(&LLSettingsBase::Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(3.0f)(3.0f)(3.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(3.0f, 3.0f, 3.0f, "*")))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_HAZE_DENSITY, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(5.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 5.0f)))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_HAZE_HORIZON, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(5.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 5.0f)))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_MULTIPLIER, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0001f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0001f, 2.0f)))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DISTANCE_MULTIPLIER, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0001f)(1000.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0001f, 1000.0f)))); } return legacyHazeValidation; } @@ -182,19 +182,19 @@ LLSettingsSky::validation_list_t rayleighValidationList() if (rayleighValidation.empty()) { rayleighValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(32768.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 32768.0f)))); rayleighValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 2.0f)))); rayleighValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(-1.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(-1.0f, 1.0f)))); rayleighValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 2.0f)))); rayleighValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); } return rayleighValidation; } @@ -205,19 +205,19 @@ LLSettingsSky::validation_list_t absorptionValidationList() if (absorptionValidation.empty()) { absorptionValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(32768.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 32768.0f)))); absorptionValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 2.0f)))); absorptionValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(-1.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(-1.0f, 1.0f)))); absorptionValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 2.0f)))); absorptionValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); } return absorptionValidation; } @@ -228,22 +228,22 @@ LLSettingsSky::validation_list_t mieValidationList() if (mieValidation.empty()) { mieValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(32768.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 32768.0f)))); mieValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 2.0f)))); mieValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(-1.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(-1.0f, 1.0f)))); mieValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 2.0f)))); mieValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); mieValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_MIE_ANISOTROPY_FACTOR, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); } return mieValidation; } @@ -545,92 +545,89 @@ const LLSettingsSky::validation_list_t& LLSettingsSky::validationList() static validation_list_t validation; if (validation.empty()) - { // Note the use of LLSD(LLSDArray()()()...) This is due to an issue with the - // copy constructor for LLSDArray. Directly binding the LLSDArray as - // a parameter without first wrapping it in a pure LLSD object will result - // in deeply nested arrays like this [[[[[[[[[[v1,v2,v3]]]]]]]]]] + { validation.push_back(Validator(SETTING_BLOOM_TEXTUREID, true, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_RAINBOW_TEXTUREID, false, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_HALO_TEXTUREID, false, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_CLOUD_COLOR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(1.0f)(1.0f)(1.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(1.0f, 1.0f, 1.0f, "*")))); validation.push_back(Validator(SETTING_CLOUD_POS_DENSITY1, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(1.0f)(1.0f)(3.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(1.0f, 1.0f, 3.0f, "*")))); validation.push_back(Validator(SETTING_CLOUD_POS_DENSITY2, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(1.0f)(1.0f)(1.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(1.0f, 1.0f, 1.0f, "*")))); validation.push_back(Validator(SETTING_CLOUD_SCALE, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.001f)(3.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.001f, 3.0f)))); validation.push_back(Validator(SETTING_CLOUD_SCROLL_RATE, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(-50.0f)(-50.0f)), - LLSD(LLSDArray(50.0f)(50.0f))))); + llsd::array(-50.0f, -50.0f), + llsd::array(50.0f, 50.0f)))); validation.push_back(Validator(SETTING_CLOUD_SHADOW, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_CLOUD_TEXTUREID, false, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_CLOUD_VARIANCE, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_DOME_OFFSET, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_DOME_RADIUS, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(1000.0f)(2000.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(1000.0f, 2000.0f)))); validation.push_back(Validator(SETTING_GAMMA, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(20.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 20.0f)))); validation.push_back(Validator(SETTING_GLOW, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.2f)("*")(-10.0f)("*")), - LLSD(LLSDArray(40.0f)("*")(10.0f)("*"))))); + llsd::array(0.2f, "*", -10.0f, "*"), + llsd::array(40.0f, "*", 10.0f, "*")))); validation.push_back(Validator(SETTING_MAX_Y, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(10000.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 10000.0f)))); validation.push_back(Validator(SETTING_MOON_ROTATION, true, LLSD::TypeArray, &Validator::verifyQuaternionNormal)); validation.push_back(Validator(SETTING_MOON_SCALE, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.25f)(20.0f))), LLSD::Real(1.0))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.25f, 20.0f)), LLSD::Real(1.0))); validation.push_back(Validator(SETTING_MOON_TEXTUREID, false, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_MOON_BRIGHTNESS, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_STAR_BRIGHTNESS, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(500.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 500.0f)))); validation.push_back(Validator(SETTING_SUNLIGHT_COLOR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), - LLSD(LLSDArray(3.0f)(3.0f)(3.0f)("*"))))); + llsd::array(0.0f, 0.0f, 0.0f, "*"), + llsd::array(3.0f, 3.0f, 3.0f, "*")))); validation.push_back(Validator(SETTING_SUN_ROTATION, true, LLSD::TypeArray, &Validator::verifyQuaternionNormal)); validation.push_back(Validator(SETTING_SUN_SCALE, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.25f)(20.0f))), LLSD::Real(1.0))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.25f, 20.0f)), LLSD::Real(1.0))); validation.push_back(Validator(SETTING_SUN_TEXTUREID, false, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_PLANET_RADIUS, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(1000.0f)(32768.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(1000.0f, 32768.0f)))); validation.push_back(Validator(SETTING_SKY_BOTTOM_RADIUS, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(1000.0f)(32768.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(1000.0f, 32768.0f)))); validation.push_back(Validator(SETTING_SKY_TOP_RADIUS, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(1000.0f)(32768.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(1000.0f, 32768.0f)))); validation.push_back(Validator(SETTING_SUN_ARC_RADIANS, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(0.1f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 0.1f)))); validation.push_back(Validator(SETTING_SKY_MOISTURE_LEVEL, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_SKY_DROPLET_RADIUS, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(5.0f)(1000.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(5.0f, 1000.0f)))); validation.push_back(Validator(SETTING_SKY_ICE_LEVEL, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_REFLECTION_PROBE_AMBIANCE, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(10.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(llsd::array(0.0f, 10.0f))))); validation.push_back(Validator(SETTING_RAYLEIGH_CONFIG, true, LLSD::TypeArray, &validateRayleighLayers)); validation.push_back(Validator(SETTING_ABSORPTION_CONFIG, true, LLSD::TypeArray, &validateAbsorptionLayers)); @@ -721,7 +718,7 @@ LLSD LLSettingsSky::defaults(const LLSettingsBase::TrackPosition& position) dfltsetting[SETTING_CLOUD_POS_DENSITY1] = LLColor4(1.0000f, 0.5260f, 1.0000f, 0.0f).getValue(); dfltsetting[SETTING_CLOUD_POS_DENSITY2] = LLColor4(1.0000f, 0.5260f, 1.0000f, 0.0f).getValue(); dfltsetting[SETTING_CLOUD_SCALE] = LLSD::Real(0.4199); - dfltsetting[SETTING_CLOUD_SCROLL_RATE] = LLSDArray(0.0f)(0.0f); + dfltsetting[SETTING_CLOUD_SCROLL_RATE] = llsd::array(0.0f, 0.0f); dfltsetting[SETTING_CLOUD_SHADOW] = LLSD::Real(0.2699); dfltsetting[SETTING_CLOUD_VARIANCE] = LLSD::Real(0.0); diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 902ba92088798f8144174452bd586ef5a0fa6c0d..52c2fca19c85d5598595433855f7f0b25bd4331a 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -222,42 +222,38 @@ const LLSettingsWater::validation_list_t& LLSettingsWater::validationList() static validation_list_t validation; if (validation.empty()) - { // Note the use of LLSD(LLSDArray()()()...) This is due to an issue with the - // copy constructor for LLSDArray. Directly binding the LLSDArray as - // a parameter without first wrapping it in a pure LLSD object will result - // in deeply nested arrays like this [[[[[[[[[[v1,v2,v3]]]]]]]]]] - + { validation.push_back(Validator(SETTING_BLUR_MULTIPLIER, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(-0.5f)(0.5f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(-0.5f, 0.5f)))); validation.push_back(Validator(SETTING_FOG_COLOR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)(1.0f)), - LLSD(LLSDArray(1.0f)(1.0f)(1.0f)(1.0f))))); + llsd::array(0.0f, 0.0f, 0.0f, 1.0f), + llsd::array(1.0f, 1.0f, 1.0f, 1.0f)))); validation.push_back(Validator(SETTING_FOG_DENSITY, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(-10.0f)(10.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(-10.0f, 10.0f)))); validation.push_back(Validator(SETTING_FOG_MOD, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(20.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 20.0f)))); validation.push_back(Validator(SETTING_FRESNEL_OFFSET, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_FRESNEL_SCALE, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 1.0f)))); validation.push_back(Validator(SETTING_NORMAL_MAP, true, LLSD::TypeUUID)); validation.push_back(Validator(SETTING_NORMAL_SCALE, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(0.0f)(0.0f)(0.0f)), - LLSD(LLSDArray(10.0f)(10.0f)(10.0f))))); + llsd::array(0.0f, 0.0f, 0.0f), + llsd::array(10.0f, 10.0f, 10.0f)))); validation.push_back(Validator(SETTING_SCALE_ABOVE, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(3.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 3.0f)))); validation.push_back(Validator(SETTING_SCALE_BELOW, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(3.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, llsd::array(0.0f, 3.0f)))); validation.push_back(Validator(SETTING_WAVE1_DIR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(-20.0f)(-20.0f)), - LLSD(LLSDArray(20.0f)(20.0f))))); + llsd::array(-20.0f, -20.0f), + llsd::array(20.0f, 20.0f)))); validation.push_back(Validator(SETTING_WAVE2_DIR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, boost::placeholders::_1, boost::placeholders::_2, - LLSD(LLSDArray(-20.0f)(-20.0f)), - LLSD(LLSDArray(20.0f)(20.0f))))); + llsd::array(-20.0f, -20.0f), + llsd::array(20.0f, 20.0f)))); } return validation; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index d4fc920c5ae79635e2af5a3e75d6c95a665023c2..c638f25f662c78082043ccc3f27b3ffb5d125256 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2414,8 +2414,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ LLWindowWin32* window_imp = (LLWindowWin32*)GetWindowLongPtr(h_wnd, GWLP_USERDATA); - bool debug_window_proc = false; // gDebugWindowProc || debugLoggingEnabled("Window"); - if (NULL != window_imp) { // Juggle to make sure we can get negative positions for when @@ -2442,11 +2440,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_DEVICECHANGE: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_DEVICECHANGE"); - if (debug_window_proc) - { - LL_INFOS("Window") << " WM_DEVICECHANGE: wParam=" << w_param - << "; lParam=" << l_param << LL_ENDL; - } if (w_param == DBT_DEVNODES_CHANGED || w_param == DBT_DEVICEARRIVAL) { WINDOW_IMP_POST(window_imp->mCallbacks->handleDeviceChange(window_imp)); @@ -2508,16 +2501,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ { // This message should be sent whenever the app gains or loses focus. BOOL activating = (BOOL)w_param; - BOOL minimized = window_imp->getMinimized(); - - if (debug_window_proc) - { - LL_INFOS("Window") << "WINDOWPROC ActivateApp " - << " activating " << S32(activating) - << " minimized " << S32(minimized) - << " fullscreen " << S32(window_imp->mFullscreen) - << LL_ENDL; - } if (window_imp->mFullscreen) { @@ -2552,23 +2535,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // Can be one of WA_ACTIVE, WA_CLICKACTIVE, or WA_INACTIVE BOOL activating = (LOWORD(w_param) != WA_INACTIVE); - BOOL minimized = BOOL(HIWORD(w_param)); - if (!activating && LLWinImm::isAvailable() && window_imp->mPreeditor) { window_imp->interruptLanguageTextInput(); } - - // JC - I'm not sure why, but if we don't report that we handled the - // WM_ACTIVATE message, the WM_ACTIVATEAPP messages don't work - // properly when we run fullscreen. - if (debug_window_proc) - { - LL_INFOS("Window") << "WINDOWPROC Activate " - << " activating " << S32(activating) - << " minimized " << S32(minimized) - << LL_ENDL; - } }); break; @@ -2647,13 +2617,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ window_imp->mRawLParam = l_param; { - if (debug_window_proc) - { - LL_INFOS("Window") << "Debug WindowProc WM_KEYDOWN " - << " key " << S32(w_param) - << LL_ENDL; - } - gKeyboard->handleKeyDown(w_param, mask); } }); @@ -2675,12 +2638,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ window_imp->mRawLParam = l_param; { - if (debug_window_proc) - { - LL_INFOS("Window") << "Debug WindowProc WM_KEYUP " - << " key " << S32(w_param) - << LL_ENDL; - } gKeyboard->handleKeyUp(w_param, mask); } }); @@ -2690,10 +2647,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_SETCONTEXT: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_IME_SETCONTEXT"); - if (debug_window_proc) - { - LL_INFOS("Window") << "WM_IME_SETCONTEXT" << LL_ENDL; - } if (LLWinImm::isAvailable() && window_imp->mPreeditor) { l_param &= ~ISC_SHOWUICOMPOSITIONWINDOW; @@ -2704,10 +2657,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_STARTCOMPOSITION: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_IME_STARTCOMPOSITION"); - if (debug_window_proc) - { - LL_INFOS() << "WM_IME_STARTCOMPOSITION" << LL_ENDL; - } if (LLWinImm::isAvailable() && window_imp->mPreeditor) { WINDOW_IMP_POST(window_imp->handleStartCompositionMessage()); @@ -2718,10 +2667,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_ENDCOMPOSITION: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_IME_ENDCOMPOSITION"); - if (debug_window_proc) - { - LL_INFOS() << "WM_IME_ENDCOMPOSITION" << LL_ENDL; - } if (LLWinImm::isAvailable() && window_imp->mPreeditor) { return 0; @@ -2731,10 +2676,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_COMPOSITION: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_IME_COMPOSITION"); - if (debug_window_proc) - { - LL_INFOS() << "WM_IME_COMPOSITION" << LL_ENDL; - } if (LLWinImm::isAvailable() && window_imp->mPreeditor) { WINDOW_IMP_POST(window_imp->handleCompositionMessage(l_param)); @@ -2745,10 +2686,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_REQUEST: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_IME_REQUEST"); - if (debug_window_proc) - { - LL_INFOS() << "WM_IME_REQUEST" << LL_ENDL; - } if (LLWinImm::isAvailable() && window_imp->mPreeditor) { LRESULT result; @@ -2777,12 +2714,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // it is worth trying. The good old WM_CHAR works just fine even for supplementary // characters. We just need to take care of surrogate pairs sent as two WM_CHAR's // by ourselves. It is not that tough. -- Alissa Sabre @ SL - if (debug_window_proc) - { - LL_INFOS("Window") << "Debug WindowProc WM_CHAR " - << " key " << S32(w_param) - << LL_ENDL; - } + // Even if LLWindowCallbacks::handleUnicodeChar(llwchar, BOOL) returned FALSE, // we *did* processed the event, so I believe we should not pass it to DefWindowProc... window_imp->handleUnicodeUTF16((U16)w_param, gKeyboard->currentMask(FALSE)); @@ -3097,25 +3029,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_SIZE"); window_imp->updateWindowRect(); - S32 width = S32(LOWORD(l_param)); - S32 height = S32(HIWORD(l_param)); - - if (debug_window_proc) - { - BOOL maximized = (w_param == SIZE_MAXIMIZED); - BOOL restored = (w_param == SIZE_RESTORED); - BOOL minimized = (w_param == SIZE_MINIMIZED); - - LL_INFOS("Window") << "WINDOWPROC Size " - << width << "x" << height - << " max " << S32(maximized) - << " min " << S32(minimized) - << " rest " << S32(restored) - << LL_ENDL; - } - - // There's an odd behavior with WM_SIZE that I would call a bug. If + // There's an odd behavior with WM_SIZE that I would call a bug. If // the window is maximized, and you call MoveWindow() with a size smaller // than a maximized window, it ends up sending WM_SIZE with w_param set // to SIZE_MAXIMIZED -- which isn't true. So the logic below doesn't work. @@ -3179,10 +3094,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_SETFOCUS: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_SETFOCUS"); - if (debug_window_proc) - { - LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL; - } WINDOW_IMP_POST(window_imp->mCallbacks->handleFocus(window_imp)); return 0; } @@ -3190,10 +3101,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_KILLFOCUS: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_KILLFOCUS"); - if (debug_window_proc) - { - LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL; - } WINDOW_IMP_POST(window_imp->mCallbacks->handleFocusLost(window_imp)); return 0; } @@ -3314,10 +3221,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ default: { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - default"); - if (debug_window_proc) - { - LL_INFOS("Window") << "Unhandled windows message code: 0x" << std::hex << U32(u_msg) << LL_ENDL; - } } break; } diff --git a/indra/newview/alavataractions.cpp b/indra/newview/alavataractions.cpp index 8f400bbfbbb5e04e391519f7802b90172db17aa3..b835d0ae59a01284b0abd9f3c218cba3c16b5972 100644 --- a/indra/newview/alavataractions.cpp +++ b/indra/newview/alavataractions.cpp @@ -316,7 +316,7 @@ void ALAvatarActions::parcelFreeze(const uuid_vec_t& ids) return; LLSD payload; - payload["avatar_ids"] = LLSDArray(); + payload["avatar_ids"] = LLSD::emptyArray(); std::string avatars; for (auto id : ids) { diff --git a/indra/newview/groupchatlistener.cpp b/indra/newview/groupchatlistener.cpp index ef015a950d5e86fd6ed3885530fc61a1aac9f8e6..a05caa961b7db78bbb091a0439f0d2b3774df13c 100644 --- a/indra/newview/groupchatlistener.cpp +++ b/indra/newview/groupchatlistener.cpp @@ -64,11 +64,11 @@ GroupChatListener::GroupChatListener(): "Leave a group chat in group with UUID [\"id\"]\n" "Assumes a prior successful startIM request.", &LLGroupActions::endIM, - LLSDArray("id")); - add("sendIM", - "send a groupchat IM", - &send_message_wrapper, - LLSDArray("text")("session_id")("group_id")); + llsd::array("id")); + add("sendIM", + "send a groupchat IM", + &send_message_wrapper, + llsd::array("text", "session_id", "group_id")); } /* static void sendMessage(const std::string& utf8_text, const LLUUID& im_session_id, diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 74695cc578fb3d63770e16f779edc10347297024..d268f90761c9eeb5ae278e89105b953577159ad1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3155,15 +3155,16 @@ LLSD LLAppViewer::getViewerInfo() const // LLFloaterAbout. LLSD info; auto& versionInfo(LLVersionInfo::instance()); - info["VIEWER_VERSION"] = LLSDArray(versionInfo.getMajor())(versionInfo.getMinor())(versionInfo.getPatch()); + info["VIEWER_VERSION"] = llsd::array(versionInfo.getMajor(), versionInfo.getMinor(), + versionInfo.getPatch()); info["VIEWER_VERSION_STR"] = versionInfo.getVersion(); info["CHANNEL"] = versionInfo.getChannel(); - info["ADDRESS_SIZE"] = ADDRESS_SIZE; - std::string build_config = versionInfo.getBuildConfig(); - if (build_config != "Release") - { - info["BUILD_CONFIG"] = build_config; - } + info["ADDRESS_SIZE"] = ADDRESS_SIZE; + std::string build_config = versionInfo.getBuildConfig(); + if (build_config != "Release") + { + info["BUILD_CONFIG"] = build_config; + } // return a URL to the release notes for this viewer, such as: // https://releasenotes.secondlife.com/viewer/2.1.0.123456.html diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index 6bdc5ee8233496ecdd25192bdf67d44a104132d9..2d5e86869d8393e0bc4e5fa27f78892e32eae7fd 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -523,7 +523,7 @@ void LLFloaterEditSky::refreshSkyPresetsList() for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) { - mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + mSkyPresetCombo->add((*it).first, llsd::array((*it).first, (*it).second)); } mSkyPresetCombo->setLabel(getString("combo_label")); diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp index 6e7b777e70a31b4654737290fafb3f88981645e3..c44ae7faca97eef87ea67159c6aa57fc0731ed13 100644 --- a/indra/newview/llfloatereditwater.cpp +++ b/indra/newview/llfloatereditwater.cpp @@ -335,7 +335,7 @@ void LLFloaterEditWater::refreshWaterPresetsList() for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) { - mWaterPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + mWaterPresetCombo->add((*it).first, llsd::array((*it).first, (*it).second)); } mWaterPresetCombo->setLabel(getString("combo_label")); diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 640a1a83103861687124108c49384035c312e901..9ec303b810df2e8fd85a118225473309e1708858 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -440,6 +440,19 @@ void LLGLTFMaterialList::queueApply(const LLViewerObject* obj, S32 side, const L } } +void LLGLTFMaterialList::queueApply(const LLViewerObject* obj, S32 side, const LLUUID& asset_id, const LLGLTFMaterial* material_override) +{ + if (asset_id.isNull() || material_override == nullptr) + { + queueApply(obj, side, asset_id); + } + else + { + LLGLTFMaterial* material = new LLGLTFMaterial(*material_override); + sApplyQueue.push_back({ obj->getID(), side, asset_id, material }); + } +} + void LLGLTFMaterialList::queueUpdate(const LLSD& data) { llassert(is_valid_update(data)); @@ -484,7 +497,7 @@ void LLGLTFMaterialList::flushUpdates(void(*done_callback)(bool)) } sModifyQueue.clear(); - for (auto& e : sApplyQueue) + for (ApplyMaterialAssetData& e : sApplyQueue) { data[i]["object_id"] = e.object_id; data[i]["side"] = e.side; diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h index 1b3ddcf389c5b6cbc7b285306515ee7a69c78e5b..3669ed955005dc1004273f17579d9f8cb6122354 100644 --- a/indra/newview/llgltfmateriallist.h +++ b/indra/newview/llgltfmateriallist.h @@ -70,6 +70,13 @@ class LLGLTFMaterialList // NOTE: Implicitly clears most override data if present static void queueApply(const LLViewerObject* obj, S32 side, const LLUUID& asset_id); + // Queue an application of a material asset we want to send to the simulator. Call "flushUpdates" to flush pending updates. + // object_id - ID of object to apply material asset to + // side - TextureEntry index to apply material to, or -1 for all sides + // asset_id - ID of material asset to apply, or LLUUID::null to disassociate current material asset + // mat - override material, if null, will clear most override data + static void queueApply(const LLViewerObject* obj, S32 side, const LLUUID& asset_id, const LLGLTFMaterial* mat); + // flush pending material updates to the simulator // Automatically called once per frame, but may be called explicitly // for cases that care about the done_callback forwarded to LLCoros::instance().launch diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 0b7e9aba337ae215cb3042f617da5c0edb76e30f..1d587367dba4355be4aba8b5804f83c7e5d79032 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2191,8 +2191,8 @@ void LLSelectMgr::selectionRevertGLTFMaterials() // Enqueue update to server if (asset_id.notNull()) { - // Restore overrides - LLGLTFMaterialList::queueModify(objectp, te, nodep->mSavedGLTFOverrideMaterials[te]); + // Restore overrides and base material + LLGLTFMaterialList::queueApply(objectp, te, asset_id, nodep->mSavedGLTFOverrideMaterials[te]); } else { @@ -5777,7 +5777,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data if (can_copy && can_transfer && node->getObject()->getVolume()) { uuid_vec_t material_ids; - gltf_materials_vec_t materials; + gltf_materials_vec_t override_materials; LLVOVolume* vobjp = (LLVOVolume*)node->getObject(); for (int i = 0; i < vobjp->getNumTEs(); ++i) { @@ -5792,18 +5792,16 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data if (old_override) { LLPointer<LLGLTFMaterial> mat = new LLGLTFMaterial(*old_override); - materials.push_back(mat); + override_materials.push_back(mat); } else { - materials.push_back(nullptr); + override_materials.push_back(nullptr); } } - node->saveGLTFMaterialIds(material_ids); - // processObjectProperties does not include overrides so this // might need to be moved to LLGLTFMaterialOverrideDispatchHandler - node->saveGLTFOverrideMaterials(materials); + node->saveGLTFMaterials(material_ids, override_materials); } } @@ -6520,8 +6518,7 @@ LLSelectNode::LLSelectNode(const LLSelectNode& nodep) mSavedShinyColors = nodep.mSavedShinyColors; saveTextures(nodep.mSavedTextures); - saveGLTFMaterialIds(nodep.mSavedGLTFMaterialIds); - saveGLTFOverrideMaterials(nodep.mSavedGLTFOverrideMaterials); + saveGLTFMaterials(nodep.mSavedGLTFMaterialIds, nodep.mSavedGLTFOverrideMaterials); } LLSelectNode::~LLSelectNode() @@ -6649,28 +6646,21 @@ void LLSelectNode::saveTextures(const uuid_vec_t& textures) } } -void LLSelectNode::saveGLTFMaterialIds(const uuid_vec_t& materials) +void LLSelectNode::saveGLTFMaterials(const uuid_vec_t& materials, const gltf_materials_vec_t& override_materials) { if (mObject.notNull()) { mSavedGLTFMaterialIds.clear(); + mSavedGLTFOverrideMaterials.clear(); for (uuid_vec_t::const_iterator materials_it = materials.begin(); materials_it != materials.end(); ++materials_it) { mSavedGLTFMaterialIds.push_back(*materials_it); } - } -} - -void LLSelectNode::saveGLTFOverrideMaterials(const gltf_materials_vec_t& materials) -{ - if (mObject.notNull()) - { - mSavedGLTFOverrideMaterials.clear(); - for (gltf_materials_vec_t::const_iterator mat_it = materials.begin(); - mat_it != materials.end(); ++mat_it) + for (gltf_materials_vec_t::const_iterator mat_it = override_materials.begin(); + mat_it != override_materials.end(); ++mat_it) { mSavedGLTFOverrideMaterials.push_back(*mat_it); } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index d2270cdfa2eda69f04832d77139245963ffd1900..74fbb84a96d360a225e9c9a9a4f4d9f3bd961b20 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -196,8 +196,7 @@ class LLSelectNode // final gltf material that users see. // Ids get applied and restored by tools floater, // overrides get applied in live material editor - void saveGLTFMaterialIds(const uuid_vec_t& materials); - void saveGLTFOverrideMaterials(const gltf_materials_vec_t& materials); + void saveGLTFMaterials(const uuid_vec_t& materials, const gltf_materials_vec_t& override_materials); BOOL allowOperationOnNode(PermissionBit op, U64 group_proxy_power) const; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 68985d03956955d3e2b09de1800e30202092c950..9cdc795d5680b6af7588a344ae72c552f22981b4 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -576,11 +576,11 @@ void LLSettingsVOSky::convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings) legacy[SETTING_BLUE_DENSITY] = ensure_array_4(legacyhaze[SETTING_BLUE_DENSITY], 1.0); legacy[SETTING_BLUE_HORIZON] = ensure_array_4(legacyhaze[SETTING_BLUE_HORIZON], 1.0); - legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal())(0.0f)(0.0f)(1.0f); - legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal())(0.0f)(0.0f)(1.0f); + legacy[SETTING_DENSITY_MULTIPLIER] = llsd::array(legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal(), 0.0f, 0.0f, 1.0f); + legacy[SETTING_DISTANCE_MULTIPLIER] = llsd::array(legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal(), 0.0f, 0.0f, 1.0f); - legacy[SETTING_HAZE_DENSITY] = LLSDArray(legacyhaze[SETTING_HAZE_DENSITY])(0.0f)(0.0f)(1.0f); - legacy[SETTING_HAZE_HORIZON] = LLSDArray(legacyhaze[SETTING_HAZE_HORIZON])(0.0f)(0.0f)(1.0f); + legacy[SETTING_HAZE_DENSITY] = llsd::array(legacyhaze[SETTING_HAZE_DENSITY], 0.0f, 0.0f, 1.0f); + legacy[SETTING_HAZE_HORIZON] = llsd::array(legacyhaze[SETTING_HAZE_HORIZON], 0.0f, 0.0f, 1.0f); } } @@ -594,15 +594,15 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA legacy[SETTING_CLOUD_COLOR] = ensure_array_4(settings[SETTING_CLOUD_COLOR], 1.0); legacy[SETTING_CLOUD_POS_DENSITY1] = ensure_array_4(settings[SETTING_CLOUD_POS_DENSITY1], 1.0); legacy[SETTING_CLOUD_POS_DENSITY2] = ensure_array_4(settings[SETTING_CLOUD_POS_DENSITY2], 1.0); - legacy[SETTING_CLOUD_SCALE] = LLSDArray(settings[SETTING_CLOUD_SCALE])(LLSD::Real(0.0))(LLSD::Real(0.0))(LLSD::Real(1.0)); + legacy[SETTING_CLOUD_SCALE] = llsd::array(settings[SETTING_CLOUD_SCALE], LLSD::Real(0.0), LLSD::Real(0.0), LLSD::Real(1.0)); legacy[SETTING_CLOUD_SCROLL_RATE] = settings[SETTING_CLOUD_SCROLL_RATE]; - legacy[SETTING_LEGACY_ENABLE_CLOUD_SCROLL] = LLSDArray(LLSD::Boolean(!is_approx_zero(settings[SETTING_CLOUD_SCROLL_RATE][0].asReal()))) - (LLSD::Boolean(!is_approx_zero(settings[SETTING_CLOUD_SCROLL_RATE][1].asReal()))); - legacy[SETTING_CLOUD_SHADOW] = LLSDArray(settings[SETTING_CLOUD_SHADOW].asReal())(0.0f)(0.0f)(1.0f); - legacy[SETTING_GAMMA] = LLSDArray(settings[SETTING_GAMMA])(0.0f)(0.0f)(1.0f); + legacy[SETTING_LEGACY_ENABLE_CLOUD_SCROLL] = llsd::array(LLSD::Boolean(!is_approx_zero(settings[SETTING_CLOUD_SCROLL_RATE][0].asReal())), + LLSD::Boolean(!is_approx_zero(settings[SETTING_CLOUD_SCROLL_RATE][1].asReal()))); + legacy[SETTING_CLOUD_SHADOW] = llsd::array(settings[SETTING_CLOUD_SHADOW].asReal(), 0.0f, 0.0f, 1.0f); + legacy[SETTING_GAMMA] = llsd::array(settings[SETTING_GAMMA], 0.0f, 0.0f, 1.0f); legacy[SETTING_GLOW] = ensure_array_4(settings[SETTING_GLOW], 1.0); legacy[SETTING_LIGHT_NORMAL] = ensure_array_4(psky->getLightDirection().getValue(), 0.0f); - legacy[SETTING_MAX_Y] = LLSDArray(settings[SETTING_MAX_Y])(0.0f)(0.0f)(1.0f); + legacy[SETTING_MAX_Y] = llsd::array(settings[SETTING_MAX_Y], 0.0f, 0.0f, 1.0f); legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS].asReal() / 250.0f; // convert from 0-500 -> 0-2 ala pre-FS-compat changes legacy[SETTING_SUNLIGHT_COLOR] = ensure_array_4(settings[SETTING_SUNLIGHT_COLOR], 1.0f); @@ -1112,7 +1112,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyPreset(const std::string &n newsettings[SETTING_NAME] = name; - LLSD watertrack = LLSDArray( + LLSD watertrack = llsd::array( LLSDMap(SETTING_KEYKFRAME, LLSD::Real(0.0f)) (SETTING_KEYNAME, "water:Default")); @@ -1127,7 +1127,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyPreset(const std::string &n skytrack.append(entry); } - newsettings[SETTING_TRACKS] = LLSDArray(watertrack)(skytrack); + newsettings[SETTING_TRACKS] = llsd::array(watertrack, skytrack); LLSD frames(LLSD::emptyMap()); @@ -1215,7 +1215,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyMessage(const LLUUID ®io watersettings[SETTING_NAME] = watername; frames[watername] = watersettings; - LLSD watertrack = LLSDArray( + LLSD watertrack = llsd::array( LLSDMap(SETTING_KEYKFRAME, LLSD::Real(0.0f)) (SETTING_KEYNAME, watername)); @@ -1229,7 +1229,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyMessage(const LLUUID ®io LLSD newsettings = LLSDMap ( SETTING_NAME, "Region (legacy)" ) - ( SETTING_TRACKS, LLSDArray(watertrack)(skytrack)) + ( SETTING_TRACKS, llsd::array(watertrack, skytrack)) ( SETTING_FRAMES, frames ) ( SETTING_TYPE, "daycycle" ); @@ -1410,7 +1410,7 @@ LLSD LLSettingsVODay::convertToLegacy(const LLSettingsVODay::ptr_t &pday) skys[name.str()] = std::static_pointer_cast<LLSettingsSky>((*it).second); F32 frame = ((tracksky.size() == 1) && (it == tracksky.begin())) ? -1.0f : (*it).first; - llsdcycle.append( LLSDArray(LLSD::Real(frame))(name.str()) ); + llsdcycle.append( llsd::array(LLSD::Real(frame), name.str()) ); } LLSD llsdskylist(LLSD::emptyMap()); @@ -1423,7 +1423,7 @@ LLSD LLSettingsVODay::convertToLegacy(const LLSettingsVODay::ptr_t &pday) llsdskylist[(*its).first] = llsdsky; } - return LLSDArray(LLSD::emptyMap())(llsdcycle)(llsdskylist)(llsdwater); + return llsd::array(LLSD::emptyMap(), llsdcycle, llsdskylist, llsdwater); } LLSettingsSkyPtr_t LLSettingsVODay::getDefaultSky() const diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 30b5b6605b8a29d62db75f2a519147a0249c30f7..8d1abbde898904f6eed8774b7156863af7ce0d2e 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -2233,12 +2233,14 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject( if (nodep) { uuid_vec_t material_ids; + gltf_materials_vec_t override_materials; S32 num_faces = obj->getNumTEs(); for (S32 face = 0; face < num_faces; face++) { material_ids.push_back(obj->getRenderMaterialID(face)); + override_materials.push_back(nullptr); } - nodep->saveGLTFMaterialIds(material_ids); + nodep->saveGLTFMaterials(material_ids, override_materials); } } else @@ -2252,6 +2254,7 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject( && nodep->mSavedGLTFMaterialIds.size() > face) { nodep->mSavedGLTFMaterialIds[face] = obj->getRenderMaterialID(face); + nodep->mSavedGLTFOverrideMaterials[face] = nullptr; } } } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 8765939bc245afcebd5d27f0ac95967bbcbaba80..d99988eec05ee0fe70b038af2e976d021bbd9a45 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -28,6 +28,7 @@ #define LL_LLVIEWEROBJECT_H #include <map> +#include <unordered_map> #include "llassetstorage.h" //#include "llhudicon.h" diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 272633de765e03e9942f4248fd19749bfe198fa0..22f583e912842f52a4258a4df4715e448085cbde 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -830,13 +830,11 @@ void send_viewer_stats(bool include_preferences) LL_INFOS("LogViewerStatsPacket") << "Sending viewer statistics: " << body << LL_ENDL; - static bool enable_debug_log = debugLoggingEnabled("LogViewerStatsPacket"); - if (enable_debug_log) - { - std::string filename("viewer_stats_packet.xml"); - llofstream of(filename.c_str()); - LLSDSerialize::toPrettyXML(body,of); - } + LL_DEBUGS("LogViewerStatsPacket"); + std::string filename("viewer_stats_packet.xml"); + llofstream of(filename.c_str()); + LLSDSerialize::toPrettyXML(body,of); + LL_ENDL; // The session ID token must never appear in logs body["session_id"] = gAgentSessionID; diff --git a/indra/test/llsdutil_tut.cpp b/indra/test/llsdutil_tut.cpp index 6fce53f335143b5e57eec287a14dbed3684aa716..22efd5439a3f66784434aea23008643741539bb3 100644 --- a/indra/test/llsdutil_tut.cpp +++ b/indra/test/llsdutil_tut.cpp @@ -404,28 +404,28 @@ namespace tut ensure("hash: equivalent values but different types do not match.", boost::hash<LLSD>{}(data_r1) != boost::hash<LLSD>{}(data_i1)); } { - LLSD data_a1 = LLSDArray("A")("B")("C"); - LLSD data_a2 = LLSDArray("A")("B")("C"); + LLSD data_a1 = llsd::array("A", "B", "C"); + LLSD data_a2 = llsd::array("A", "B", "C"); ensure("hash: identical arrays produce identical results", boost::hash<LLSD>{}(data_a1) == boost::hash<LLSD>{}(data_a2)); - data_a2.append(LLSDArray(1)(2)); + data_a2.append(llsd::array(1, 2)); ensure("hash: changing the array changes the hash.", boost::hash<LLSD>{}(data_a1) != boost::hash<LLSD>{}(data_a2)); - data_a1.append(LLSDArray(1)(2)); + data_a1.append(llsd::array(1, 2)); ensure("hash: identical arrays produce identical results with nested arrays", boost::hash<LLSD>{}(data_a1) == boost::hash<LLSD>{}(data_a2)); } { - LLSD data_m1 = LLSDMap("key1", LLSD::Real(3.0))("key2", "value2")("key3", LLSDArray(1)(2)(3)); - LLSD data_m2 = LLSDMap("key1", LLSD::Real(3.0))("key2", "value2")("key3", LLSDArray(1)(2)(3)); + LLSD data_m1 = LLSDMap("key1", LLSD::Real(3.0))("key2", "value2")("key3", llsd::array(1, 2, 3)); + LLSD data_m2 = LLSDMap("key1", LLSD::Real(3.0))("key2", "value2")("key3", llsd::array(1, 2, 3)); ensure("hash: identical maps produce identical results", boost::hash<LLSD>{}(data_m1) == boost::hash<LLSD>{}(data_m2)); - LLSD data_m3 = LLSDMap("key1", LLSD::Real(5.0))("key2", "value2")("key3", LLSDArray(1)(2)(3)); + LLSD data_m3 = LLSDMap("key1", LLSD::Real(5.0))("key2", "value2")("key3", llsd::array(1, 2, 3)); ensure("hash: Different values in the map produce different hashes.", boost::hash<LLSD>{}(data_m1) != boost::hash<LLSD>{}(data_m3)); - LLSD data_m4 = LLSDMap("keyA", LLSD::Real(3.0))("key2", "value2")("key3", LLSDArray(1)(2)(3)); + LLSD data_m4 = LLSDMap("keyA", LLSD::Real(3.0))("key2", "value2")("key3", llsd::array(1, 2, 3)); ensure("hash: Different keys in the map produce different hashes.", boost::hash<LLSD>{}(data_m1) != boost::hash<LLSD>{}(data_m4)); }