From f2601d90bf9cd484cc11f0d3c8f07a634ef33d35 Mon Sep 17 00:00:00 2001 From: Drake Arconis <drake@alchemyviewer.org> Date: Sat, 25 Jul 2015 14:42:37 -0400 Subject: [PATCH] Clean up windows warning supressions --- indra/cmake/00-Common.cmake | 4 +++- indra/llcommon/llallocator_heap_profile.cpp | 7 ------ indra/llcommon/llevents.cpp | 12 ++-------- indra/llcommon/llevents.h | 10 +------- indra/llcommon/llpreprocessor.h | 4 ++-- indra/llcommon/llstacktrace.cpp | 6 ++--- indra/llcommon/llsys.cpp | 26 ++++++++++----------- indra/llmath/llsimdtypes.h | 2 +- indra/llmath/v3color.h | 4 ---- indra/llprimitive/llmodel.cpp | 9 +------ indra/newview/llfloatermodelpreview.cpp | 8 ------- indra/newview/llgroupmgr.cpp | 10 -------- indra/newview/llviewermessage.cpp | 5 ---- indra/newview/llviewerprecompiledheaders.h | 9 ------- indra/newview/llwindebug.h | 14 +++++------ 15 files changed, 33 insertions(+), 97 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 843824aa45..089e56307e 100755 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -69,7 +69,9 @@ if (WINDOWS) /DLL_WINDOWS=1 /DNOMINMAX /DUNICODE - /D_UNICODE + /D_UNICODE + /D_CRT_SECURE_NO_WARNINGS + /D_WINSOCK_DEPRECATED_NO_WARNINGS ) add_compile_options( diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index 38da04cc78..9a8f8133fe 100755 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -32,13 +32,6 @@ #endif #include "llallocator_heap_profile.h" -#if LL_MSVC -// disable warning about boost::lexical_cast returning uninitialized data -// when it fails to parse the string -#pragma warning (disable:4701) -#pragma warning (disable:4702) -#endif - #include <boost/algorithm/string/split.hpp> #include <boost/bind.hpp> #include <boost/lexical_cast.hpp> diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 1c928b3db8..e0a1c12f5c 100755 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -45,21 +45,13 @@ #include <cctype> // external library headers #include <boost/range/iterator_range.hpp> -#if LL_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4701) // compiler thinks might use uninitialized var, but no -#endif #include <boost/lexical_cast.hpp> -#if LL_WINDOWS -#pragma warning (pop) -#endif + // other Linden headers #include "stringize.h" #include "llerror.h" #include "llsdutil.h" -#if LL_MSVC -#pragma warning (disable : 4702) -#endif + /***************************************************************************** * queue_names: specify LLEventPump names that should be instantiated as diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 0cbd1da32d..f0db5ee5d4 100755 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -38,16 +38,8 @@ #include <vector> #include <deque> #include <stdexcept> -#if LL_WINDOWS - #pragma warning (push) - #pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch - #pragma warning (disable : 4264) -#endif -#include <boost/signals2.hpp> -#if LL_WINDOWS - #pragma warning (pop) -#endif +#include <boost/signals2.hpp> #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 2169a3d7ac..02f4e10056 100755 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -150,7 +150,7 @@ #pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden #pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored #pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) -#pragma warning( disable : 4996 ) // warning: deprecated +//#pragma warning( disable : 4996 ) // warning: deprecated // Linker optimization with "extern template" generates these warnings #pragma warning( disable : 4506 ) // no definition for inline function @@ -168,7 +168,7 @@ #pragma warning (disable : 4018) // '<' : signed/unsigned mismatch #if _WIN64 -#pragma warning (disable : 4267) // member needs to have dll-interface to be used by clients of class +#pragma warning (disable : 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data #endif #endif // LL_MSVC diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp index 5798b3b527..4874002383 100755 --- a/indra/llcommon/llstacktrace.cpp +++ b/indra/llcommon/llstacktrace.cpp @@ -33,9 +33,9 @@ #include <sstream> #include "llwin32headerslean.h" -#pragma warning (push) -#pragma warning (disable : 4091) // compiler thinks might use uninitialized var, but no -#include "Dbghelp.h" +#pragma warning (push) +#pragma warning (disable : 4091) // compiler thinks might use uninitialized var, but no +#include "Dbghelp.h" #pragma warning (pop) typedef USHORT NTAPI RtlCaptureStackBackTrace_Function( diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index b94bc28883..fe875a263c 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -303,24 +303,24 @@ LLOSInfo::LLOSInfo() : mOSStringSimple += "32-bit "; } - OSVERSIONINFOEX osvi; - BOOL bOsVersionInfoEx; - // Try calling GetVersionEx using the OSVERSIONINFOEX structure. - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) - { - // If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO. - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi); - } + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + // Try calling GetVersionEx using the OSVERSIONINFOEX structure. + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) + { + // If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO. + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi); + } std::string tmpstr; if (bOsVersionInfoEx) { - mMajorVer = osvi.dwMajorVersion; - mMinorVer = osvi.dwMinorVersion; + mMajorVer = osvi.dwMajorVersion; + mMinorVer = osvi.dwMinorVersion; mBuild = osvi.dwBuildNumber; tmpstr = llformat("%s(Build %d)", service_pack.c_str(), mBuild); } diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index 9c4a0b1a82..8cb36e2af8 100755 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h @@ -36,7 +36,7 @@ typedef __m128 LLQuad; #if LL_WINDOWS #pragma warning(push) -#pragma warning( disable : 4800 3 ) // Disable warning about casting int to bool for this class. +#pragma warning( disable : 4800 ) // Disable warning about casting int to bool for this class. #endif // LL_WINDOWS class LLBool32 diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index daf3a6857b..d5934ddbf8 100755 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -181,10 +181,6 @@ inline LLColor3::LLColor3(const F32 *vec) mV[VZ] = vec[VZ]; } -#if LL_WINDOWS -# pragma warning( disable : 4996 ) // strncpy teh sux0r -#endif - inline LLColor3::LLColor3(const char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF { if (strlen(color_string) < 6) /* Flawfinder: ignore */ diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 3f56677594..7ff802f76b 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -31,18 +31,11 @@ #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_USESYSTEMLIBS # include <zlib.h> diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 238358ce07..f2f3be3022 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -26,10 +26,6 @@ #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" @@ -51,10 +47,6 @@ #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/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index f3a9032ca8..3a8704010f 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -54,18 +54,8 @@ #include "llviewerregion.h" #include <boost/regex.hpp> #include <boost/format.hpp> - -#if LL_MSVC -#pragma warning(push) -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - #include <boost/lexical_cast.hpp> -#if LL_MSVC -#pragma warning(pop) // Restore all warnings to the previous state -#endif const U32 MAX_CACHED_GROUPS = 20; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 87ae14b6b2..1acd2647ac 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -127,11 +127,6 @@ #include "llosxnotificationcenter.h" #endif -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - extern void on_new_message(const LLSD& msg); // diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 999d9092bd..c28d1f3053 100755 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -35,21 +35,12 @@ #include "linden_common.h" -// Work around stupid Microsoft STL warning -#ifdef LL_WINDOWS -#pragma warning (disable : 4702) // warning C4702: unreachable code -#endif - #include <algorithm> #include <deque> #include <functional> #include <map> #include <set> -#ifdef LL_WINDOWS -#pragma warning (3 : 4702) // we like level 3, not 4 -#endif - // Library headers from llcommon project: #include "indra_constants.h" #include "llinitparam.h" diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h index 1afca3e3de..dfdb83e50c 100755 --- a/indra/newview/llwindebug.h +++ b/indra/newview/llwindebug.h @@ -30,13 +30,13 @@ #include "stdtypes.h" #include "llwin32headerslean.h" -#if LL_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4091) -#endif -#include <dbghelp.h> -#if LL_WINDOWS -#pragma warning (pop) +#if LL_WINDOWS +#pragma warning (push) +#pragma warning (disable : 4091) +#endif +#include <dbghelp.h> +#if LL_WINDOWS +#pragma warning (pop) #endif class LLWinDebug: -- GitLab