From 6f2eec3c2ea718fd25867f131dc09e864c597c3e Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Wed, 4 Jan 2012 13:19:38 +0000 Subject: [PATCH] Fix warnings This was SVN commit r10867. --- source/lib/pch/pch_warnings.h | 2 ++ source/lib/sysdep/os/win/mahaf.cpp | 4 ++++ source/simulation2/components/CCmpUnitMotion.cpp | 2 -- source/tools/atlas/AtlasObject/AtlasObjectJS.cpp | 4 ++++ source/tools/atlas/AtlasScript/ScriptInterface.cpp | 4 ++++ source/tools/atlas/AtlasUI/Misc/precompiled.h | 4 ++-- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/source/lib/pch/pch_warnings.h b/source/lib/pch/pch_warnings.h index e6e65cb4eb..6f61c43913 100644 --- a/source/lib/pch/pch_warnings.h +++ b/source/lib/pch/pch_warnings.h @@ -20,6 +20,8 @@ # if MSC_VERSION >= 1400 # pragma warning(disable:6011) // dereferencing NULL pointer # pragma warning(disable:6246) // local declaration hides declaration of the same name in outer scope +# pragma warning(disable:6326) // potential comparison of a constant with another constant +# pragma warning(disable:6334) // sizeof operator applied to an expression with an operator might yield unexpected results # endif // .. Intel-specific # if ICC_VERSION diff --git a/source/lib/sysdep/os/win/mahaf.cpp b/source/lib/sysdep/os/win/mahaf.cpp index b6c7cfcf35..cf583088b5 100644 --- a/source/lib/sysdep/os/win/mahaf.cpp +++ b/source/lib/sysdep/os/win/mahaf.cpp @@ -248,6 +248,8 @@ static void UninstallDriver() } +#if CONFIG2_MAHAF_ATTEMPT_DRIVER_START + static void StartDriver(const OsPath& driverPathname) { const SC_HANDLE hSCM = OpenServiceControlManager(SC_MANAGER_CREATE_SERVICE); @@ -338,6 +340,8 @@ static OsPath DriverPathname() return wutil_ExecutablePath() / filename; } +#endif // CONFIG2_MAHAF_ATTEMPT_DRIVER_START + //----------------------------------------------------------------------------- diff --git a/source/simulation2/components/CCmpUnitMotion.cpp b/source/simulation2/components/CCmpUnitMotion.cpp index f08b28901a..23fcb40e4e 100644 --- a/source/simulation2/components/CCmpUnitMotion.cpp +++ b/source/simulation2/components/CCmpUnitMotion.cpp @@ -1463,8 +1463,6 @@ bool CCmpUnitMotion::IsInTargetRange(entity_id_t target, entity_pos_t minRange, if (!cmpObstruction.null()) hasObstruction = cmpObstruction->GetObstructionSquare(obstruction); - entity_pos_t distance; - if (hasObstruction) { CFixedVector2D halfSize(obstruction.hw, obstruction.hh); diff --git a/source/tools/atlas/AtlasObject/AtlasObjectJS.cpp b/source/tools/atlas/AtlasObject/AtlasObjectJS.cpp index 37062f81b7..0bb5d22f1c 100644 --- a/source/tools/atlas/AtlasObject/AtlasObjectJS.cpp +++ b/source/tools/atlas/AtlasObject/AtlasObjectJS.cpp @@ -20,6 +20,10 @@ #include "../AtlasScript/ScriptInterface.h" +#if defined(_MSC_VER) +# pragma warning(disable:4996) // deprecated CRT +#endif + #include "wx/log.h" #include diff --git a/source/tools/atlas/AtlasScript/ScriptInterface.cpp b/source/tools/atlas/AtlasScript/ScriptInterface.cpp index 51e95cf4bf..f2eb0f6711 100644 --- a/source/tools/atlas/AtlasScript/ScriptInterface.cpp +++ b/source/tools/atlas/AtlasScript/ScriptInterface.cpp @@ -23,6 +23,10 @@ # include #endif +#if defined(_MSC_VER) +# pragma warning(disable:4996) // deprecated CRT +#endif + #include "wx/wx.h" #include "GameInterface/Shareable.h" diff --git a/source/tools/atlas/AtlasUI/Misc/precompiled.h b/source/tools/atlas/AtlasUI/Misc/precompiled.h index 5fd98611ce..9fb1d980e9 100644 --- a/source/tools/atlas/AtlasUI/Misc/precompiled.h +++ b/source/tools/atlas/AtlasUI/Misc/precompiled.h @@ -26,8 +26,8 @@ # define HAVE_PCH 0 #endif -#if defined(_MSC_VER) && _MSC_VER >= 1400 -# pragma warning(disable: 6334) // TODO: what was this for? +#if defined(_MSC_VER) +# pragma warning(disable:4996) // deprecated CRT #endif #if HAVE_PCH