From c07b9d31bf1c1aca107823b5ad91c3fb1b0641af Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 19:21:50 -0700 Subject: [PATCH] PR comments/improvements Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Math/Guid.h | 2 +- Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h | 4 ++-- Code/Legacy/CryCommon/CryLibrary.h | 6 +++--- Code/Legacy/CrySystem/XML/xml.cpp | 4 ++-- Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp | 1 - 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Guid.h b/Code/Framework/AzCore/AzCore/Math/Guid.h index e2a56f86d8..9889092743 100644 --- a/Code/Framework/AzCore/AzCore/Math/Guid.h +++ b/Code/Framework/AzCore/AzCore/Math/Guid.h @@ -66,7 +66,7 @@ typedef const GUID& REFIID; const GUID name \ = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } -inline static REFGUID GUID_NULL() +inline REFGUID GUID_NULL() { static GUID guid = { 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; return guid; diff --git a/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h b/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h index df6dd87494..74bcd53877 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h +++ b/Code/Framework/AzNetworking/AzNetworking/Utilities/Endian.h @@ -14,14 +14,14 @@ #include #if AZ_TRAIT_NEEDS_HTONLL -inline static const uint64_t htonll(uint64_t value) +inline const uint64_t htonll(uint64_t value) { const uint32_t hiValue = htonl(static_cast(value >> 32)); const uint32_t loValue = htonl(static_cast(value & 0x00000000FFFFFFFF)); return static_cast(hiValue) << 32 | static_cast(loValue); } -inline static const uint64_t ntohll(uint64_t value) +inline const uint64_t ntohll(uint64_t value) { return htonll(value); } diff --git a/Code/Legacy/CryCommon/CryLibrary.h b/Code/Legacy/CryCommon/CryLibrary.h index b7e1c0f359..e12e7c6c36 100644 --- a/Code/Legacy/CryCommon/CryLibrary.h +++ b/Code/Legacy/CryCommon/CryLibrary.h @@ -97,14 +97,14 @@ static const char* GetModulePath() return getenv(gEnvName); } -inline static void SetModulePath(const char* pModulePath) +inline 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 .. -inline static HMODULE CryLoadLibrary(const char* libName, bool bLazy = false, bool bInModulePath = true) +inline HMODULE CryLoadLibrary(const char* libName, bool bLazy = false, bool bInModulePath = true) { const char* libPath = nullptr; char pathBuffer[MAX_PATH] = {0}; @@ -161,7 +161,7 @@ inline static HMODULE CryLoadLibrary(const char* libName, bool bLazy = false, bo return module; } -inline static bool CryFreeLibrary(void* lib) +inline bool CryFreeLibrary(void* lib) { if (lib) { diff --git a/Code/Legacy/CrySystem/XML/xml.cpp b/Code/Legacy/CrySystem/XML/xml.cpp index ccc878b8f1..a6f3d5b564 100644 --- a/Code/Legacy/CrySystem/XML/xml.cpp +++ b/Code/Legacy/CrySystem/XML/xml.cpp @@ -1756,9 +1756,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 - AZStd::fixed_string<32> strScripts = {"Scripts/"}; + constexpr AZStd::fixed_string<32> strScripts{"Scripts/"}; // exclude files and PAKs from Mods folder - AZStd::fixed_string<8> modsStr = {"Mods/"}; + constexpr 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/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp index 769c6fd51d..8c88a49b12 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp @@ -328,7 +328,6 @@ namespace } AZ::AtomFont::AtomFont([[maybe_unused]] ISystem* system) - : m_fonts() { CryLogAlways("Using FreeType %d.%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH);