diff --git a/src/Core/Resource/Cooker/CAreaCooker.cpp b/src/Core/Resource/Cooker/CAreaCooker.cpp index b43ed913..5e646b33 100644 --- a/src/Core/Resource/Cooker/CAreaCooker.cpp +++ b/src/Core/Resource/Cooker/CAreaCooker.cpp @@ -4,7 +4,7 @@ #include "Core/GameProject/DependencyListBuilders.h" #include -const bool gkForceDisableCompression = false; +constexpr bool gkForceDisableCompression = false; CAreaCooker::CAreaCooker() = default; diff --git a/src/Core/Resource/Cooker/CWorldCooker.cpp b/src/Core/Resource/Cooker/CWorldCooker.cpp index 81ca6533..5ff13845 100644 --- a/src/Core/Resource/Cooker/CWorldCooker.cpp +++ b/src/Core/Resource/Cooker/CWorldCooker.cpp @@ -222,13 +222,13 @@ bool CWorldCooker::CookMLVL(CWorld *pWorld, IOutputStream& rMLVL) LayerNameOffsets.push_back(LayerNames.size()); rMLVL.WriteLong(rArea.Layers.size()); - uint64 LayerActiveFlags = -1; + uint64 LayerActiveFlags = UINT64_MAX; for (uint32 iLyr = 0; iLyr < rArea.Layers.size(); iLyr++) { CWorld::SArea::SLayer& rLayer = rArea.Layers[iLyr]; if (!rLayer.Active) - LayerActiveFlags &= ~(1 << iLyr); + LayerActiveFlags &= ~(UINT64_C(1) << iLyr); LayerNames.push_back(rLayer.LayerName); LayerStateIDs.push_back(rLayer.LayerStateID); diff --git a/src/Core/Resource/Script/NPropertyMap.cpp b/src/Core/Resource/Script/NPropertyMap.cpp index 161ec70e..af1fb5a3 100644 --- a/src/Core/Resource/Script/NPropertyMap.cpp +++ b/src/Core/Resource/Script/NPropertyMap.cpp @@ -9,14 +9,14 @@ namespace NPropertyMap namespace { /** Path to the property map file */ -const char* gpkLegacyMapPath = "templates/PropertyMapLegacy.xml"; -const char* gpkMapPath = "templates/PropertyMap.xml"; +constexpr char gpkLegacyMapPath[] = "templates/PropertyMapLegacy.xml"; +constexpr char gpkMapPath[] = "templates/PropertyMap.xml"; /** Whether to do name lookups from the legacy map */ -const bool gkUseLegacyMapForNameLookups = false; +constexpr bool gkUseLegacyMapForNameLookups = false; /** Whether to update names in the legacy map */ -const bool gkUseLegacyMapForUpdates = false; +constexpr bool gkUseLegacyMapForUpdates = false; /** Whether the map is dirty (has unsaved changes */ bool gMapIsDirty = false; @@ -150,7 +150,7 @@ void LoadMap() ASSERT(!gMapIsLoaded); debugf("Loading property map"); - if (gkUseLegacyMapForNameLookups) + if constexpr (gkUseLegacyMapForNameLookups) { CXMLReader Reader(gDataDir + gpkLegacyMapPath); ASSERT(Reader.IsValid()); @@ -199,7 +199,7 @@ void SaveMap(bool Force) if (gMapIsDirty || Force) { - if (gkUseLegacyMapForUpdates) + if constexpr (gkUseLegacyMapForUpdates) { CXMLWriter Writer(gDataDir + gpkLegacyMapPath, "PropertyMap"); ASSERT(Writer.IsValid()); @@ -235,7 +235,7 @@ const char* GetPropertyName(IProperty* pInProperty) { ConditionalLoadMap(); - if (gkUseLegacyMapForNameLookups) + if constexpr (gkUseLegacyMapForNameLookups) { const auto MapFind = gLegacyNameMap.find(pInProperty->ID()); return MapFind == gLegacyNameMap.cend() ? "Unknown" : *MapFind->second; @@ -327,7 +327,7 @@ void RetrieveXMLsWithProperty(uint32 ID, const char* pkTypeName, std::set