From c3cf2a52e8954f935fbe4bf6ee72c88f9ff3ffe7 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sun, 27 Sep 2020 22:10:33 -0400
Subject: [PATCH] Fix many warnings from msvc debug build

---
 indra/cmake/URIPARSER.cmake                 |  4 +---
 indra/llimage/llimagefilter.cpp             |  8 ++++----
 indra/llinventory/llsettingssky.cpp         | 18 +++++++++---------
 indra/llmath/llmath.h                       |  2 +-
 indra/llrender/llatmosphere.cpp             | 12 ++++++------
 indra/newview/llavatarrendernotifier.cpp    |  2 +-
 indra/newview/llfasttimerview.cpp           |  2 +-
 indra/newview/llfloatermodelpreview.cpp     |  2 +-
 indra/newview/llfloaterregionrestarting.cpp |  8 ++++----
 indra/newview/lllogininstance.cpp           |  6 +++---
 indra/newview/llpaneleditwearable.cpp       |  4 ++--
 indra/newview/llpanelgroup.h                |  2 +-
 indra/newview/llstatusbar.cpp               |  2 +-
 indra/newview/llviewertexture.cpp           |  2 +-
 14 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake
index de146885a07..0cacedef878 100644
--- a/indra/cmake/URIPARSER.cmake
+++ b/indra/cmake/URIPARSER.cmake
@@ -10,9 +10,7 @@ if (USESYSTEMLIBS)
 else (USESYSTEMLIBS)
   use_prebuilt_binary(uriparser)
   if (WINDOWS)
