Fix some compilation errors due to warnings of potentially returning unitialized variables. (#5796)

Signed-off-by: moraaar <moraaar@amazon.com>
This commit is contained in:
moraaar
2021-11-22 09:57:42 +00:00
committed by GitHub
parent bb906da58c
commit 5145fceedc
4 changed files with 4 additions and 4 deletions
@@ -293,7 +293,7 @@ namespace MCore
// check if the test point is inside the polygon
AZ::Vector2 ClosestPointToPoly(const AZ::Vector2* polyPoints, size_t numPoints, const AZ::Vector2& testPoint)
{
AZ::Vector2 result;
AZ::Vector2 result = AZ::Vector2::CreateZero();
float closestDist = FLT_MAX;
for (size_t i = 0; i < numPoints; ++i)
{
+1 -1
View File
@@ -497,7 +497,7 @@ void CDraw2d::SetSortKey(int64_t key)
AZ::Vector2 CDraw2d::Align(AZ::Vector2 position, AZ::Vector2 size,
HAlign horizontalAlignment, VAlign verticalAlignment)
{
AZ::Vector2 result;
AZ::Vector2 result = AZ::Vector2::CreateZero();
switch (horizontalAlignment)
{
case HAlign::Left:
+1 -1
View File
@@ -4936,7 +4936,7 @@ AZStd::string UiTextComponent::GetLocalizedText([[maybe_unused]] const AZStd::st
////////////////////////////////////////////////////////////////////////////////////////////////////
AZ::Vector2 UiTextComponent::CalculateAlignedPositionWithYOffset(const UiTransformInterface::RectPoints& points)
{
AZ::Vector2 pos;
AZ::Vector2 pos = AZ::Vector2::CreateZero();
const DrawBatchLines& drawBatchLines = GetDrawBatchLines();
size_t numLinesOfText = drawBatchLines.batchLines.size();
@@ -200,7 +200,7 @@ namespace ScriptCanvasEditor
AZ::TypeId DataTypePaletteModel::FindTypeIdForIndex(const QModelIndex& index) const
{
AZ::TypeId retVal;
AZ::TypeId retVal = AZ::TypeId::CreateNull();
if (index.row() >= 0 && index.row() < m_variableTypes.size())
{