Merge branch 'development' into cmake/AddressSanitizer

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-19 12:25:41 -07:00
429 changed files with 1447 additions and 1830 deletions
@@ -337,7 +337,7 @@ bool AssetBuilderComponent::ConnectToAssetProcessor()
AZStd::string overridePort;
if (GetParameter(s_paramPort, overridePort, false))
{
connectionSettings.m_assetProcessorPort = AZStd::stoi(overridePort);
connectionSettings.m_assetProcessorPort = static_cast<AZ::u16>(AZStd::stoi(overridePort));
}
//the asset builder may have been given an optional asset platform to use
@@ -814,7 +814,7 @@ public:
AssetRecognizer good;
good.m_name = "Good";
good.m_version = versionNumber;
good.m_version = static_cast<char>(versionNumber);
good.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.foo", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard);
good.m_platformSpecs["pc"] = good_spec;
good.m_productAssetType = builderProductType;
@@ -147,7 +147,7 @@ void RCcontrollerUnitTests::RunRCControllerTests()
if (returnedCount != expectedCount)
{
Q_EMIT UnitTestFailed("RCJobListModel has " + QString(returnedCount) + " elements, which is invalid. Expected " + expectedCount);
Q_EMIT UnitTestFailed("RCJobListModel has " + QString(returnedCount) + " elements, which is invalid. Expected " + QString(expectedCount));
return;
}
@@ -38,7 +38,7 @@ bool BatchApplicationServer::startListening(unsigned short port)
// Since we're starting up builders ourselves and informing them of the port chosen, we can scan for a free port
while (!listen(QHostAddress::Any, m_serverListeningPort))
while (!listen(QHostAddress::Any, static_cast<quint16>(m_serverListeningPort)))
{
auto error = serverError();
@@ -197,7 +197,7 @@ namespace AssetProcessor
}
else if (valueName == "order")
{
scanFolderEntry.m_scanOrder = value;
scanFolderEntry.m_scanOrder = static_cast<int>(value);
}
}
@@ -475,7 +475,7 @@ namespace AssetProcessor
RCAssetRecognizer& assetRecognizer = *assetRecognizerEntryIt;
if (valueName == "priority")
{
assetRecognizer.m_recognizer.m_priority = value;
assetRecognizer.m_recognizer.m_priority = static_cast<int>(value);
}
}
@@ -49,7 +49,7 @@ void UnitTestShaderCompilerServer::startServer()
{
if (!m_server->isListening())
{
if (!m_server->listen(QHostAddress(m_serverAddress), m_serverPort))
if (!m_server->listen(QHostAddress(m_serverAddress), static_cast<quint16>(m_serverPort)))
{
AZ_TracePrintf(AssetProcessor::DebugChannel, "Server %s could not start.\n", m_serverAddress.toUtf8().data());
emit errorMessage("Server could not start ");
@@ -72,10 +72,15 @@ namespace O3de
return true;
}
#if !AZ_TRAIT_OS_PLATFORM_APPLE
AZ_PUSH_DISABLE_WARNING(4996, "-Wunknown-warning-option")
#if AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS
char noConfirmation[64]{};
size_t variableSize = 0;
getenv_s(&variableSize, noConfirmation, AZ_ARRAY_SIZE(noConfirmation), "LY_NO_CONFIRM");
if (variableSize == 0)
#else
const char* noConfirmation = getenv("LY_NO_CONFIRM");
AZ_POP_DISABLE_WARNING
if (noConfirmation == nullptr)
#endif
{
int argCount = 0;
@@ -29,7 +29,7 @@ namespace O3DE::ProjectManager
{
QPixmap pixmap(iconPath);
qreal aspectRatio = static_cast<qreal>(pixmap.width()) / pixmap.height();
m_platformIcons.insert(platform, QIcon(iconPath).pixmap(s_platformIconSize * aspectRatio, s_platformIconSize));
m_platformIcons.insert(platform, QIcon(iconPath).pixmap(static_cast<int>(static_cast<qreal>(s_platformIconSize) * aspectRatio), s_platformIconSize));
}
void GemItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const
@@ -48,7 +48,7 @@ namespace O3DE::ProjectManager
CalcRects(options, fullRect, itemRect, contentRect);
QFont standardFont(options.font);
standardFont.setPixelSize(s_fontSize);
standardFont.setPixelSize(static_cast<int>(s_fontSize));
QFontMetrics standardFontMetrics(standardFont);
painter->save();
@@ -78,7 +78,7 @@ namespace O3DE::ProjectManager
QString gemName = GemModel::GetName(modelIndex);
QFont gemNameFont(options.font);
const int firstColumnMaxTextWidth = s_summaryStartX - 30;
gemNameFont.setPixelSize(s_gemNameFontSize);
gemNameFont.setPixelSize(static_cast<int>(s_gemNameFontSize));
gemNameFont.setBold(true);
gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth);
QRect gemNameRect = GetTextRect(gemNameFont, gemName, s_gemNameFontSize);
@@ -178,7 +178,7 @@ namespace O3DE::ProjectManager
QRect GemItemDelegate::GetTextRect(QFont& font, const QString& text, qreal fontSize) const
{
font.setPixelSize(fontSize);
font.setPixelSize(static_cast<int>(fontSize));
return QFontMetrics(font).boundingRect(text);
}
@@ -208,7 +208,7 @@ namespace O3DE::ProjectManager
const QPixmap& pixmap = iterator.value();
painter->drawPixmap(contentRect.left() + startX, contentRect.bottom() - s_platformIconSize, pixmap);
qreal aspectRatio = static_cast<qreal>(pixmap.width()) / pixmap.height();
startX += s_platformIconSize * aspectRatio + s_platformIconSize / 2.5;
startX += static_cast<int>(s_platformIconSize * aspectRatio + s_platformIconSize / 2.5);
}
}
}
@@ -35,7 +35,7 @@ namespace O3DE::ProjectManager
CalcRects(options, fullRect, itemRect, contentRect);
QFont standardFont(options.font);
standardFont.setPixelSize(s_fontSize);
standardFont.setPixelSize(static_cast<int>(s_fontSize));
QFontMetrics standardFontMetrics(standardFont);
painter->save();
@@ -55,10 +55,10 @@ namespace O3DE::ProjectManager
QFont gemNameFont(options.font);
const int firstColumnMaxTextWidth = s_summaryStartX - 30;
gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth);
gemNameFont.setPixelSize(s_gemNameFontSize);
gemNameFont.setPixelSize(static_cast<int>(s_gemNameFontSize));
gemNameFont.setBold(true);
QRect gemNameRect = GetTextRect(gemNameFont, gemName, s_gemNameFontSize);
gemNameRect.moveTo(contentRect.left(), contentRect.center().y() - s_gemNameFontSize);
gemNameRect.moveTo(contentRect.left(), contentRect.center().y() - static_cast<int>(s_gemNameFontSize));
painter->setFont(gemNameFont);
painter->setPen(m_textColor);
@@ -117,7 +117,7 @@ namespace O3DE::ProjectManager
const int updateStatusEvery = 64;
if (outFileCount % updateStatusEvery == 0)
{
statusCallback(outFileCount, outTotalSizeInBytes);
statusCallback(outFileCount, static_cast<int>(outTotalSizeInBytes));
}
}
}
@@ -163,7 +163,7 @@ namespace O3DE::ProjectManager
}
QLocale locale;
const float progressDialogRangeHalf = qFabs(progressDialog->maximum() - progressDialog->minimum()) * 0.5f;
const float progressDialogRangeHalf = static_cast<float>(qFabs(progressDialog->maximum() - progressDialog->minimum()) * 0.5f);
for (const QString& file : original.entryList(QDir::Files))
{
if (progressDialog->wasCanceled())
@@ -184,7 +184,7 @@ namespace O3DE::ProjectManager
// for cases combining many small files and some really large files.
const float normalizedNumFiles = static_cast<float>(outNumCopiedFiles) / filesToCopyCount;
const float normalizedFileSize = static_cast<float>(outCopiedFileSize) / totalSizeToCopy;
const int progress = normalizedNumFiles * progressDialogRangeHalf + normalizedFileSize * progressDialogRangeHalf;
const int progress = static_cast<int>(normalizedNumFiles * progressDialogRangeHalf + normalizedFileSize * progressDialogRangeHalf);
progressDialog->setValue(progress);
const QString copiedFileSizeString = locale.formattedDataSize(outCopiedFileSize);
@@ -434,8 +434,6 @@ namespace O3DE::ProjectManager
{
return AZ::Success(AZStd::move(engineInfo));
}
return AZ::Failure();
}
bool PythonBindings::SetEngineInfo(const EngineInfo& engineInfo)
@@ -49,7 +49,7 @@ namespace AZ
double totalFramesAtDefaultTimeStep = totalTicks / AssImpAnimationImporter::s_defaultTimeStepBetweenFrames + 1;
if (!AZ::IsClose(totalFramesAtDefaultTimeStep, numKeys, 1))
{
numKeys = AZStd::ceilf(totalFramesAtDefaultTimeStep);
numKeys = static_cast<AZ::u32>(AZStd::ceilf(static_cast<float>(totalFramesAtDefaultTimeStep)));
}
return numKeys;
}
@@ -122,7 +122,7 @@ namespace AZ
if (keys[lastIndex + 1].mTime != keys[lastIndex].mTime)
{
normalizedTimeBetweenFrames =
(time - keys[lastIndex].mTime) / (keys[lastIndex + 1].mTime - keys[lastIndex].mTime);
static_cast<float>((time - keys[lastIndex].mTime) / (keys[lastIndex + 1].mTime - keys[lastIndex].mTime));
}
else
{
@@ -620,7 +620,7 @@ namespace AZ
for (unsigned int valIdx = 0; valIdx < key.mNumValuesAndWeights; ++valIdx)
{
int currentValue = key.mValues[valIdx];
KeyData thisKey(key.mWeights[valIdx], key.mTime);
KeyData thisKey(static_cast<float>(key.mWeights[valIdx]), static_cast<float>(key.mTime));
valueToKeyDataMap[currentValue].insert(
AZStd::upper_bound(valueToKeyDataMap[currentValue].begin(), valueToKeyDataMap[currentValue].end(),thisKey),
thisKey);
@@ -97,7 +97,7 @@ namespace AZ
}
Pending pending;
pending.m_bone = bone;
pending.m_numVertices = totalVertices;
pending.m_numVertices = static_cast<unsigned int>(totalVertices);
pending.m_skinWeightData = skinWeightData;
pending.m_vertOffset = vertexCount;
m_pendingSkinWeights.push_back(pending);
@@ -88,7 +88,7 @@ namespace AZ
AZ_Error(
Utilities::ErrorWindow,
meshesPerTextureCoordinateIndex[texCoordIndex] == 0 ||
meshesPerTextureCoordinateIndex[texCoordIndex] == currentNode->mNumMeshes,
meshesPerTextureCoordinateIndex[texCoordIndex] == static_cast<int>(currentNode->mNumMeshes),
"Texture coordinate index %d for node %s is not on all meshes on this node. "
"Placeholder arbitrary texture values will be generated to allow the data to process, but the source art "
"needs to be fixed to correct this. All meshes on this node should have the same number of texture coordinate channels.",
@@ -26,8 +26,8 @@ namespace TestImpact
void ImpactAnalysisTestSelection(size_t numSelectedTests, size_t numDiscardedTests, size_t numExcludedTests, size_t numDraftedTests)
{
const float totalTests = numSelectedTests + numDiscardedTests;
const float saving = (1.0 - (numSelectedTests / totalTests)) * 100.0f;
const float totalTests = static_cast<float>(numSelectedTests + numDiscardedTests);
const float saving = (1.0f - (numSelectedTests / totalTests)) * 100.0f;
std::cout << numSelectedTests << " tests selected, " << numDiscardedTests << " tests discarded (" << saving << "% test saving)\n";
std::cout << "Of which " << numExcludedTests << " tests have been excluded and " << numDraftedTests << " tests have been drafted.\n";
@@ -67,7 +67,7 @@ namespace TestImpact
const auto getDuration = [&Keys](const AZ::rapidxml::xml_node<>* node)
{
const AZStd::string duration = node->first_attribute(Keys[DurationKey])->value();
return AZStd::chrono::milliseconds(AZStd::stof(duration) * 1000.f);
return AZStd::chrono::milliseconds(static_cast<AZStd::sys_time_t>(AZStd::stof(duration) * 1000.f));
};
TestRunSuite testSuite;
@@ -95,7 +95,7 @@ namespace TestImpact
const auto getResult = [](const AZ::rapidxml::xml_node<>* node)
{
for (auto child_node = node->first_node("failure"); child_node; child_node = child_node->next_sibling())
if (auto child_node = node->first_node("failure"))
{
return TestRunResult::Failed;
}
@@ -52,7 +52,7 @@ namespace TestImpact
// Run duration
writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]);
writer.Uint(testRun.GetDuration().count());
writer.Uint(static_cast<unsigned int>(testRun.GetDuration().count()));
// Suites
writer.Key(TestRunFields::Keys[TestRunFields::SuitesKey]);
@@ -69,7 +69,7 @@ namespace TestImpact
// Suite duration
writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]);
writer.Uint(suite.m_duration.count());
writer.Uint(static_cast<unsigned int>(suite.m_duration.count()));
// Suite enabled
writer.Key(TestRunFields::Keys[TestRunFields::EnabledKey]);
@@ -93,7 +93,7 @@ namespace TestImpact
// Test duration
writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]);
writer.Uint(test.m_duration.count());
writer.Uint(static_cast<unsigned int>(test.m_duration.count()));
// Test status
writer.Key(TestRunFields::Keys[TestRunFields::StatusKey]);