Code/Tools fixes
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -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 ");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user