some fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-19 14:01:50 -07:00
parent 8ae384e93f
commit a97bccbf38
17 changed files with 16 additions and 60 deletions
+2 -2
View File
@@ -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;
}
@@ -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<VecType>(Simd::g_negateMask)));
const typename VecType::FloatType offset0 = VecType::ZeroFloat();
typename VecType::FloatType offset1 = FastLoadConstant<VecType>(g_Pi);
offset1 = VecType::Xor(offset1, swap_sign_mask_offset);
@@ -3775,7 +3775,7 @@ namespace AZ
inline void OnDemandReflectFunctions(OnDemandReflectionOwner* onDemandReflection, AZStd::Internal::pack_traits_arg_sequence<Functions...>)
{
using PackExpander = bool[];
PackExpander{ true, (BehaviorOnDemandReflectHelper<typename AZStd::function_traits<Functions>::raw_fp_type>::QueueReflect(onDemandReflection), true)... };
[[maybe_unused]] PackExpander pe = { true, (BehaviorOnDemandReflectHelper<typename AZStd::function_traits<Functions>::raw_fp_type>::QueueReflect(onDemandReflection), true)... };
}
// Assumes parameters array is big enough to store all parameters
@@ -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;
@@ -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)
@@ -57,7 +57,7 @@ StackRecorder::Record(StackFrame* frames, unsigned int maxNumOfFrames, unsigned
int skip = static_cast<int>((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)
{
@@ -151,16 +151,6 @@ namespace GridMate
writeBuffer.Write(PackByte<AZ::u64, 0>(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
+3 -3
View File
@@ -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)
{
+1 -1
View File
@@ -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)
-1
View File
@@ -1520,7 +1520,6 @@ public:
const int oldVertexCount = GetVertexCount();
const int oldFaceCount = GetFaceCount();
const int nOldCoorCount = GetTexCoordCount();
if (GetTexCoordCount() != 0 && GetTexCoordCount() != oldVertexCount)
{
-2
View File
@@ -411,7 +411,6 @@ typename VectorMap<K, V, T, A>::iterator VectorMap<K, V, T, A>::lower_bound(cons
{
int count = static_cast<int>(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<K, V, T, A>::const_iterator VectorMap<K, V, T, A>::lower_boun
{
int count = static_cast<int>(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;
+1 -9
View File
@@ -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 = '/';
@@ -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();
+1 -3
View File
@@ -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<fileInfo> 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;
+2 -14
View File
@@ -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)
@@ -248,7 +248,6 @@ namespace AZ
AZStd::array_view<uint8_t> 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<const T*>(&constantBytes[elementOffset]);
@@ -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