From 795a91370d0c899ef2d6e1d7dee98f941a93b041 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Fri, 21 Aug 2020 07:45:31 -0400
Subject: [PATCH] Cleanup of operators and constructors that should be deleted

---
 indra/llmath/llrigginginfo.h         |  4 ++--
 indra/llmath/llvolumeoctree.h        | 29 +++++-----------------------
 indra/llrender/llatmosphere.h        | 11 ++---------
 indra/llrender/llfontgl.cpp          | 11 -----------
 indra/llrender/llfontgl.h            |  4 ++--
 indra/llrender/llvertexbuffer.h      | 14 ++------------
 indra/newview/lldrawable.h           | 14 ++------------
 indra/newview/llface.h               | 13 ++-----------
 indra/newview/llinventoryclipboard.h |  4 ++--
 indra/newview/llspatialpartition.h   | 25 ++++--------------------
 10 files changed, 23 insertions(+), 106 deletions(-)

diff --git a/indra/llmath/llrigginginfo.h b/indra/llmath/llrigginginfo.h
index b3d6bc2d19d..54b9170ca8c 100644
--- a/indra/llmath/llrigginginfo.h
+++ b/indra/llmath/llrigginginfo.h
@@ -89,8 +89,8 @@ class LLJointRiggingInfoTab
     void setNeedsUpdate(bool val) { mNeedsUpdate = val; }
 private:
     // Not implemented
-    LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src);
-    LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src);
+    LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src) = delete;
+    LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src) = delete;
 
     LLJointRiggingInfo *mRigInfoPtr;
     S32 mSize;
diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h
index 13150028d82..67677103162 100644
--- a/indra/llmath/llvolumeoctree.h
+++ b/indra/llmath/llvolumeoctree.h
@@ -52,21 +52,10 @@ class LLVolumeTriangle : public LLRefCount
 		mBinIndex = -1;	
 	}
 
-	LLVolumeTriangle(const LLVolumeTriangle& rhs)
-	{
-		*this = rhs;
-	}
+	LLVolumeTriangle(const LLVolumeTriangle& rhs) = delete;
+	LLVolumeTriangle& operator=(const LLVolumeTriangle& rhs) = delete;
 
-	const LLVolumeTriangle& operator=(const LLVolumeTriangle& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
-
-	~LLVolumeTriangle()
-	{
-	
-	}
+	~LLVolumeTriangle() = default;
 
 	LL_ALIGN_16(LLVector4a mPositionGroup);
 
@@ -103,16 +92,8 @@ class LLVolumeOctreeListener : public LLOctreeListener<LLVolumeTriangle>
 	LLVolumeOctreeListener(LLOctreeNode<LLVolumeTriangle>* node);
 	~LLVolumeOctreeListener();
 	
-	LLVolumeOctreeListener(const LLVolumeOctreeListener& rhs)
-	{
-		*this = rhs;
-	}
-
-	const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
+	LLVolumeOctreeListener(const LLVolumeOctreeListener& rhs) = delete;
+    LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs) = delete;
 
 	 //LISTENER FUNCTIONS
 	virtual void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent, 
diff --git a/indra/llrender/llatmosphere.h b/indra/llrender/llatmosphere.h
index 572365d864e..d49487f4815 100644
--- a/indra/llrender/llatmosphere.h
+++ b/indra/llrender/llatmosphere.h
@@ -133,11 +133,7 @@ class LLAtmosphere
     static void initClass();
     static void cleanupClass();
 
-    const LLAtmosphere& operator=(const LLAtmosphere& rhs)
-    {
-        LL_ERRS() << "Illegal operation!" << LL_ENDL;
-        return *this;
-    }
+    const LLAtmosphere& operator=(const LLAtmosphere& rhs) = delete;
 
     LLGLTexture* getTransmittance();
     LLGLTexture* getScattering();
@@ -147,10 +143,7 @@ class LLAtmosphere
     bool configureAtmosphericModel(AtmosphericModelSettings& settings);
 
 protected:    
-    LLAtmosphere(const LLAtmosphere& rhs)
-    {
-        *this = rhs;
-    }
+    LLAtmosphere(const LLAtmosphere& rhs) = delete;
 
     LLPointer<LLGLTexture> m_transmittance;
     LLPointer<LLGLTexture> m_scattering;
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index fbb5841fb9b..abb3dcf7a6f 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -1127,17 +1127,6 @@ std::string LLFontGL::getFontPathLocal()
 	return local_path;
 }
 
