From d089e6c26452a61fa3b33b71735bc39d90701865 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 19:16:49 -0800
Subject: [PATCH] bumped up MSVC warning level to 3 to catch more stuff that
 gcc catches

---
 indra/cmake/00-Common.cmake             | 4 ++--
 indra/llcommon/llpreprocessor.h         | 1 +
 indra/llplugin/llpluginclassmedia.h     | 2 +-
 indra/llplugin/llplugininstance.h       | 2 +-
 indra/llplugin/llpluginmessagepipe.h    | 2 +-
 indra/llplugin/llpluginprocessparent.h  | 2 +-
 indra/llprimitive/llmodel.cpp           | 9 ++++++++-
 indra/llrender/llvertexbuffer.cpp       | 2 +-
 indra/newview/llfloatermodelpreview.cpp | 8 ++++++++
 indra/newview/llviewerwindow.cpp        | 1 +
 indra/newview/llvovolume.cpp            | 2 +-
 indra/newview/llvovolume.h              | 6 ++++--
 12 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 0266239454c..98eeed09b3a 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -46,7 +46,7 @@ if (WINDOWS)
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
       CACHE STRING "C++ compiler debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO 
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob2 -D_SECURE_STL=0"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
       "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
@@ -62,7 +62,7 @@ if (WINDOWS)
       /D_UNICODE 
       /GS
       /TP
-      /W2
+      /W3
       /c
       /Zc:forScope
       /nologo
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 17a42875385..31d5f3d2c7e 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -151,6 +151,7 @@
 
 #pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
 #pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
+#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch	
 #endif	//	LL_MSVC
 
 #if LL_WINDOWS
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index d95fa400919..a0edd9f5f72 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -41,7 +41,7 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 	LOG_CLASS(LLPluginClassMedia);
 public:
 	LLPluginClassMedia(LLPluginClassMediaOwner *owner);
-	~LLPluginClassMedia();
+	virtual ~LLPluginClassMedia();
 
 	// local initialization, called by the media manager when creating a source
 	bool init(const std::string &launcher_filename, 
diff --git a/indra/llplugin/llplugininstance.h b/indra/llplugin/llplugininstance.h
index 3643a15d8c2..e6926c3e377 100644
--- a/indra/llplugin/llplugininstance.h
+++ b/indra/llplugin/llplugininstance.h
@@ -39,7 +39,7 @@
 class LLPluginInstanceMessageListener
 {
 public:
-	~LLPluginInstanceMessageListener();
+	virtual ~LLPluginInstanceMessageListener();
    /** Plugin receives message from plugin loader shell. */
 	virtual void receivePluginMessage(const std::string &message) = 0;
 };
diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h
index beb942c0fe0..c6f1686bf4f 100644
--- a/indra/llplugin/llpluginmessagepipe.h
+++ b/indra/llplugin/llpluginmessagepipe.h
@@ -40,7 +40,7 @@ class LLPluginMessagePipeOwner
 	LOG_CLASS(LLPluginMessagePipeOwner);
 public:
 	LLPluginMessagePipeOwner();
-	~LLPluginMessagePipeOwner();
+	virtual ~LLPluginMessagePipeOwner();
 
 	// called with incoming messages
 	virtual void receiveMessageRaw(const std::string &message) = 0;
diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h
index 26c6b0c4027..c66723f1753 100644
--- a/indra/llplugin/llpluginprocessparent.h
+++ b/indra/llplugin/llpluginprocessparent.h
@@ -41,7 +41,7 @@
 class LLPluginProcessParentOwner
 {
 public:
-	~LLPluginProcessParentOwner();
+	virtual ~LLPluginProcessParentOwner();
 	virtual void receivePluginMessage(const LLPluginMessage &message) = 0;
 	virtual bool receivePluginMessageEarly(const LLPluginMessage &message) {return false;};
 	// This will only be called when the plugin has died unexpectedly 
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 6e4bb7ec973..cb32a510b80 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -31,11 +31,18 @@
 #include "llconvexdecomposition.h"
 #include "llsdserialize.h"
 #include "llvector4a.h"
-
+#if LL_MSVC
+#pragma warning (disable : 4263)
+#pragma warning (disable : 4264)
+#endif
 #include "dae.h"
 #include "dae/daeErrorHandler.h"
 #include "dom/domConstants.h"
 #include "dom/domMesh.h"
+#if LL_MSVC
+#pragma warning (default : 4263)
+#pragma warning (default : 4264)
+#endif
 
 #ifdef LL_STANDALONE
 # include <zlib.h>
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 8fd11937801..ad2385dcf4f 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -84,7 +84,7 @@ class LLGLSyncFence : public LLGLFence
 #endif
 	}
 
-	~LLGLSyncFence()
+	virtual ~LLGLSyncFence()
 	{
 #ifdef GL_ARB_sync
 		if (mSync)
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 881f087d7b7..c716a7ecf7e 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -26,6 +26,10 @@
 
 #include "llviewerprecompiledheaders.h"
 
+#if LL_MSVC
+#pragma warning (disable : 4263)
+#pragma warning (disable : 4264)
+#endif
 #include "dae.h"
 //#include "dom.h"
 #include "dom/domAsset.h"
@@ -47,6 +51,10 @@
 #include "dom/domScale.h"
 #include "dom/domTranslate.h"
 #include "dom/domVisual_scene.h"
+#if LL_MSVC
+#pragma warning (default : 4263)
+#pragma warning (default : 4264)
+#endif
 
 #include "llfloatermodelpreview.h"
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 2479006eeb7..7bc4248053a 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4107,6 +4107,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	if ( size.mX != new_width
 		|| size.mY != new_height)
 	{
+		S32 x = 0;
 		LLCoordWindow new_size(new_width, new_height);
 		LLCoordScreen screen_size;
 		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 380d63c77b9..1bf991a3a92 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3266,7 +3266,7 @@ void LLVOVolume::updateRenderComplexity()
 	mRenderComplexity_current = 0;
 }
 
-U32 LLVOVolume::getTriangleCount() const
+U32 LLVOVolume::getTriangleCount()
 {
 	U32 count = 0;
 	LLVolume* volume = getVolume();
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index b6347526eee..22648ce46f8 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -131,9 +131,11 @@ class LLVOVolume : public LLViewerObject
 	/*virtual*/	const LLMatrix4	getRenderMatrix() const;
 				typedef std::map<LLUUID, S32> texture_cost_t;
 				U32 	getRenderCost(texture_cost_t &textures) const;
-	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
 
-	/*virtual*/ U32		getTriangleCount() const;
+				F32		getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const;
+	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL) { return getStreamingCost(bytes, visible_bytes, NULL); }
+
+	/*virtual*/ U32		getTriangleCount();
 	/*virtual*/ U32		getHighLODTriangleCount();
 	/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, 
 										  S32 face = -1,                        // which face to check, -1 = ALL_SIDES
-- 
GitLab