diff --git a/Gems/AWSCore/Code/Include/Public/Framework/AWSApiClientJobConfig.h b/Gems/AWSCore/Code/Include/Public/Framework/AWSApiClientJobConfig.h index 800edffd41..e991b2af7e 100644 --- a/Gems/AWSCore/Code/Include/Public/Framework/AWSApiClientJobConfig.h +++ b/Gems/AWSCore/Code/Include/Public/Framework/AWSApiClientJobConfig.h @@ -48,6 +48,7 @@ namespace AWSCore // warning C4250: 'AWSCore::AwsApiClientJobConfig': inherits 'AWSCore::AwsApiJobConfig::AWSCore::AwsApiJobConfig::GetJobContext' via dominance // Thanks to http://stackoverflow.com/questions/11965596/diamond-inheritance-scenario-compiles-fine-in-g-but-produces-warnings-errors for the explanation // This is the expected and desired behavior. The warning is superfluous. + AZ_PUSH_DISABLE_WARNING(4250, "-Wunknown-warning-option") /// Configuration for AWS jobs using a specific client type. template class AwsApiClientJobConfig @@ -120,4 +121,6 @@ namespace AWSCore /// Set by ApplySettings std::shared_ptr m_client; }; + AZ_POP_DISABLE_WARNING + } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Public/Framework/HttpRequestJobConfig.h b/Gems/AWSCore/Code/Include/Public/Framework/HttpRequestJobConfig.h index f5a089b5ca..5b348d8630 100644 --- a/Gems/AWSCore/Code/Include/Public/Framework/HttpRequestJobConfig.h +++ b/Gems/AWSCore/Code/Include/Public/Framework/HttpRequestJobConfig.h @@ -30,6 +30,7 @@ namespace AWSCore // warning C4250: 'AWSCore::HttpRequestJobConfig' : inherits 'AWSCore::AwsApiJobConfig::AWSCore::AwsApiJobConfig::GetJobContext' via dominance // Thanks to http://stackoverflow.com/questions/11965596/diamond-inheritance-scenario-compiles-fine-in-g-but-produces-warnings-errors for the explanation // This is the expected and desired behavior. The warning is superfluous. + AZ_PUSH_DISABLE_WARNING(4250, "-Wunknown-warning-option") //! Provides service job configuration using settings properties. class HttpRequestJobConfig : public AwsApiJobConfig @@ -92,4 +93,6 @@ namespace AWSCore std::shared_ptr m_httpClient{ nullptr }; Aws::String m_userAgent{}; }; + AZ_POP_DISABLE_WARNING + } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Public/Framework/ServiceClientJobConfig.h b/Gems/AWSCore/Code/Include/Public/Framework/ServiceClientJobConfig.h index c78fc41617..9082498e96 100644 --- a/Gems/AWSCore/Code/Include/Public/Framework/ServiceClientJobConfig.h +++ b/Gems/AWSCore/Code/Include/Public/Framework/ServiceClientJobConfig.h @@ -63,8 +63,8 @@ namespace AWSCore // warning C4250: 'AWSCore::ServiceClientJobConfig' : inherits 'AWSCore::AwsApiJobConfig::AWSCore::AwsApiJobConfig::GetJobContext' via dominance // Thanks to http://stackoverflow.com/questions/11965596/diamond-inheritance-scenario-compiles-fine-in-g-but-produces-warnings-errors for the explanation // This is the expected and desired behavior. The warning is superfluous. - -/// Provides service job configuration using settings properties. + AZ_PUSH_DISABLE_WARNING(4250, "-Wunknown-warning-option") + /// Provides service job configuration using settings properties. template class ServiceClientJobConfig : public ServiceJobConfig @@ -127,6 +127,8 @@ namespace AWSCore } }; + AZ_POP_DISABLE_WARNING + } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Public/Framework/ServiceJobConfig.h b/Gems/AWSCore/Code/Include/Public/Framework/ServiceJobConfig.h index 8632db7d9f..f1a01cfb7b 100644 --- a/Gems/AWSCore/Code/Include/Public/Framework/ServiceJobConfig.h +++ b/Gems/AWSCore/Code/Include/Public/Framework/ServiceJobConfig.h @@ -12,7 +12,6 @@ namespace AWSCore { - /// Provides configuration needed by service jobs. class IServiceJobConfig : public virtual IHttpRequestJobConfig @@ -22,12 +21,12 @@ namespace AWSCore // warning C4250: 'AWSCore::ServiceJobConfig' : inherits 'AWSCore::AwsApiJobConfig::AWSCore::AwsApiJobConfig::GetJobContext' via dominance // Thanks to http://stackoverflow.com/questions/11965596/diamond-inheritance-scenario-compiles-fine-in-g-but-produces-warnings-errors for the explanation // This is the expected and desired behavior. The warning is superfluous. -/// Provides service job configuration using settings properties. + AZ_PUSH_DISABLE_WARNING(4250, "-Wunknown-warning-option") + /// Provides service job configuration using settings properties. class ServiceJobConfig : public HttpRequestJobConfig , public virtual IServiceJobConfig { - public: AZ_CLASS_ALLOCATOR(ServiceJobConfig, AZ::SystemAllocator, 0); @@ -53,8 +52,7 @@ namespace AWSCore } void ApplySettings() override; - - private: - }; + AZ_POP_DISABLE_WARNING + } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Public/Framework/ServiceRequestJobConfig.h b/Gems/AWSCore/Code/Include/Public/Framework/ServiceRequestJobConfig.h index 660b4f2537..240331496e 100644 --- a/Gems/AWSCore/Code/Include/Public/Framework/ServiceRequestJobConfig.h +++ b/Gems/AWSCore/Code/Include/Public/Framework/ServiceRequestJobConfig.h @@ -28,7 +28,7 @@ namespace AWSCore // warning C4250: 'AWSCore::ServiceRequestJobConfig' : inherits 'AWSCore::AwsApiJobConfig::AWSCore::AwsApiJobConfig::GetJobContext' via dominance // Thanks to http://stackoverflow.com/questions/11965596/diamond-inheritance-scenario-compiles-fine-in-g-but-produces-warnings-errors for the explanation // This is the expected and desired behavior. The warning is superfluous. - + AZ_PUSH_DISABLE_WARNING(4250, "-Wunknown-warning-option") template class ServiceRequestJobConfig : public ServiceClientJobConfig @@ -100,5 +100,6 @@ namespace AWSCore std::shared_ptr m_credentialsProvider; }; + AZ_POP_DISABLE_WARNING } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionMetric.cpp b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionMetric.cpp index c4f51fcb6f..aee766d355 100644 --- a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionMetric.cpp +++ b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionMetric.cpp @@ -95,7 +95,13 @@ namespace AWSCore time_t now; time(&now); char buffer[50]; - strftime(buffer, sizeof(buffer), "%FT%TZ", gmtime(&now)); + tm time; +#if AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS + gmtime_s(&time, &now); +#else + time = *gmtime(&now); +#endif + strftime(buffer, sizeof(buffer), "%FT%TZ", &time); return buffer; } diff --git a/Gems/AWSMetrics/Code/Source/MetricsEventBuilder.cpp b/Gems/AWSMetrics/Code/Source/MetricsEventBuilder.cpp index 043af2ef09..743a8c5849 100644 --- a/Gems/AWSMetrics/Code/Source/MetricsEventBuilder.cpp +++ b/Gems/AWSMetrics/Code/Source/MetricsEventBuilder.cpp @@ -55,7 +55,13 @@ namespace AWSMetrics time_t now; time(&now); char buffer[50]; - strftime(buffer, sizeof(buffer), "%FT%TZ", gmtime(&now)); + tm time; +#if AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS + gmtime_s(&time, &now); +#else + time = *gmtime(&now); +#endif + strftime(buffer, sizeof(buffer), "%FT%TZ", &time); m_currentMetricsEvent.AddAttribute(MetricsAttribute(AwsMetricsAttributeKeyEventTimestamp, AZStd::string(buffer))); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelMaterialSlot.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelMaterialSlot.cpp index 0900949625..b9d9200aaf 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelMaterialSlot.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelMaterialSlot.cpp @@ -15,7 +15,7 @@ namespace AZ { // Normally this would be defined in the header file and substituted by the compiler, but for // some reason clang doesn't accept it. - const ModelMaterialSlot::StableId ModelMaterialSlot::InvalidStableId = -1; + const ModelMaterialSlot::StableId ModelMaterialSlot::InvalidStableId = std::numeric_limits::max(); void ModelMaterialSlot::Reflect(AZ::ReflectContext* context) { diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h index 647082f553..cb63ff295c 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h @@ -50,10 +50,10 @@ namespace AtomToolsFramework //! Resizes the main window to achieve a requested size for the viewport render target. //! (This indicates the size of the render target, not the desktop-scaled QT widget size). - virtual void ResizeViewportRenderTarget(uint32_t width, uint32_t height) {}; + virtual void ResizeViewportRenderTarget([[maybe_unused]] uint32_t width, [[maybe_unused]] uint32_t height) {}; //! Forces the viewport's render target to use the given resolution, ignoring the size of the viewport widget. - virtual void LockViewportRenderTargetSize(uint32_t width, uint32_t height) {}; + virtual void LockViewportRenderTargetSize([[maybe_unused]] uint32_t width, [[maybe_unused]] uint32_t height) {}; //! Releases the viewport's render target resolution lock, allowing it to match the viewport widget again. virtual void UnlockViewportRenderTargetSize() {}; diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h index c2d776bcdb..ebd65f833a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h @@ -64,7 +64,7 @@ namespace EMotionFX * VertexAttributeLayerAbstractData::GetType() values for the vertex data * Use these with the Mesh::FindVertexData() and Mesh::FindOriginalVertexData() methods. */ - enum + enum : uint32 { ATTRIB_POSITIONS = 0, /**< Vertex positions. Typecast to AZ::Vector3. Positions are always exist. */ ATTRIB_NORMALS = 1, /**< Vertex normals. Typecast to AZ::Vector3. Normals are always exist. */ diff --git a/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp b/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp index 5cdd9c2600..b59f2b69a0 100644 --- a/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp +++ b/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp @@ -1123,7 +1123,7 @@ namespace MCore for (size_t i = 0; i < numHistoryEntries; ++i) { AZStd::string text = AZStd::string::format("%.3zu: name='%s', num parameters=%zu", i, m_commandHistory[i].m_executedCommand->GetName(), m_commandHistory[i].m_parameters.GetNumParameters()); - if (i == m_historyIndex) + if (i == static_cast(m_historyIndex)) { LogDetailedInfo("-> %s", text.c_str()); } diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp index 339cb4b5bc..51209c7f02 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp @@ -177,7 +177,7 @@ void CUiAnimViewCurveEditor::UpdateSplines() std::set newTracks; if (selectedTracks.AreAllOfSameType()) { - for (int i = 0; i < selectedTracks.GetCount(); i++) + for (unsigned int i = 0; i < selectedTracks.GetCount(); i++) { CUiAnimViewTrack* pTrack = selectedTracks.GetTrack(i); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp index ac210ba2f2..97f21e9bab 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp @@ -989,7 +989,7 @@ void CUiAnimViewDialog::ReloadSequencesComboBox() CUiAnimViewSequenceManager* pSequenceManager = CUiAnimViewSequenceManager::GetSequenceManager(); const unsigned int numSequences = pSequenceManager->GetCount(); - for (int k = 0; k < numSequences; ++k) + for (unsigned int k = 0; k < numSequences; ++k) { CUiAnimViewSequence* pSequence = pSequenceManager->GetSequenceByIndex(k); QString fullname = pSequence->GetName(); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp index bd5c82fc9e..12f1eeac4d 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp @@ -925,12 +925,12 @@ void CUiAnimViewDopeSheetBase::SelectAllKeysWithinTimeFrame(const QRect& rc, con CUiAnimViewTrackBundle tracks = pSequence->GetAllTracks(); CUiAnimViewSequenceNotificationContext context(pSequence); - for (int i = 0; i < tracks.GetCount(); ++i) + for (unsigned int i = 0; i < tracks.GetCount(); ++i) { CUiAnimViewTrack* pTrack = tracks.GetTrack(i); // Check which keys we intersect. - for (int j = 0; j < pTrack->GetKeyCount(); j++) + for (unsigned int j = 0; j < pTrack->GetKeyCount(); j++) { CUiAnimViewKeyHandle keyHandle = pTrack->GetKey(j); const float time = keyHandle.GetTime(); @@ -1311,7 +1311,7 @@ bool CUiAnimViewDopeSheetBase::IsOkToAddKeyHere(const CUiAnimViewTrack* pTrack, { const float timeEpsilon = 0.05f; - for (int i = 0; i < pTrack->GetKeyCount(); ++i) + for (unsigned int i = 0; i < pTrack->GetKeyCount(); ++i) { CUiAnimViewKeyHandle keyHandle = const_cast(pTrack)->GetKey(i); @@ -1425,10 +1425,10 @@ void CUiAnimViewDopeSheetBase::MouseMoveMove(const QPoint& p, [[maybe_unused]] Q const TrackMemento& trackMemento = iter->second; pTrack->RestoreFromMemento(trackMemento.m_memento); - const unsigned int numKeys = trackMemento.m_keySelectionStates.size(); - for (unsigned int i = 0; i < numKeys; ++i) + const size_t numKeys = trackMemento.m_keySelectionStates.size(); + for (size_t i = 0; i < numKeys; ++i) { - pTrack->GetKey(i).Select(trackMemento.m_keySelectionStates[i]); + pTrack->GetKey(static_cast(i)).Select(trackMemento.m_keySelectionStates[i]); } } diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp index ba4893abb4..8edd13f8cc 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp @@ -667,7 +667,7 @@ void CUiAnimViewSplineCtrl::mouseMoveEvent(QMouseEvent* event) QString tipText; bool boFoundTheSelectedKey(false); - for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) + for (size_t splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; CUiAnimViewTrack* pTrack = m_tracks[splineIndex]; @@ -757,7 +757,7 @@ void CUiAnimViewSplineCtrl::AdjustTCB(float d_tension, float d_continuity, float SendNotifyEvent(SPLN_BEFORE_CHANGE); - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; CUiAnimViewTrack* pTrack = m_tracks[splineIndex]; @@ -866,16 +866,16 @@ void CUiAnimViewSplineCtrl::OnUserCommand(UINT cmd) bool CUiAnimViewSplineCtrl::IsUnifiedKeyCurrentlySelected() const { - for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) + for (size_t splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex) { ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline; - if (pSpline == NULL) + if (!pSpline) { continue; } - for (int i = 0; i < (int)pSpline->GetKeyCount(); i++) + for (int i = 0; i < pSpline->GetKeyCount(); i++) { // If the key is selected in any dimension... for (