-LLFontGL::LLFontGL(const LLFontGL &source)
-{
-	LL_ERRS() << "Not implemented!" << LL_ENDL;
-}
-
-LLFontGL &LLFontGL::operator=(const LLFontGL &source)
-{
-	LL_ERRS() << "Not implemented" << LL_ENDL;
-	return *this;
-}
-
 void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const
 {
 	S32 index = 0;
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index 10891faed9c..ea9bd7686ce 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -217,8 +217,8 @@ class LLFontGL
 	friend class LLTextBillboard;
 	friend class LLHUDText;
 
-	LLFontGL(const LLFontGL &source);
-	LLFontGL &operator=(const LLFontGL &source);
+	LLFontGL(const LLFontGL &source) = delete;
+	LLFontGL &operator=(const LLFontGL &source) = delete;
 
 	LLFontDescriptor mFontDescriptor;
 	LLPointer<LLFontFreetype> mFontFreetype;
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 4c5830644e8..bd99ef7feff 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -109,18 +109,8 @@ class LLVertexBuffer : public LLRefCount, public LLTrace::MemTrackable<LLVertexB
 		MappedRegion(S32 type, S32 index, S32 count);
 	};
 
-	LLVertexBuffer(const LLVertexBuffer& rhs)
-	:	LLTrace::MemTrackable<LLVertexBuffer>("LLVertexBuffer"),
-		mUsage(rhs.mUsage)
-	{
-		*this = rhs;
-	}
-
-	const LLVertexBuffer& operator=(const LLVertexBuffer& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
+	LLVertexBuffer(const LLVertexBuffer& rhs) = delete;
+	const LLVertexBuffer& operator=(const LLVertexBuffer& rhs) = delete;
 
 	static LLVBOPool sStreamVBOPool;
 	static LLVBOPool sDynamicVBOPool;
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index 14d782d6f26..5eaf9d4d97e 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -64,18 +64,8 @@ class LLDrawable
 	public LLTrace::MemTrackable<LLDrawable, 16>
 {
 public:
-	LLDrawable(const LLDrawable& rhs) 
-	:	LLTrace::MemTrackable<LLDrawable, 16>("LLDrawable"),
-		LLViewerOctreeEntryData(rhs)
-	{
-		*this = rhs;
-	}
-
-	const LLDrawable& operator=(const LLDrawable& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
+	LLDrawable(const LLDrawable& rhs) = delete;
+	LLDrawable& operator=(const LLDrawable& rhs) = delete;
 
 	static void initClass();
 
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 7e362be5eb2..0a15aef14ce 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -56,17 +56,8 @@ const F32 MIN_TEX_ANIM_SIZE = 512.f;
 class LLFace : public LLTrace::MemTrackableNonVirtual<LLFace, 16>
 {
 public:
-	LLFace(const LLFace& rhs)
-	:	LLTrace::MemTrackableNonVirtual<LLFace, 16>("LLFace")
-	{
-		*this = rhs;
-	}
-
-	const LLFace& operator=(const LLFace& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
+	LLFace(const LLFace& rhs) = delete;
+	LLFace& operator=(const LLFace& rhs) = delete;
 
 	enum EMasks
 	{
diff --git a/indra/newview/llinventoryclipboard.h b/indra/newview/llinventoryclipboard.h
index b9f1451e5c1..7ae6893bdfe 100644
--- a/indra/newview/llinventoryclipboard.h
+++ b/indra/newview/llinventoryclipboard.h
@@ -78,8 +78,8 @@ class LLInventoryClipboard
 	~LLInventoryClipboard();
 private:
 	// please don't implement these
-	LLInventoryClipboard(const LLInventoryClipboard&);
-	LLInventoryClipboard& operator=(const LLInventoryClipboard&);
+	LLInventoryClipboard(const LLInventoryClipboard&) = delete;
+	LLInventoryClipboard& operator=(const LLInventoryClipboard&) = delete;
 };
 
 
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 3dec14270ca..af65ea3d3d3 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -61,17 +61,8 @@ class LLDrawInfo : public LLRefCount, public LLTrace::MemTrackableNonVirtual<LLD
 	~LLDrawInfo();	
 	
 public:
-	LLDrawInfo(const LLDrawInfo& rhs)
-	:	LLTrace::MemTrackableNonVirtual<LLDrawInfo, 16>("LLDrawInfo")
-	{
-		*this = rhs;
-	}
-
-	const LLDrawInfo& operator=(const LLDrawInfo& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
+	LLDrawInfo(const LLDrawInfo& rhs) = delete;
+    LLDrawInfo& operator=(const LLDrawInfo& rhs) = delete;
 
 	LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, 
 				LLViewerTexture* image, LLVertexBuffer* buffer, 
@@ -199,16 +190,8 @@ class LLSpatialGroup : public LLOcclusionCullingGroup
 	friend class LLOctreeStateCheck;
 public:
 
-	LLSpatialGroup(const LLSpatialGroup& rhs) : LLOcclusionCullingGroup(rhs)
-	{
-		*this = rhs;
-	}
-
-	const LLSpatialGroup& operator=(const LLSpatialGroup& rhs)
-	{
-		LL_ERRS() << "Illegal operation!" << LL_ENDL;
-		return *this;
-	}
+	LLSpatialGroup(const LLSpatialGroup& rhs) = delete;
+	LLSpatialGroup& operator=(const LLSpatialGroup& rhs) = delete;
 
 	static U32 sNodeCount;
 	static BOOL sNoDelete; //deletion of spatial groups and draw info not allowed if TRUE
-- 
GitLab