From 81de77af8db737d1d65afe063159611df7134a39 Mon Sep 17 00:00:00 2001 From: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:07:46 -0700 Subject: [PATCH] Fix Type Casting Warnings in ReactCommon Summary: Casting warnings are treated as errors in React Native Windows. Adjusting casting to fix warnings. ## Changelog: [GENERAL] [FIXED] - Fixes type casting warnings that are treated as errors downstream in React Native Windows. X-link: https://github.com/facebook/react-native/pull/39818 Reviewed By: rshest Differential Revision: D49940422 Pulled By: NickGerleman fbshipit-source-id: e4d44326806a2b1974c7e50770e61807a007e39f --- yoga/node/Node.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/yoga/node/Node.cpp b/yoga/node/Node.cpp index 1a610bae..d84aac54 100644 --- a/yoga/node/Node.cpp +++ b/yoga/node/Node.cpp @@ -277,19 +277,22 @@ void Node::setLayoutDirection(Direction direction) { void Node::setLayoutMargin(float margin, YGEdge edge) { assertFatal( - edge < layout_.margin.size(), "Edge must be top/left/bottom/right"); + edge < static_cast(layout_.margin.size()), + "Edge must be top/left/bottom/right"); layout_.margin[edge] = margin; } void Node::setLayoutBorder(float border, YGEdge edge) { assertFatal( - edge < layout_.border.size(), "Edge must be top/left/bottom/right"); + edge < static_cast(layout_.border.size()), + "Edge must be top/left/bottom/right"); layout_.border[edge] = border; } void Node::setLayoutPadding(float padding, YGEdge edge) { assertFatal( - edge < layout_.padding.size(), "Edge must be top/left/bottom/right"); + edge < static_cast(layout_.padding.size()), + "Edge must be top/left/bottom/right"); layout_.padding[edge] = padding; } @@ -303,7 +306,8 @@ void Node::setLayoutComputedFlexBasis(const FloatOptional computedFlexBasis) { void Node::setLayoutPosition(float position, YGEdge edge) { assertFatal( - edge < layout_.position.size(), "Edge must be top/left/bottom/right"); + edge < static_cast(layout_.position.size()), + "Edge must be top/left/bottom/right"); layout_.position[edge] = position; }