diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index fe4fb2676..66a845738 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -57,10 +57,10 @@ public: LLUUID(); explicit LLUUID(const char *in_string); // Convert from string. explicit LLUUID(const std::string& in_string); // Convert from string. - LLUUID(const LLUUID &in); - LLUUID &operator=(const LLUUID &rhs); + LLUUID(const LLUUID &in) = default; + LLUUID &operator=(const LLUUID &rhs) = default; - ~LLUUID(); + ~LLUUID() = default; // // MANIPULATORS @@ -193,24 +193,6 @@ inline BOOL LLUUID::isNull() const return !memcmp(mData, null.mData, sizeof(mData)); // } -// Copy constructor -inline LLUUID::LLUUID(const LLUUID& rhs) -{ - memcpy(mData, rhs.mData, sizeof(mData)); // -} - -inline LLUUID::~LLUUID() -{ -} - -// Assignment -inline LLUUID& LLUUID::operator=(const LLUUID& rhs) -{ - memcpy(mData, rhs.mData, sizeof(mData)); // - return *this; -} - - inline LLUUID::LLUUID(const char *in_string) { if (!in_string || in_string[0] == 0) @@ -289,6 +271,8 @@ inline U32 LLUUID::getCRC32() const // } +static_assert(std::is_trivially_copyable{}, "LLUUID must be a trivially copyable type"); + typedef std::vector uuid_vec_t; typedef boost::unordered_set uuid_set_t; diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h index 6d896613c..ea0c99237 100644 --- a/indra/llmath/llmatrix3a.h +++ b/indra/llmath/llmatrix3a.h @@ -127,4 +127,6 @@ public: inline bool isOkRotation() const; } LL_ALIGN_POSTFIX(16); +static_assert(std::is_trivially_copyable{}, "LLMatrix3a must be a trivially copyable type"); +static_assert(std::is_trivially_copyable{}, "LLRotation must be a trivially copyable type"); #endif diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index 7dab479bd..7334eec52 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -708,4 +708,6 @@ inline std::ostream& operator<<(std::ostream& s, const LLMatrix4a& m) } void matMulBoundBox(const LLMatrix4a &a, const LLVector4a *in_extents, LLVector4a *out_extents); + +static_assert(std::is_trivially_copyable{}, "LLMatrix4a must be a trivially copyable type"); #endif diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index e7a279fb4..87b272008 100644 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -191,6 +191,8 @@ inline void LLQuaternion::setValue(const LLSD& sd) mQ[3] = sd[3].asReal(); } +static_assert(std::is_trivially_copyable{}, "LLQuaternion must be a trivially copyable type"); + // checker inline BOOL LLQuaternion::isFinite() const { diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index 6cfe91a02..b93d0471b 100644 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h @@ -105,4 +105,6 @@ protected: } LL_ALIGN_POSTFIX(16); +static_assert(std::is_trivially_copyable{}, "LLQuaternion2 must be a trivially copyable type"); + #endif diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index bd991d0e7..2861fa9b0 100644 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h @@ -121,4 +121,7 @@ private: LLQuad mQ; }; +static_assert(std::is_trivially_copyable{}, "LLBool32 must be a trivially copyable type"); +static_assert(std::is_trivially_copyable{}, "LLSimdScalar must be a trivially copyable type"); + #endif //LL_SIMD_TYPES_H diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index a34e3ec88..2b7cf10cb 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -96,12 +96,12 @@ public: { //DO NOT INITIALIZE -- The overhead is completely unnecessary ll_assert_aligned(this,16); } - + LLVector4a(F32 x, F32 y, F32 z, F32 w = 0.f) { - set(x,y,z,w); + set(x, y, z, w); } - + LLVector4a(F32 x) { splat(x); @@ -320,9 +320,13 @@ public: //////////////////////////////////// // Do NOT add aditional operators without consulting someone with SSE experience - inline const LLVector4a& operator= ( const LLVector4a& rhs ); + //inline const LLVector4a& operator= ( const LLVector4a& rhs ); + //{ + // mQ = rhs.mQ; + // return *this; + //} - inline const LLVector4a& operator= ( const LLQuad& rhs ); + inline const LLVector4a& operator= (const LLQuad& rhs); inline operator LLQuad() const; @@ -341,4 +345,6 @@ inline std::ostream& operator<<(std::ostream& s, const LLVector4a& v) s << "(" << v[0] << ", " << v[1] << ", " << v[2] << ", " << v[3] << ")"; return s; } + +static_assert(std::is_trivially_copyable{}, "LLVector4a must be a trivially copyable type"); #endif diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index c3499d23d..40d67c86b 100644 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -605,13 +605,7 @@ inline bool LLVector4a::equals3(const LLVector4a& rhs, F32 tolerance ) const //////////////////////////////////// // Do NOT add aditional operators without consulting someone with SSE experience -inline const LLVector4a& LLVector4a::operator= ( const LLVector4a& rhs ) -{ - mQ = rhs.mQ; - return *this; -} - -inline const LLVector4a& LLVector4a::operator= ( const LLQuad& rhs ) +inline const LLVector4a& LLVector4a::operator= (const LLQuad& rhs) { mQ = rhs; return *this; diff --git a/indra/llmath/m3math.h b/indra/llmath/m3math.h index 1bf42fefa..5822ff044 100644 --- a/indra/llmath/m3math.h +++ b/indra/llmath/m3math.h @@ -144,6 +144,8 @@ class LLMatrix3 friend std::ostream& operator<<(std::ostream& s, const LLMatrix3 &a); // Stream a }; +static_assert(std::is_trivially_copyable{}, "LLMatrix3 must be a trivially copyable type"); + inline LLMatrix3::LLMatrix3(void) { mMatrix[0][0] = 1.f; diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index 09253c75b..a225c51b1 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -152,10 +152,6 @@ LLMatrix4::LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw) mMatrix[3][3] = 1.f; } -LLMatrix4::~LLMatrix4(void) -{ -} - // Clear and Assignment Functions const LLMatrix4& LLMatrix4::setZero() diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index bf031678c..01739218b 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -117,7 +117,7 @@ public: const LLVector4 &pos); // Initializes Matrix with Euler angles LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw); // Initializes Matrix with Euler angles - ~LLMatrix4(void); // Destructor + ~LLMatrix4() = default; // Destructor LLSD getValue() const; void setValue(const LLSD&); @@ -246,6 +246,8 @@ public: friend std::ostream& operator<<(std::ostream& s, const LLMatrix4 &a); // Stream a }; +static_assert(std::is_trivially_copyable{}, "LLMatrix4 must be a trivially copyable type"); + inline const LLMatrix4& LLMatrix4::setIdentity() { mMatrix[0][0] = 1.f; diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index b738fe70c..cc00096cc 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -110,6 +110,7 @@ class LLVector2 friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a); // Stream a }; +static_assert(std::is_trivially_copyable{}, "LLVector2 must be a trivially copyable type"); // Non-member functions diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index 1a5cbeb51..d9a7f6286 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -140,6 +140,8 @@ public: inline void exp(); // Do an exponential on the color }; +static_assert(std::is_trivially_copyable{}, "LLColor3 must be a trivially copyable type"); + LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u); diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index dae0b3077..eed1ed061 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -130,6 +130,8 @@ class LLVector3d }; +static_assert(std::is_trivially_copyable{}, "LLVector3d must be a trivially copyable type"); + typedef LLVector3d LLGlobalVec; inline const LLVector3d &LLVector3d::set(const LLVector3 &vec) diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 71ca661dd..65122b894 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -149,6 +149,8 @@ class LLVector3 static BOOL parseVector3(const std::string& buf, LLVector3* value); }; +static_assert(std::is_trivially_copyable{}, "LLVector3 must be a trivially copyable type"); + typedef LLVector3 LLSimLocalVec; // Non-member functions diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index 2297a6616..e23d51075 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -222,6 +222,7 @@ class LLColor4 inline void clamp(); }; +static_assert(std::is_trivially_copyable{}, "LLColor4 must be a trivially copyable type"); // Non-member functions F32 distVec(const LLColor4 &a, const LLColor4 &b); // Returns distance between a and b diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 36d8db45f..7eb9a2929 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -139,6 +139,7 @@ public: static LLColor4U blue; }; +static_assert(std::is_trivially_copyable{}, "LLColor4U must be a trivially copyable type"); // Non-member functions F32 distVec(const LLColor4U &a, const LLColor4U &b); // Returns distance between a and b diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index a179ced70..5cfed4dc7 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -137,6 +137,8 @@ class LLVector4 friend LLVector4 operator-(const LLVector4 &a); // Return vector -a }; +static_assert(std::is_trivially_copyable{}, "LLVector4 must be a trivially copyable type"); + // Non-member functions F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b BOOL are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel diff --git a/indra/llprimitive/llmaterialid.cpp b/indra/llprimitive/llmaterialid.cpp index 820f62c43..fc72961ea 100644 --- a/indra/llprimitive/llmaterialid.cpp +++ b/indra/llprimitive/llmaterialid.cpp @@ -56,15 +56,6 @@ LLMaterialID::LLMaterialID(const void* pMemory) set(pMemory); } -LLMaterialID::LLMaterialID(const LLMaterialID& pOtherMaterialID) -{ - copyFromOtherMaterialID(pOtherMaterialID); -} - -LLMaterialID::~LLMaterialID() -{ -} - bool LLMaterialID::operator == (const LLMaterialID& pOtherMaterialID) const { return (compareToOtherMaterialID(pOtherMaterialID) == 0); @@ -95,12 +86,6 @@ bool LLMaterialID::operator >= (const LLMaterialID& pOtherMaterialID) const return (compareToOtherMaterialID(pOtherMaterialID) >= 0); } -LLMaterialID& LLMaterialID::operator = (const LLMaterialID& pOtherMaterialID) -{ - copyFromOtherMaterialID(pOtherMaterialID); - return (*this); -} - bool LLMaterialID::isNull() const { return (compareToOtherMaterialID(LLMaterialID::null) == 0); @@ -116,12 +101,12 @@ void LLMaterialID::set(const void* pMemory) llassert(pMemory != NULL); // assumes that the required size of memory is available - memcpy(mID, pMemory, MATERIAL_ID_SIZE * sizeof(U8)); + memcpy(mID, pMemory, sizeof(mID)); } void LLMaterialID::clear() { - memset(mID, 0, MATERIAL_ID_SIZE * sizeof(U8)); + memset(mID, 0, sizeof(mID)); } LLSD LLMaterialID::asLLSD() const @@ -156,18 +141,12 @@ std::ostream& operator<<(std::ostream& s, const LLMaterialID &material_id) return s; } - void LLMaterialID::parseFromBinary (const LLSD::Binary& pMaterialID) { llassert(pMaterialID.size() == (MATERIAL_ID_SIZE * sizeof(U8))); memcpy(mID, &pMaterialID[0], MATERIAL_ID_SIZE * sizeof(U8)); } -void LLMaterialID::copyFromOtherMaterialID(const LLMaterialID& pOtherMaterialID) -{ - memcpy(mID, pOtherMaterialID.get(), MATERIAL_ID_SIZE * sizeof(U8)); -} - int LLMaterialID::compareToOtherMaterialID(const LLMaterialID& pOtherMaterialID) const { int retVal = 0; diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index b4c82d3b7..8036db2d9 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -39,8 +39,8 @@ public: LLMaterialID(const LLSD& pMaterialID); LLMaterialID(const LLSD::Binary& pMaterialID); LLMaterialID(const void* pMemory); - LLMaterialID(const LLMaterialID& pOtherMaterialID); - ~LLMaterialID(); + LLMaterialID(const LLMaterialID& pOtherMaterialID) = default; + ~LLMaterialID() = default; bool operator == (const LLMaterialID& pOtherMaterialID) const; bool operator != (const LLMaterialID& pOtherMaterialID) const; @@ -50,7 +50,7 @@ public: bool operator > (const LLMaterialID& pOtherMaterialID) const; bool operator >= (const LLMaterialID& pOtherMaterialID) const; - LLMaterialID& operator = (const LLMaterialID& pOtherMaterialID); + LLMaterialID& operator = (const LLMaterialID& pOtherMaterialID) = default; bool isNull() const; @@ -67,11 +67,13 @@ public: private: void parseFromBinary(const LLSD::Binary& pMaterialID); - void copyFromOtherMaterialID(const LLMaterialID& pOtherMaterialID); int compareToOtherMaterialID(const LLMaterialID& pOtherMaterialID) const; U8 mID[MATERIAL_ID_SIZE]; } ; +static_assert(sizeof(LLMaterialID) == MATERIAL_ID_SIZE, "LLMaterialID must be sizeof(mID)"); +static_assert(std::is_trivially_copyable{}, "LLMaterialID must be a trivially copyable type"); + #endif // LL_LLMATERIALID_H diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e2e34538b..1b0501973 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1592,6 +1592,11 @@ BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } +bool always_underline_links() +{ + static const LLUICachedControl always_underline("SinguAlwaysUnderlineLinks"); + return always_underline; +} BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) { @@ -1684,7 +1689,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) if (old_hover != mHoverSegment) { - if (old_hover) + if (old_hover && !always_underline_links()) old_hover->underlineOnHover(false); if (mHoverSegment) mHoverSegment->underlineOnHover(true); @@ -1699,7 +1704,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) void LLTextEditor::onMouseLeave(S32 x, S32 y, MASK mask) { - if (mHoverSegment) + if (mHoverSegment && !always_underline_links()) { mHoverSegment->underlineOnHover(false); mHoverSegment = nullptr; @@ -4308,7 +4313,9 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s } // Hack around colors looking bad on some backgrounds by allowing setting link color for this editor if (mLinkColor) link_style->setColor(*mLinkColor); - appendAndHighlightText(link, part, link_style, true/*match.underlineOnHoverOnly()*/); + const auto always_underline(always_underline_links()); + if (always_underline) link_style->mUnderline = true; + appendAndHighlightText(link, part, link_style, !always_underline/*match.underlineOnHoverOnly()*/); }; const auto&& cb = force_replace_links ? boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3) : LLUrlLabelCallback::slot_function_type(); while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, cb)) diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index 561f53c4b..74b1da1b5 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -32,6 +32,7 @@ #include "linden_common.h" #include "lluistring.h" +#include "llfasttimer.h" #include "llsd.h" #include "lltrans.h" diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index ff2f40154..5c2f1ea63 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -1131,6 +1131,17 @@ Changing this setting only affects new text. Value 0 + SinguAlwaysUnderlineLinks + + Comment + Enable to always underline new links in text editors (and any you hover over after enabling this) + Persist + 1 + Type + Boolean + Value + 0 + SingularitySplashPagePrefix Comment diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 4aaf69c1b..f7eb591ac 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -771,21 +771,21 @@ namespace action_give_inventory std::string items; build_items_string(inventory_selected_uuids, items); - bool folders_count = false; // Singu Note: Was a count, but break right after == 1, so bool. + auto folders_count = 0; //traverse through selected inventory items and count folders among them for (const auto& id : inventory_selected_uuids) { if (gInventory.getCategory(id)) { - folders_count = true; - break; + if (++folders_count == 2) + break; } } // EXP-1599 // In case of sharing multiple folders, make the confirmation // dialog contain a warning that only one folder can be shared at a time. - std::string notification = folders_count ? "ShareFolderConfirmation" : "ShareItemsConfirmation"; + std::string notification = folders_count == 2 ? "ShareFolderConfirmation" : "ShareItemsConfirmation"; LLSD substitutions; substitutions["RESIDENTS"] = residents; substitutions["ITEMS"] = items; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index a224b2e22..9676acf0c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -423,6 +423,7 @@ viewer_media_t LLViewerMedia::newMediaImpl( media_impl->mMediaAutoScale = media_auto_scale; media_impl->mMediaLoop = media_loop; } + media_impl->setPageZoomFactor(media_impl->mZoomFactor); return media_impl; } @@ -1711,6 +1712,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ media_source->setTarget(target); media_source->setSize(default_width, default_height); media_source->setZoomFactor(zoom_factor); + media_source->set_page_zoom_factor(zoom_factor); return media_source; } @@ -2700,6 +2702,9 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask) case 'C': mMediaSource->copy(); break; case 'V': mMediaSource->paste(); break; case 'X': mMediaSource->cut(); break; + case '=': setPageZoomFactor(mZoomFactor + .1); break; + case '-': setPageZoomFactor(mZoomFactor - .1); break; + case '0': setPageZoomFactor(1.0); break; default: result = false; break; }