diff --git a/Code/Framework/AzCore/AzCore/Math/Guid.h b/Code/Framework/AzCore/AzCore/Math/Guid.h index 53bab4d7ed..15c4c52742 100644 --- a/Code/Framework/AzCore/AzCore/Math/Guid.h +++ b/Code/Framework/AzCore/AzCore/Math/Guid.h @@ -66,9 +66,9 @@ typedef const GUID& REFIID; const GUID name \ = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } -static REFGUID GUID_NULL() +REFGUID GUID_NULL() { - static const GUID guid = { 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; + static GUID guid = { 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; return guid; } diff --git a/Code/Framework/AzCore/AzCore/Math/Internal/SimdMathCommon_simd.inl b/Code/Framework/AzCore/AzCore/Math/Internal/SimdMathCommon_simd.inl index fc406f5862..c9909925c4 100644 --- a/Code/Framework/AzCore/AzCore/Math/Internal/SimdMathCommon_simd.inl +++ b/Code/Framework/AzCore/AzCore/Math/Internal/SimdMathCommon_simd.inl @@ -339,7 +339,6 @@ namespace AZ { const typename VecType::FloatType x_eq_0 = VecType::CmpEq(x, VecType::ZeroFloat()); const typename VecType::FloatType x_ge_0 = VecType::CmpGtEq(x, VecType::ZeroFloat()); - const typename VecType::FloatType x_le_0 = VecType::CmpLtEq(x, VecType::ZeroFloat()); const typename VecType::FloatType x_lt_0 = VecType::CmpLt(x, VecType::ZeroFloat()); const typename VecType::FloatType y_eq_0 = VecType::CmpEq(y, VecType::ZeroFloat()); @@ -363,7 +362,6 @@ namespace AZ typename VecType::FloatType swap_sign_mask_offset = VecType::And(x_lt_0, y_lt_0); swap_sign_mask_offset = VecType::And(swap_sign_mask_offset, VecType::CastToFloat(FastLoadConstant(Simd::g_negateMask))); - const typename VecType::FloatType offset0 = VecType::ZeroFloat(); typename VecType::FloatType offset1 = FastLoadConstant(g_Pi); offset1 = VecType::Xor(offset1, swap_sign_mask_offset); diff --git a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h index 0c4eaf8383..86c6efdc9c 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h +++ b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h @@ -3775,7 +3775,7 @@ namespace AZ inline void OnDemandReflectFunctions(OnDemandReflectionOwner* onDemandReflection, AZStd::Internal::pack_traits_arg_sequence) { using PackExpander = bool[]; - PackExpander{ true, (BehaviorOnDemandReflectHelper::raw_fp_type>::QueueReflect(onDemandReflection), true)... }; + [[maybe_unused]] PackExpander pe = { true, (BehaviorOnDemandReflectHelper::raw_fp_type>::QueueReflect(onDemandReflection), true)... }; } // Assumes parameters array is big enough to store all parameters diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp index 1fa0dd3c44..a7abfca86b 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp @@ -158,7 +158,6 @@ namespace AZ using namespace JsonSerializationResult; StoreTypeId storeTypeId = StoreTypeId::No; - Uuid resolvedTypeId = classData.m_typeId; const SerializeContext::ClassData* resolvedClassData = &classData; AZStd::any defaultPointerObject; diff --git a/Code/Framework/AzCore/AzCore/std/string/string_view.h b/Code/Framework/AzCore/AzCore/std/string/string_view.h index 9a98795554..267ea7b536 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string_view.h +++ b/Code/Framework/AzCore/AzCore/std/string/string_view.h @@ -866,7 +866,9 @@ namespace AZStd constexpr size_t hash_string(RandomAccessIterator first, size_t length) { size_t hash = 14695981039346656037ULL; +#if AZ_COMPILER_MSVC >= 1924 constexpr size_t fnvPrime = 1099511628211ULL; +#endif const RandomAccessIterator last(first + length); for (; first != last; ++first) diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/StackTracer_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/StackTracer_UnixLike.cpp index abfabbbd54..f66a9d3b18 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/StackTracer_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/StackTracer_UnixLike.cpp @@ -57,7 +57,7 @@ StackRecorder::Record(StackFrame* frames, unsigned int maxNumOfFrames, unsigned int skip = static_cast((suppressCount == 0) ? 1 : suppressCount); // Skip at least this function while ((unw_step(&cursor) > 0) && (count < maxNumOfFrames)) { - unw_word_t offset, pc; + unw_word_t pc; unw_get_reg(&cursor, UNW_REG_IP, &pc); if (pc == 0) { diff --git a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp index 031e8561ec..630f81d89f 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp @@ -151,16 +151,6 @@ namespace GridMate writeBuffer.Write(PackByte(value)); } - AZ_INLINE static AZ::u32 CalculatePeerCRC32(const SecureSocketDriver::AddrPtr& from) - { - // Calculate CRC32 from remote address - AZ::u32 port = from->GetPort(); - AZ::Crc32 crc; - crc.Add(from->GetIP().c_str()); - crc.Add(&port, sizeof(port)); - return crc; - } - // Structures // struct RecordHeader // 13 bytes = DTLS1_RT_HEADER_LENGTH diff --git a/Code/Legacy/CryCommon/CryLibrary.h b/Code/Legacy/CryCommon/CryLibrary.h index a034a2a04b..6c13f0f9c6 100644 --- a/Code/Legacy/CryCommon/CryLibrary.h +++ b/Code/Legacy/CryCommon/CryLibrary.h @@ -97,14 +97,14 @@ static const char* GetModulePath() return getenv(gEnvName); } -static void SetModulePath(const char* pModulePath) +void SetModulePath(const char* pModulePath) { setenv(gEnvName, pModulePath ? pModulePath : "", true); } // bInModulePath is only ever set to false in RC, because rc needs to load dlls from a $PATH that // it has modified to include .. -static HMODULE CryLoadLibrary(const char* libName, bool bLazy = false, bool bInModulePath = true) +HMODULE CryLoadLibrary(const char* libName, bool bLazy = false, bool bInModulePath = true) { const char* libPath = nullptr; char pathBuffer[MAX_PATH] = {0}; @@ -161,7 +161,7 @@ static HMODULE CryLoadLibrary(const char* libName, bool bLazy = false, bool bInM return module; } -static bool CryFreeLibrary(void* lib) +bool CryFreeLibrary(void* lib) { if (lib) { diff --git a/Code/Legacy/CryCommon/CryVersion.h b/Code/Legacy/CryCommon/CryVersion.h index 0f84e02b6b..e6ed15408d 100644 --- a/Code/Legacy/CryCommon/CryVersion.h +++ b/Code/Legacy/CryCommon/CryVersion.h @@ -43,7 +43,7 @@ struct SFileVersion t[len] = 0; char* p; - char* next = nullptr; + [[maybe_unused]] char* next = nullptr; [[maybe_unused]] size_t strmax = sizeof(t); p = azstrtok(t, &strmax, ".", &next); if (!p) diff --git a/Code/Legacy/CryCommon/IIndexedMesh.h b/Code/Legacy/CryCommon/IIndexedMesh.h index 87c3df98bd..dbfbf3c71b 100644 --- a/Code/Legacy/CryCommon/IIndexedMesh.h +++ b/Code/Legacy/CryCommon/IIndexedMesh.h @@ -1520,7 +1520,6 @@ public: const int oldVertexCount = GetVertexCount(); const int oldFaceCount = GetFaceCount(); - const int nOldCoorCount = GetTexCoordCount(); if (GetTexCoordCount() != 0 && GetTexCoordCount() != oldVertexCount) { diff --git a/Code/Legacy/CryCommon/VectorMap.h b/Code/Legacy/CryCommon/VectorMap.h index 75b1562c4d..6fce90b4ec 100644 --- a/Code/Legacy/CryCommon/VectorMap.h +++ b/Code/Legacy/CryCommon/VectorMap.h @@ -411,7 +411,6 @@ typename VectorMap::iterator VectorMap::lower_bound(cons { int count = static_cast(m_entries.size()); iterator first = m_entries.begin(); - iterator last = m_entries.end(); for (; 0 < count; ) { // divide and conquer, find half that contains answer int count2 = count / 2; @@ -434,7 +433,6 @@ typename VectorMap::const_iterator VectorMap::lower_boun { int count = static_cast(m_entries.size()); const_iterator first = m_entries.begin(); - const_iterator last = m_entries.end(); for (; 0 < count; ) { // divide and conquer, find half that contains answer int count2 = count / 2; diff --git a/Code/Legacy/CryCommon/WinBase.cpp b/Code/Legacy/CryCommon/WinBase.cpp index ae646e9e1c..99e01f7194 100644 --- a/Code/Legacy/CryCommon/WinBase.cpp +++ b/Code/Legacy/CryCommon/WinBase.cpp @@ -1305,13 +1305,8 @@ const bool GetFilenameNoCase char* slash; const char* dirname; char* name; - FS_ERRNO_TYPE fsErr = 0; - FS_DIRENT_TYPE dirent; - uint64_t direntSize = 0; - FS_DIR_TYPE fd = FS_DIR_NULL; - if ( - (pAdjustedFilename) == (char*)-1) + if ((pAdjustedFilename) == (char*)-1) { return false; } @@ -1343,9 +1338,6 @@ const bool GetFilenameNoCase #endif // Scan for the file. - bool found = false; - bool skipScan = false; - if (slash) { *slash = '/'; diff --git a/Code/Legacy/CrySystem/LocalizedStringManager.cpp b/Code/Legacy/CrySystem/LocalizedStringManager.cpp index db77eda3e8..e4b149d84e 100644 --- a/Code/Legacy/CrySystem/LocalizedStringManager.cpp +++ b/Code/Legacy/CrySystem/LocalizedStringManager.cpp @@ -1926,11 +1926,9 @@ AZStd::string CLocalizedStringsManager::SLocalizedStringEntry::GetTranslatedText #endif //LOG_DECOMP_TIMES #if !defined(NDEBUG) - size_t len = -#endif - strnlen((const char*)decompressionBuffer, COMPRESSION_FIXED_BUFFER_LENGTH); + size_t len = strnlen((const char*)decompressionBuffer, COMPRESSION_FIXED_BUFFER_LENGTH); assert(len < COMPRESSION_FIXED_BUFFER_LENGTH && "Buffer not null-terminated"); - +#endif #if defined(LOG_DECOMP_TIMES) nAllocTicks = CryGetTicks(); diff --git a/Code/Legacy/CrySystem/Log.cpp b/Code/Legacy/CrySystem/Log.cpp index be2816c890..4965323695 100644 --- a/Code/Legacy/CrySystem/Log.cpp +++ b/Code/Legacy/CrySystem/Log.cpp @@ -444,8 +444,6 @@ void CLog::LogV(const ELogType type, [[maybe_unused]]int flags, const char* szFo return; } - LogStringType tempString; - char szBuffer[MAX_WARNING_LENGTH + 32]; char* szString = szBuffer; char* szAfterColour = szString; @@ -1297,7 +1295,7 @@ void CLog::CheckAndPruneBackupLogs() const AZStd::list fileInfoList; // Now that we've copied the new log over, lets check the size of the backup folder and trim it as necessary to keep it within appropriate limits - AZ::IO::Result res = fileSystem->FindFiles(LOG_BACKUP_PATH, "*", + fileSystem->FindFiles(LOG_BACKUP_PATH, "*", [&totalBackupDirectorySize, &fileSystem, &fileInfoList](const char* fileName) { AZ::u64 size; diff --git a/Code/Legacy/CrySystem/XML/xml.cpp b/Code/Legacy/CrySystem/XML/xml.cpp index adbfcc5f3e..d3fbaa9ec6 100644 --- a/Code/Legacy/CrySystem/XML/xml.cpp +++ b/Code/Legacy/CrySystem/XML/xml.cpp @@ -1760,21 +1760,9 @@ XmlNodeRef XmlParserImp::ParseFile(const char* filename, XmlString& errorString, { // not binary XML - refuse to load if in scripts dir and not in bin xml to help reduce hacking // wish we could compile the text xml parser out, but too much work to get everything moved over - static const char SCRIPTS_DIR[] = "Scripts/"; - AZStd::fixed_string<32> strScripts("S"); - strScripts += "c"; - strScripts += "r"; - strScripts += "i"; - strScripts += "p"; - strScripts += "t"; - strScripts += "s"; - strScripts += "/"; + AZStd::fixed_string<32> strScripts = {"Scripts/"}; // exclude files and PAKs from Mods folder - AZStd::fixed_string<8> modsStr("M"); - modsStr += "o"; - modsStr += "d"; - modsStr += "s"; - modsStr += "/"; + AZStd::fixed_string<8> modsStr = {"Mods/"}; if (_strnicmp(filename, strScripts.c_str(), strScripts.length()) == 0 && _strnicmp(adjustedFilename.c_str(), modsStr.c_str(), modsStr.length()) != 0 && _strnicmp(pakPath.c_str(), modsStr.c_str(), modsStr.length()) != 0) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h index ff1158e455..82b0b7146b 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h @@ -248,7 +248,6 @@ namespace AZ AZStd::array_view constantBytes = GetConstantRaw(inputIndex); const size_t elementSize = sizeof(T); const size_t elementOffset = arrayIndex * elementSize; - const size_t elementCount = DivideByMultiple(constantBytes.size(), elementSize); if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::ArrayElement, elementOffset, elementSize)) { return *reinterpret_cast(&constantBytes[elementOffset]); diff --git a/cmake/Platform/Common/Clang/Configurations_clang.cmake b/cmake/Platform/Common/Clang/Configurations_clang.cmake index 94584e342f..17a89fc1cd 100644 --- a/cmake/Platform/Common/Clang/Configurations_clang.cmake +++ b/cmake/Platform/Common/Clang/Configurations_clang.cmake @@ -33,11 +33,6 @@ ly_append_configurations_options( -Wno-tautological-compare -Wno-undefined-var-template -Wno-unknown-pragmas - -Wno-unused-function - -Wno-unused-private-field - -Wno-unused-value - -Wno-unused-variable - -Wno-unused-lambda-capture # Workaround for compiler seeing file case differently from what OS show in console. -Wno-nonportable-include-path