Code/Framework compiling

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
pappeste
2021-06-16 18:08:23 -07:00
committed by Esteban Papp
parent ceab4a794c
commit 909384bd34
18 changed files with 39 additions and 41 deletions
@@ -98,7 +98,7 @@ namespace UnitTest
// If an entry is removed from the octree as an unintended side effect of updating an existing entry,
// GetEntryCount can't be relied upon to report the actual entry count.
// So manually count the entries when using the entry count for validation.
uint32_t manualEntryCount = 0;
size_t manualEntryCount = 0;
visScene->EnumerateNoCull([&manualEntryCount](const AzFramework::IVisibilityScene::NodeData& nodeData) { manualEntryCount += nodeData.m_entries.size(); });
EXPECT_EQ(manualEntryCount, expectedEntryCount);
@@ -409,7 +409,7 @@ namespace UnitTest
}
// Expect all the entries to be in the scene
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
ValidateEntryCountEqualsExpectedCount(m_octreeScene, static_cast<uint32_t>(visEntries.size()));
// Update them, without making any actual changes
for (AzFramework::VisibilityEntry& entry : visEntries)
@@ -418,6 +418,6 @@ namespace UnitTest
}
// Expect all the entries to be in the scene
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
ValidateEntryCountEqualsExpectedCount(m_octreeScene, static_cast<uint32_t>(visEntries.size()));
}
}
@@ -170,7 +170,7 @@ namespace AzNetworking
}
timeoutItem->UpdateTimeoutTime(startTimeMs);
NetworkOutputSerializer serializer(buffer.GetBuffer(), buffer.GetSize());
NetworkOutputSerializer serializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetSize()));
if (m_state == ConnectionState::Connecting)
{
const ConnectResult connectResult = m_networkInterface.GetConnectionListener().ValidateConnect(GetRemoteAddress(), header, serializer);
@@ -198,7 +198,7 @@ namespace AzNetworking
{
TcpPacketEncodingBuffer buffer;
{
NetworkInputSerializer serializer(buffer.GetBuffer(), buffer.GetCapacity());
NetworkInputSerializer serializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetCapacity()));
if (!const_cast<IPacket&>(packet).Serialize(serializer))
{
AZ_Assert(false, "SendReliablePacket: Unable to serialize packet [Type: %d]", packet.GetPacketType());
@@ -272,7 +272,7 @@ namespace AzNetworking
{
TcpPacketHeader header(packetType, aznumeric_cast<uint16_t>(payloadBuffer.GetSize()));
header.SetPacketFlag(PacketFlag::Compressed, shouldCompress);
NetworkInputSerializer serializer(headerBuffer.GetBuffer(), headerBuffer.GetCapacity());
NetworkInputSerializer serializer(headerBuffer.GetBuffer(), static_cast<uint32_t>(headerBuffer.GetCapacity()));
if (!header.Serialize(serializer))
{
return false;
@@ -313,7 +313,7 @@ namespace AzNetworking
m_networkInterface.GetMetrics().m_sendBytesCompressedDelta += (payloadSize - compressionMemBytesUsed);
writeBuffer.Resize(aznumeric_cast<int32_t>(compressionMemBytesUsed));
payloadSize = writeBuffer.GetSize();
payloadSize = static_cast<uint32_t>(writeBuffer.GetSize());
srcData = writeBuffer.GetBuffer();
}
@@ -12,7 +12,7 @@ namespace AzNetworking
{
template <uint32_t SIZE>
inline TcpRingBuffer<SIZE>::TcpRingBuffer()
: m_impl(m_buffer.data(), m_buffer.size())
: m_impl(m_buffer.data(), static_cast<uint32_t>(m_buffer.size()))
{
;
}
@@ -84,7 +84,7 @@ namespace AzNetworking
if (dtlsData.GetSize() > 0)
{
const uint8_t* encryptedData = dtlsData.GetBuffer();
const uint32_t encryptedSize = dtlsData.GetSize();
const uint32_t encryptedSize = static_cast<uint32_t>(dtlsData.GetSize());
BIO_write(m_readBio, encryptedData, encryptedSize);
}
DtlsEndpoint::HandshakeState prevState = m_state;
@@ -196,7 +196,7 @@ namespace AzNetworking
// Need to do this... connection negotiation may have left data in the write bio that we need to send out
if (BIO_ctrl_pending(m_writeBio) > 0)
{
const uint32_t maxBufferSize = outHandshakeData.GetCapacity();
const uint32_t maxBufferSize = static_cast<uint32_t>(outHandshakeData.GetCapacity());
outHandshakeData.Resize(maxBufferSize);
const int32_t dataSize = BIO_read(m_writeBio, outHandshakeData.GetBuffer(), maxBufferSize);
outHandshakeData.Resize(dataSize);
@@ -108,7 +108,7 @@ namespace AzNetworking
return true;
}
totalPacketSize += packetFragments[index]->GetChunkBuffer().GetSize();
totalPacketSize += static_cast<uint32_t>(packetFragments[index]->GetChunkBuffer().GetSize());
}
// We now mark this sequence as delivered, so if by some chance all the individual chunks get redelivered again we don't double deliver the reconstructed packet
@@ -125,7 +125,7 @@ namespace AzNetworking
uint8_t* bufferPointer = buffer.GetBuffer();
for (uint32_t index = 0; index < packetFragments.size(); ++index)
{
const uint32_t chunkSize = packetFragments[index]->GetChunkBuffer().GetSize();
const uint32_t chunkSize = static_cast<uint32_t>(packetFragments[index]->GetChunkBuffer().GetSize());
memcpy(bufferPointer, packetFragments[index]->GetChunkBuffer().GetBuffer(), chunkSize);
bufferPointer += chunkSize;
}
@@ -133,7 +133,7 @@ namespace AzNetworking
// We can erase all the chunks now, packet is completed
m_packetFragments.erase(fragmentSequence);
NetworkOutputSerializer networkSerializer(buffer.GetBuffer(), buffer.GetSize());
NetworkOutputSerializer networkSerializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetSize()));
{
ISerializer& networkISerializer = networkSerializer; // To get the default typeinfo parameters in ISerializer
@@ -249,7 +249,7 @@ namespace AzNetworking
continue;
}
decodedPacketData = m_decompressBuffer.GetBuffer();
decodedPacketSize = m_decompressBuffer.GetSize();
decodedPacketSize = static_cast<int32_t>(m_decompressBuffer.GetSize());
}
GetMetrics().m_recvBytesUncompressed += decodedPacketSize;
@@ -494,7 +494,7 @@ namespace AzNetworking
{
buffer.Resize(buffer.GetCapacity());
NetworkInputSerializer networkSerializer(buffer.GetBuffer(), buffer.GetCapacity());
NetworkInputSerializer networkSerializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetCapacity()));
ISerializer& serializer = networkSerializer; // To get the default typeinfo parameters in ISerializer
if (!header.SerializePacketFlags(serializer))
@@ -517,7 +517,7 @@ namespace AzNetworking
buffer.Resize(serializer.GetSize());
}
uint32_t packetSize = buffer.GetSize();
uint32_t packetSize = static_cast<uint32_t>(buffer.GetSize());
uint8_t* packetData = buffer.GetBuffer();
// If the packet doesn't fit within our MTU (minus potential SSL encryption overhead), break it up
@@ -549,7 +549,7 @@ namespace AzNetworking
UdpPacketEncodingBuffer writeBuffer;
if (m_compressor && shouldCompress)
{
NetworkInputSerializer flagSerializer(writeBuffer.GetBuffer(), writeBuffer.GetCapacity());
NetworkInputSerializer flagSerializer(writeBuffer.GetBuffer(), static_cast<uint32_t>(writeBuffer.GetCapacity()));
ISerializer& serializer = flagSerializer; // To get the default typeinfo parameters in ISerializer
header.SetPacketFlag(PacketFlag::Compressed, true);
@@ -562,7 +562,7 @@ namespace AzNetworking
AZ_Assert(flagSize == 1, "Flag bitfield should serialize to one byte");
// Compress the packet, make sure to offset by the size of the flag which is now serialized
const uint32_t payloadSize = buffer.GetSize() - flagSize;
const uint32_t payloadSize = static_cast<uint32_t>(buffer.GetSize() - flagSize);
uint8_t* payload = buffer.GetBuffer() + flagSize;
const AZStd::size_t maxSizeNeeded = m_compressor->GetMaxCompressedBufferSize(payloadSize);
AZStd::size_t compressionMemBytesUsed = 0;
@@ -578,7 +578,7 @@ namespace AzNetworking
if (compressionMemBytesUsed < payloadSize)
{
writeBuffer.Resize(aznumeric_cast<int32_t>(flagSize + compressionMemBytesUsed));
packetSize = writeBuffer.GetSize();
packetSize = static_cast<uint32_t>(writeBuffer.GetSize());
packetData = writeBuffer.GetBuffer();
// Track byte delta caused by compression
GetMetrics().m_sendBytesCompressedDelta += (packetSize - compressionMemBytesUsed);
@@ -177,7 +177,7 @@ namespace AzNetworking
}
IpAddress address;
const uint32_t bufferHead = receiveBuffer.GetSize();
const uint32_t bufferHead = static_cast<uint32_t>(receiveBuffer.GetSize());
if (bufferHead + MaxUdpTransmissionUnit >= receiveBuffer.GetCapacity())
{
AZLOG_INFO("Receive buffer full, leaving data on the socket. Size exceeded by %d",
@@ -241,7 +241,7 @@ namespace AzNetworking
#ifdef ENABLE_LATENCY_DEBUG
int32_t UdpSocket::SendInternalDeferred(const DeferredData& data) const
{
return SendInternal(data.m_address, data.m_dataBuffer.GetBuffer(), data.m_dataBuffer.GetSize(), data.m_encrypt, *data.m_dtlsEndpoint);
return SendInternal(data.m_address, data.m_dataBuffer.GetBuffer(), static_cast<uint32_t>(data.m_dataBuffer.GetSize()), data.m_encrypt, *data.m_dtlsEndpoint);
}
#endif
}
@@ -98,7 +98,7 @@ namespace AzToolsFramework
SourceControlFileInfo GetSceneSourceControlInfo() override;
bool AreAnyEntitiesSelected() override { return !m_selectedEntities.empty(); }
int GetSelectedEntitiesCount() override { return m_selectedEntities.size(); }
int GetSelectedEntitiesCount() override { return static_cast<int>(m_selectedEntities.size()); }
const EntityIdList& GetSelectedEntities() override { return m_selectedEntities; }
const EntityIdList& GetHighlightedEntities() override { return m_highlightedEntities; }
void SetSelectedEntities(const EntityIdList& selectedEntities) override;
@@ -34,8 +34,6 @@ namespace AzToolsFramework::AssetUtils::Internal
return {};
}
const int pathLen = sourceFolder.length() + 1;
AZ::IO::Path sourceWildcard{ sourceFolder };
@@ -164,7 +164,7 @@ namespace AzToolsFramework
AZStd::string path = prefix + pathIter->value.GetString();
pathIter->value.SetString(path.c_str(), path.length(), providedPatch.GetAllocator());
pathIter->value.SetString(path.c_str(), static_cast<rapidjson::SizeType>(path.length()), providedPatch.GetAllocator());
}
}
@@ -97,7 +97,7 @@ namespace AzToolsFramework
m_updatingTemplateInstancesInQueue = true;
const int instanceCountToUpdateInBatch =
m_instanceCountToUpdateInBatch == 0 ? m_instancesUpdateQueue.size() : m_instanceCountToUpdateInBatch;
m_instanceCountToUpdateInBatch == 0 ? static_cast<int>(m_instancesUpdateQueue.size()) : m_instanceCountToUpdateInBatch;
TemplateId currentTemplateId = InvalidTemplateId;
TemplateReference currentTemplateReference = AZStd::nullopt;
@@ -1445,7 +1445,7 @@ namespace AzToolsFramework
if (&owningInstance->get() == &commonRootEntityOwningInstance)
{
// If it's the same instance, we can add this entity to the new instance entities.
int priorEntitiesSize = entities.size();
size_t priorEntitiesSize = entities.size();
entities.insert(entity);
@@ -1624,7 +1624,7 @@ namespace AzToolsFramework
entityDomAfter.Parse(newEntityDomString.toUtf8().constData());
// Add the new Entity DOM to the Entities member of the instance
rapidjson::Value aliasName(newEntityAlias.c_str(), newEntityAlias.length(), domToAddDuplicatedEntitiesUnder.GetAllocator());
rapidjson::Value aliasName(newEntityAlias.c_str(), static_cast<rapidjson::SizeType>(newEntityAlias.length()), domToAddDuplicatedEntitiesUnder.GetAllocator());
entitiesIter->value.AddMember(AZStd::move(aliasName), entityDomAfter, domToAddDuplicatedEntitiesUnder.GetAllocator());
}
@@ -1696,7 +1696,7 @@ namespace AzToolsFramework
nestedInstanceDomAfter.Parse(newInstanceDomString.toUtf8().constData());
// Add the new Instance DOM to the Instances member of the instance
rapidjson::Value aliasName(newInstanceAlias.c_str(), newInstanceAlias.length(), domToAddDuplicatedInstancesUnder.GetAllocator());
rapidjson::Value aliasName(newInstanceAlias.c_str(), static_cast<rapidjson::SizeType>(newInstanceAlias.length()), domToAddDuplicatedInstancesUnder.GetAllocator());
instancesIter->value.AddMember(AZStd::move(aliasName), nestedInstanceDomAfter, domToAddDuplicatedInstancesUnder.GetAllocator());
}
@@ -251,7 +251,7 @@ namespace AzToolsFramework
{
EditorPythonConsoleInterface::GlobalFunctionCollection globalFunctionCollection;
editorPythonConsoleInterface->GetGlobalFunctionList(globalFunctionCollection);
m_items.reserve(globalFunctionCollection.size());
m_items.reserve(static_cast<int>(globalFunctionCollection.size()));
for (const EditorPythonConsoleInterface::GlobalFunction& globalFunction : globalFunctionCollection)
{
Item item;
@@ -247,7 +247,7 @@ namespace AzToolsFramework
if (highlightTextIndex >= 0)
{
const QString BACKGROUND_COLOR{ "#707070" };
label.insert(highlightTextIndex + m_filterString.length(), "</span>");
label.insert(highlightTextIndex + static_cast<int>(m_filterString.length()), "</span>");
label.insert(highlightTextIndex, "<span style=\"background-color: " + BACKGROUND_COLOR + "\">");
}
} while(highlightTextIndex > 0);
@@ -2643,22 +2643,22 @@ namespace AzToolsFramework
m_gui->m_statusComboBox->setItalic(false);
if (allActive)
{
m_gui->m_statusComboBox->setHeaderOverride(m_itemNames[StatusTypeToIndex(StatusType::StatusStartActive)]);
m_gui->m_statusComboBox->setCurrentIndex(StatusTypeToIndex(StatusType::StatusStartActive));
m_gui->m_statusComboBox->setHeaderOverride(m_itemNames[static_cast<int>(StatusTypeToIndex(StatusType::StatusStartActive))]);
m_gui->m_statusComboBox->setCurrentIndex(static_cast<int>(StatusTypeToIndex(StatusType::StatusStartActive)));
m_comboItems[StatusTypeToIndex(StatusType::StatusStartActive)]->setCheckState(Qt::Checked);
}
else
if (allInactive)
{
m_gui->m_statusComboBox->setHeaderOverride(m_itemNames[StatusTypeToIndex(StatusType::StatusStartInactive)]);
m_gui->m_statusComboBox->setCurrentIndex(StatusTypeToIndex(StatusType::StatusStartInactive));
m_gui->m_statusComboBox->setHeaderOverride(m_itemNames[static_cast<int>(StatusTypeToIndex(StatusType::StatusStartInactive))]);
m_gui->m_statusComboBox->setCurrentIndex(static_cast<int>(StatusTypeToIndex(StatusType::StatusStartInactive)));
m_comboItems[StatusTypeToIndex(StatusType::StatusStartInactive)]->setCheckState(Qt::Checked);
}
else
if (allEditorOnly)
{
m_gui->m_statusComboBox->setHeaderOverride(m_itemNames[StatusTypeToIndex(StatusType::StatusEditorOnly)]);
m_gui->m_statusComboBox->setCurrentIndex(StatusTypeToIndex(StatusType::StatusEditorOnly));
m_gui->m_statusComboBox->setHeaderOverride(m_itemNames[static_cast<int>(StatusTypeToIndex(StatusType::StatusEditorOnly))]);
m_gui->m_statusComboBox->setCurrentIndex(static_cast<int>(StatusTypeToIndex(StatusType::StatusEditorOnly)));
m_comboItems[StatusTypeToIndex(StatusType::StatusEditorOnly)]->setCheckState(Qt::Checked);
}
else // Some marked active, some not
@@ -110,8 +110,8 @@ namespace Benchmark
void BM_Prefab::SetUpMockValidatorForReadPrefab()
{
int pathCount = m_paths.size();
for (int number = 0; number < pathCount; ++number)
const size_t pathCount = m_paths.size();
for (size_t number = 0; number < pathCount; ++number)
{
m_mockIOActionValidator->ReadPrefabDom(
m_paths[number], UnitTest::PrefabTestDomUtils::CreatePrefabDom());
@@ -38,7 +38,7 @@ namespace UnitTest
const EntityAlias& entityAlias)
{
return GetPrefabDomEntitiesPath()
.Append(entityAlias.c_str(), entityAlias.length());
.Append(entityAlias.c_str(), static_cast<rapidjson::SizeType>(entityAlias.length()));
};
inline PrefabDomPath GetPrefabDomEntityNamePath(
@@ -62,7 +62,7 @@ namespace UnitTest
inline PrefabDomPath GetPrefabDomInstancePath(
const InstanceAlias& instanceAlias)
{
return GetPrefabDomInstancesPath().Append(instanceAlias.c_str(), instanceAlias.length());
return GetPrefabDomInstancesPath().Append(instanceAlias.c_str(), static_cast<rapidjson::SizeType>(instanceAlias.length()));
};
inline PrefabDomPath GetPrefabDomInstancePath(