-    set(URIPARSER_LIBRARIES
-      debug uriparserd
-      optimized uriparser)
+    set(URIPARSER_LIBRARIES uriparser)
   elseif (LINUX)
     #
     # When we have updated static libraries in competition with older
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 41adc7be9a1..a804f3e28a5 100644
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -663,7 +663,7 @@ void LLImageFilter::computeHistograms()
 void LLImageFilter::filterGrayScale()
 {
     LLMatrix3 gray_scale;
-    LLVector3 luminosity(0.2125, 0.7154, 0.0721);
+    LLVector3 luminosity(0.2125f, 0.7154f, 0.0721f);
     gray_scale.setRows(luminosity, luminosity, luminosity);
     gray_scale.transpose();
     colorTransform(gray_scale);
@@ -672,9 +672,9 @@ void LLImageFilter::filterGrayScale()
 void LLImageFilter::filterSepia()
 {
     LLMatrix3 sepia;
-    sepia.setRows(LLVector3(0.3588, 0.7044, 0.1368),
-                  LLVector3(0.2990, 0.5870, 0.1140),
-                  LLVector3(0.2392, 0.4696, 0.0912));
+    sepia.setRows(LLVector3(0.3588f, 0.7044f, 0.1368f),
+                  LLVector3(0.2990f, 0.5870f, 0.1140f),
+                  LLVector3(0.2392f, 0.4696f, 0.0912f));
     sepia.transpose();
     colorTransform(sepia);
 }
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index c17129210e2..3224be609e1 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -716,25 +716,25 @@ LLSD LLSettingsSky::defaults(const LLSettingsBase::TrackPosition& position)
         moonquat = convert_azimuth_and_altitude_to_quat(altitude + (F_PI * 0.125f), azimuth + (F_PI * 0.125f));
 
         // Magic constants copied form dfltsetting.xml 
-        dfltsetting[SETTING_CLOUD_COLOR]        = LLColor4(0.4099, 0.4099, 0.4099, 0.0).getValue();
-        dfltsetting[SETTING_CLOUD_POS_DENSITY1] = LLColor4(1.0000, 0.5260, 1.0000, 0.0).getValue();
-        dfltsetting[SETTING_CLOUD_POS_DENSITY2] = LLColor4(1.0000, 0.5260, 1.0000, 0.0).getValue();
+        dfltsetting[SETTING_CLOUD_COLOR]        = LLColor4(0.4099f, 0.4099f, 0.4099f, 0.0f).getValue();
+        dfltsetting[SETTING_CLOUD_POS_DENSITY1] = LLColor4(1.0000f, 0.5260f, 1.0000f, 0.0f).getValue();
+        dfltsetting[SETTING_CLOUD_POS_DENSITY2] = LLColor4(1.0000f, 0.5260f, 1.0000f, 0.0f).getValue();
         dfltsetting[SETTING_CLOUD_SCALE]        = LLSD::Real(0.4199);
         dfltsetting[SETTING_CLOUD_SCROLL_RATE]  = LLSDArray(0.0f)(0.0f);
         dfltsetting[SETTING_CLOUD_SHADOW]       = LLSD::Real(0.2699);
         dfltsetting[SETTING_CLOUD_VARIANCE]     = LLSD::Real(0.0);
 
-        dfltsetting[SETTING_DOME_OFFSET]        = LLSD::Real(0.96f);
-        dfltsetting[SETTING_DOME_RADIUS]        = LLSD::Real(15000.f);
+        dfltsetting[SETTING_DOME_OFFSET]        = LLSD::Real(0.96);
+        dfltsetting[SETTING_DOME_RADIUS]        = LLSD::Real(15000.0);
         dfltsetting[SETTING_GAMMA]              = LLSD::Real(1.0);
-        dfltsetting[SETTING_GLOW]               = LLColor4(5.000, 0.0010, -0.4799, 1.0).getValue();
+        dfltsetting[SETTING_GLOW]               = LLColor4(5.000f, 0.0010f, -0.4799f, 1.0f).getValue();
     
         dfltsetting[SETTING_MAX_Y]              = LLSD::Real(1605);
         dfltsetting[SETTING_MOON_ROTATION]      = moonquat.getValue();
-        dfltsetting[SETTING_MOON_BRIGHTNESS]    = LLSD::Real(0.5f);
+        dfltsetting[SETTING_MOON_BRIGHTNESS]    = LLSD::Real(0.5);
 
         dfltsetting[SETTING_STAR_BRIGHTNESS]    = LLSD::Real(250.0000);
-        dfltsetting[SETTING_SUNLIGHT_COLOR]     = LLColor4(0.7342, 0.7815, 0.8999, 0.0).getValue();
+        dfltsetting[SETTING_SUNLIGHT_COLOR]     = LLColor4(0.7342f, 0.7815f, 0.8999f, 0.0f).getValue();
         dfltsetting[SETTING_SUN_ROTATION]       = sunquat.getValue();
 
         dfltsetting[SETTING_BLOOM_TEXTUREID]    = GetDefaultBloomTextureId();
@@ -1337,7 +1337,7 @@ void LLSettingsSky::calculateLightSettings() const
     F32 moon_brightness = getIsMoonUp() ? getMoonBrightness() : 0.001f;
 
     LLColor3 moonlight = getMoonlightColor();
-    LLColor3 moonlight_b(0.66, 0.66, 1.2); // scotopic ambient value
+    LLColor3 moonlight_b(0.66f, 0.66f, 1.2f); // scotopic ambient value
 
     componentMultBy(moonlight, componentExp((light_atten * -1.f) * lighty));
 
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index 2338f4c4949..f87b239b345 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -81,7 +81,7 @@ const F32	DEG_TO_RAD	= 0.017453292519943295769236907684886f;
 const F32	RAD_TO_DEG	= 57.295779513082320876798154814105f;
 const F32	F_APPROXIMATELY_ZERO = 0.00001f;
 const F32	F_LN10		= 2.3025850929940456840179914546844f;
-const F32	OO_LN10		= 0.43429448190325182765112891891661;
+const F32	OO_LN10		= 0.43429448190325182765112891891661f;
 const F32	F_LN2		= 0.69314718056f;
 const F32	OO_LN2		= 1.4426950408889634073599246810019f;
 
diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp
index 8e37ca9b905..6ba2c703842 100644
--- a/indra/llrender/llatmosphere.cpp
+++ b/indra/llrender/llatmosphere.cpp
@@ -73,8 +73,8 @@ const double kDobsonUnit = 2.687e20;
 // the ozone density profile defined below, which is equal to 15km).
 const double kMaxOzoneNumberDensity = 300.0 * kDobsonUnit / 15000.0;
 const double kRayleigh = 1.24062e-6;
-const double kRayleighScaleHeight = 8000.0;
-const double kMieScaleHeight = 1200.0;
+const float kRayleighScaleHeight = 8000.0f;
+const float kMieScaleHeight = 1200.0f;
 const double kMieAngstromAlpha = 0.0;
 const double kMieAngstromBeta = 5.328e-3;
 const double kMieSingleScatteringAlbedo = 0.9;
@@ -86,8 +86,8 @@ AtmosphericModelSettings::AtmosphericModelSettings()
     , m_sunArcRadians(0.00045f)
     , m_mieAnisotropy(0.8f)
 {
-    DensityLayer rayleigh_density(0.0, 1.0, -1.0 / kRayleighScaleHeight, 0.0, 0.0);
-    DensityLayer mie_density(0.0, 1.0, -1.0 / kMieScaleHeight, 0.0, 0.0);
+    DensityLayer rayleigh_density(0.0f, 1.0f, -1.0f / kRayleighScaleHeight, 0.0f, 0.0f);
+    DensityLayer mie_density(0.0f, 1.0f, -1.0f / kMieScaleHeight, 0.0f, 0.0f);
 
     m_rayleighProfile.push_back(rayleigh_density);
     m_mieProfile.push_back(mie_density);
@@ -96,8 +96,8 @@ AtmosphericModelSettings::AtmosphericModelSettings()
     // decreasing linearly from 1 to 0 between 25 and 40km. This is an approximate
     // profile from http://www.kln.ac.lk/science/Chemistry/Teaching_Resources/
     // Documents/Introduction%20to%20atmospheric%20chemistry.pdf (page 10).
-    m_absorptionProfile.push_back(DensityLayer(25000.0, 0.0, 0.0, 1.0 / 15000.0, -2.0 / 3.0));
-    m_absorptionProfile.push_back(DensityLayer(0.0, 0.0, 0.0, -1.0 / 15000.0, 8.0 / 3.0));
+    m_absorptionProfile.push_back(DensityLayer(25000.0f, 0.0f, 0.0f, 1.0f / 15000.0f, -2.0f / 3.0f));
+    m_absorptionProfile.push_back(DensityLayer(0.0f, 0.0f, 0.0f, -1.0f / 15000.0f, 8.0f / 3.0f));
 }
 
 AtmosphericModelSettings::AtmosphericModelSettings(
diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp
index 94584a623b9..e8ab168151c 100644
--- a/indra/newview/llavatarrendernotifier.cpp
+++ b/indra/newview/llavatarrendernotifier.cpp
@@ -48,7 +48,7 @@
 #include "llavatarrendernotifier.h"
 
 // when change exceeds this ration, notification is shown
-static const F32 RENDER_ALLOWED_CHANGE_PCT = 0.1;
+static const F32 RENDER_ALLOWED_CHANGE_PCT = 0.1f;
 // wait seconds before processing over limit updates after last complexity change
 static const U32 OVER_LIMIT_UPDATE_DELAY = 70;
 
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index ffbfdf9476d..6a087fab46a 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -1030,7 +1030,7 @@ void LLFastTimerView::drawLineGraph()
 	LLLocalClipRect clip(mGraphRect);
 
 	//normalize based on last frame's maximum
-	static F32Seconds max_time(0.000001);
+	static F32Seconds max_time(0.000001f);
 	static U32 max_calls = 0;
 	static F32 alpha_interp = 0.f;
 
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 7a90cc504f1..4658b7a58a8 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1642,7 +1642,7 @@ void LLModelPreview::rebuildUploadData()
                 {
                     LLQuaternion bind_rot = LLSkinningUtil::getUnscaledQuaternion(high_lod_model->mSkinInfo.mBindShapeMatrix);
                     LLQuaternion identity;
-                    if (!bind_rot.isEqualEps(identity,0.01))
+                    if (!bind_rot.isEqualEps(identity,0.01f))
                     {
                         LL_WARNS() << "non-identity bind shape rot. mat is " << high_lod_model->mSkinInfo.mBindShapeMatrix 
                                    << " bind_rot " << bind_rot << LL_ENDL;
diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp
index 95d4265bb46..1afb26aa4b3 100644
--- a/indra/newview/llfloaterregionrestarting.cpp
+++ b/indra/newview/llfloaterregionrestarting.cpp
@@ -100,10 +100,10 @@ void LLFloaterRegionRestarting::draw()
 {
 	LLFloater::draw();
 
-	const F32 SHAKE_INTERVAL = 0.025;
-	const F32 SHAKE_TOTAL_DURATION = 1.8; // the length of the default alert tone for this
-	const F32 SHAKE_INITIAL_MAGNITUDE = 1.5;
-	const F32 SHAKE_HORIZONTAL_BIAS = 0.25;
+	const F32 SHAKE_INTERVAL = 0.025f;
+	const F32 SHAKE_TOTAL_DURATION = 1.8f; // the length of the default alert tone for this
+	const F32 SHAKE_INITIAL_MAGNITUDE = 1.5f;
+	const F32 SHAKE_HORIZONTAL_BIAS = 0.25f;
 	F32 time_shaking;
 	
 	if(SHAKE_START == sShakeState)
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 29d9cb06c99..8f1b12ef218 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -62,9 +62,9 @@
 #include <sstream>
 
 const S32 LOGIN_MAX_RETRIES = 8; // Viewer should not autmatically retry login
-const F32 LOGIN_SRV_TIMEOUT_MIN = 10;
-const F32 LOGIN_SRV_TIMEOUT_MAX = 120;
-const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time
+const F32 LOGIN_SRV_TIMEOUT_MIN = 10.f;
+const F32 LOGIN_SRV_TIMEOUT_MAX = 120.f;
+const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9f; // make DNS wait shorter then retry time
 
 class LLLoginInstance::Disposable {
 public:
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 073beee8a72..6ed4c90211e 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -1330,8 +1330,8 @@ void LLPanelEditWearable::toggleTypeSpecificControls(LLWearableType::EType type)
 
 void LLPanelEditWearable::updateTypeSpecificControls(LLWearableType::EType type)
 {
-        const F32 ONE_METER = 1.0;
-        const F32 ONE_FOOT = 0.3048 * ONE_METER; // in meters
+        const F32 ONE_METER = 1.0f;
+        const F32 ONE_FOOT = 0.3048f * ONE_METER; // in meters
         // Update controls specific to shape editing panel.
         if (type == LLWearableType::WT_SHAPE)
         {
diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h
index be40b08a6d7..c7c70ac5430 100644
--- a/indra/newview/llpanelgroup.h
+++ b/indra/newview/llpanelgroup.h
@@ -33,7 +33,7 @@
 
 class LLOfferInfo;
 
-const F32 UPDATE_MEMBERS_SECONDS_PER_FRAME = 0.005; // 5ms
+const F32 UPDATE_MEMBERS_SECONDS_PER_FRAME = 0.005f; // 5ms
 
 // Forward declares
 class LLPanelGroupTab;
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 72a02039f16..d60b8f813da 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -236,7 +236,7 @@ BOOL LLStatusBar::postBuild()
 	pgp.precision(1);
 	pgp.per_sec(false);
 	LLStatGraph::Thresholds thresholds;
-	thresholds.threshold.add(LLStatGraph::ThresholdParams().value(0.1).color(LLColor4::green))
+	thresholds.threshold.add(LLStatGraph::ThresholdParams().value(0.1f).color(LLColor4::green))
 						.add(LLStatGraph::ThresholdParams().value(0.25f).color(LLColor4::yellow))
 						.add(LLStatGraph::ThresholdParams().value(0.6f).color(LLColor4::red));
 
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 7a422d6550b..e44f170268b 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1950,7 +1950,7 @@ bool LLViewerFetchedTexture::isActiveFetching()
 bool LLViewerFetchedTexture::updateFetch()
 {
 	static LLCachedControl<bool> textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled", false);
-	static LLCachedControl<F32>  sCameraMotionThreshold(gSavedSettings,"TextureCameraMotionThreshold", 0.2);
+	static LLCachedControl<F32>  sCameraMotionThreshold(gSavedSettings,"TextureCameraMotionThreshold", 0.2f);
 	static LLCachedControl<S32>  sCameraMotionBoost(gSavedSettings,"TextureCameraMotionBoost", 3);
 	if(textures_decode_disabled ||
 	   (gUseWireframe && mBoostLevel < LLGLTexture::BOOST_AVATAR_BAKED_SELF)) // don't fetch the surface textures in wireframe mode
-- 
GitLab