diff --git a/packages/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp b/packages/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp index af06c4a3965eb9..a95a00340d2534 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp @@ -362,7 +362,7 @@ static void YGTransferLayoutOutputsRecursive( YGNodeSetHasNewLayout(root, false); - for (uint32_t i = 0; i < YGNodeGetChildCount(root); i++) { + for (size_t i = 0; i < YGNodeGetChildCount(root); i++) { YGTransferLayoutOutputsRecursive( env, thiz, YGNodeGetChild(root, i), layoutContext); } diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index d026972495d9df..7dbfffd3e4cd89 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -190,9 +190,7 @@ void YogaLayoutableShadowNode::appendYogaChild( ensureYogaChildrenLookFine(); yogaLayoutableChildren_.push_back(childNode); - yogaNode_.insertChild( - &childNode->yogaNode_, - static_cast(yogaNode_.getChildren().size())); + yogaNode_.insertChild(&childNode->yogaNode_, yogaNode_.getChildren().size()); ensureYogaChildrenLookFine(); } @@ -219,7 +217,7 @@ void YogaLayoutableShadowNode::adoptYogaChild(size_t index) { auto clonedChildNode = childNode.clone({}); // Replace the child node with a newly cloned one in the children list. - replaceChild(childNode, clonedChildNode, static_cast(index)); + replaceChild(childNode, clonedChildNode, static_cast(index)); } ensureYogaChildrenLookFine(); @@ -513,7 +511,7 @@ YGErrata YogaLayoutableShadowNode::resolveErrata(YGErrata defaultErrata) const { } YogaLayoutableShadowNode& YogaLayoutableShadowNode::cloneChildInPlace( - int32_t layoutableChildIndex) { + size_t layoutableChildIndex) { ensureUnsealed(); const auto& childNode = *yogaLayoutableChildren_[layoutableChildIndex]; @@ -525,7 +523,8 @@ YogaLayoutableShadowNode& YogaLayoutableShadowNode::cloneChildInPlace( ShadowNodeFragment::childrenPlaceholder(), childNode.getState()}); - replaceChild(childNode, clonedChildNode, layoutableChildIndex); + replaceChild( + childNode, clonedChildNode, static_cast(layoutableChildIndex)); return static_cast(*clonedChildNode); } @@ -790,7 +789,7 @@ Rect YogaLayoutableShadowNode::getContentBounds() const { YGNodeRef YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector( YGNodeConstRef /*oldYogaNode*/, YGNodeConstRef parentYogaNode, - int childIndex) { + size_t childIndex) { SystraceSection s("YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector"); auto& parentNode = shadowNodeFromContext(parentYogaNode); diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h index 03a5997e643b40..826059be4d802a 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h @@ -153,7 +153,7 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode { /** * Replcaes a child with a mutable clone of itself, returning the clone. */ - YogaLayoutableShadowNode& cloneChildInPlace(int32_t layoutableChildIndex); + YogaLayoutableShadowNode& cloneChildInPlace(size_t layoutableChildIndex); static yoga::Config& initializeYogaConfig( yoga::Config& config, @@ -161,7 +161,7 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode { static YGNodeRef yogaNodeCloneCallbackConnector( YGNodeConstRef oldYogaNode, YGNodeConstRef parentYogaNode, - int childIndex); + size_t childIndex); static YGSize yogaNodeMeasureCallbackConnector( YGNodeConstRef yogaNode, float width, diff --git a/packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp b/packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp index 0e89c06d8a83ca..9a91e032bcb83c 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp @@ -216,8 +216,8 @@ YOGA_EXPORT void YGNodeFree(const YGNodeRef nodeRef) { node->setOwner(nullptr); } - const uint32_t childCount = YGNodeGetChildCount(node); - for (uint32_t i = 0; i < childCount; i++) { + const size_t childCount = node->getChildCount(); + for (size_t i = 0; i < childCount; i++) { auto child = node->getChild(i); child->setOwner(nullptr); } @@ -236,8 +236,8 @@ YOGA_EXPORT void YGNodeFreeRecursiveWithCleanupFunc( YGNodeCleanupFunc cleanup) { const auto root = resolveRef(rootRef); - uint32_t skipped = 0; - while (YGNodeGetChildCount(root) > skipped) { + size_t skipped = 0; + while (root->getChildCount() > skipped) { const auto child = root->getChild(skipped); if (child->getOwner() != root) { // Don't free shared nodes that we don't own. @@ -297,7 +297,7 @@ YOGA_EXPORT bool YGNodeIsReferenceBaseline(YGNodeConstRef node) { YOGA_EXPORT void YGNodeInsertChild( const YGNodeRef ownerRef, const YGNodeRef childRef, - const uint32_t index) { + const size_t index) { auto owner = resolveRef(ownerRef); auto child = resolveRef(childRef); @@ -319,7 +319,7 @@ YOGA_EXPORT void YGNodeInsertChild( YOGA_EXPORT void YGNodeSwapChild( const YGNodeRef ownerRef, const YGNodeRef childRef, - const uint32_t index) { + const size_t index) { auto owner = resolveRef(ownerRef); auto child = resolveRef(childRef); @@ -333,7 +333,7 @@ YOGA_EXPORT void YGNodeRemoveChild( auto owner = resolveRef(ownerRef); auto excludedChild = resolveRef(excludedChildRef); - if (YGNodeGetChildCount(owner) == 0) { + if (owner->getChildCount() == 0) { // This is an empty set. Nothing to remove. return; } @@ -354,7 +354,7 @@ YOGA_EXPORT void YGNodeRemoveChild( YOGA_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef ownerRef) { auto owner = resolveRef(ownerRef); - const uint32_t childCount = YGNodeGetChildCount(owner); + const size_t childCount = owner->getChildCount(); if (childCount == 0) { // This is an empty set already. Nothing to do. return; @@ -363,7 +363,7 @@ YOGA_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef ownerRef) { if (firstChild->getOwner() == owner) { // If the first child has this node as its owner, we assume that this child // set is unique. - for (uint32_t i = 0; i < childCount; i++) { + for (size_t i = 0; i < childCount; i++) { yoga::Node* oldChild = owner->getChild(i); oldChild->setLayout({}); // layout is no longer valid oldChild->setOwner(nullptr); @@ -381,7 +381,7 @@ YOGA_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef ownerRef) { YOGA_EXPORT void YGNodeSetChildren( const YGNodeRef ownerRef, const YGNodeRef* childrenRefs, - const uint32_t count) { + const size_t count) { auto owner = resolveRef(ownerRef); auto children = reinterpret_cast(childrenRefs); @@ -391,7 +391,7 @@ YOGA_EXPORT void YGNodeSetChildren( const std::vector childrenVector = {children, children + count}; if (childrenVector.size() == 0) { - if (YGNodeGetChildCount(owner) > 0) { + if (owner->getChildCount() > 0) { for (auto* child : owner->getChildren()) { child->setLayout({}); child->setOwner(nullptr); @@ -400,7 +400,7 @@ YOGA_EXPORT void YGNodeSetChildren( owner->markDirtyAndPropagate(); } } else { - if (YGNodeGetChildCount(owner) > 0) { + if (owner->getChildCount() > 0) { for (auto* oldChild : owner->getChildren()) { // Our new children may have nodes in common with the old children. We // don't reset these common nodes. @@ -420,7 +420,7 @@ YOGA_EXPORT void YGNodeSetChildren( } YOGA_EXPORT YGNodeRef -YGNodeGetChild(const YGNodeRef nodeRef, const uint32_t index) { +YGNodeGetChild(const YGNodeRef nodeRef, const size_t index) { const auto node = resolveRef(nodeRef); if (index < node->getChildren().size()) { @@ -429,8 +429,8 @@ YGNodeGetChild(const YGNodeRef nodeRef, const uint32_t index) { return nullptr; } -YOGA_EXPORT uint32_t YGNodeGetChildCount(const YGNodeConstRef node) { - return static_cast(resolveRef(node)->getChildren().size()); +YOGA_EXPORT size_t YGNodeGetChildCount(const YGNodeConstRef node) { + return resolveRef(node)->getChildren().size(); } YOGA_EXPORT YGNodeRef YGNodeGetOwner(const YGNodeRef node) { diff --git a/packages/react-native/ReactCommon/yoga/yoga/Yoga.h b/packages/react-native/ReactCommon/yoga/yoga/Yoga.h index fa5b9834ec6169..41464e1ee5b461 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/Yoga.h +++ b/packages/react-native/ReactCommon/yoga/yoga/Yoga.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -47,7 +48,7 @@ typedef int (*YGLogger)( typedef YGNodeRef (*YGCloneNodeFunc)( YGNodeConstRef oldNode, YGNodeConstRef owner, - int childIndex); + size_t childIndex); // YGNode WIN_EXPORT YGNodeRef YGNodeNew(void); @@ -63,23 +64,20 @@ WIN_EXPORT void YGNodeReset(YGNodeRef node); WIN_EXPORT void YGNodeInsertChild( YGNodeRef node, YGNodeRef child, - uint32_t index); + size_t index); -WIN_EXPORT void YGNodeSwapChild( - YGNodeRef node, - YGNodeRef child, - uint32_t index); +WIN_EXPORT void YGNodeSwapChild(YGNodeRef node, YGNodeRef child, size_t index); WIN_EXPORT void YGNodeRemoveChild(YGNodeRef node, YGNodeRef child); WIN_EXPORT void YGNodeRemoveAllChildren(YGNodeRef node); -WIN_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, uint32_t index); +WIN_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, size_t index); WIN_EXPORT YGNodeRef YGNodeGetOwner(YGNodeRef node); WIN_EXPORT YGNodeRef YGNodeGetParent(YGNodeRef node); -WIN_EXPORT uint32_t YGNodeGetChildCount(YGNodeConstRef node); +WIN_EXPORT size_t YGNodeGetChildCount(YGNodeConstRef node); WIN_EXPORT void YGNodeSetChildren( YGNodeRef owner, const YGNodeRef* children, - uint32_t count); + size_t count); WIN_EXPORT void YGNodeSetIsReferenceBaseline( YGNodeRef node, diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/Baseline.cpp b/packages/react-native/ReactCommon/yoga/yoga/algorithm/Baseline.cpp index 6fb256c7bd774d..5042074a1e8227 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/Baseline.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/Baseline.cpp @@ -34,8 +34,8 @@ float calculateBaseline(const yoga::Node* node, void* layoutContext) { } yoga::Node* baselineChild = nullptr; - const uint32_t childCount = YGNodeGetChildCount(node); - for (uint32_t i = 0; i < childCount; i++) { + const size_t childCount = node->getChildCount(); + for (size_t i = 0; i < childCount; i++) { auto child = node->getChild(i); if (child->getLineIndex() > 0) { break; diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp index d94de530218af7..7d6c931cc3810e 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp @@ -965,8 +965,8 @@ static CollectFlexItemsRowValues calculateCollectFlexItemsRowValues( const float mainAxisownerSize, const float availableInnerWidth, const float availableInnerMainDim, - const uint32_t startOfLineIndex, - const uint32_t lineCount) { + const size_t startOfLineIndex, + const size_t lineCount) { CollectFlexItemsRowValues flexAlgoRowMeasurement = {}; flexAlgoRowMeasurement.relativeChildren.reserve(node->getChildren().size()); @@ -977,7 +977,7 @@ static CollectFlexItemsRowValues calculateCollectFlexItemsRowValues( const float gap = node->getGapForAxis(mainAxis, availableInnerWidth).unwrap(); // Add items to the current line until it's full or we run out of items. - uint32_t endOfLineIndex = startOfLineIndex; + size_t endOfLineIndex = startOfLineIndex; for (; endOfLineIndex < node->getChildren().size(); endOfLineIndex++) { auto child = node->getChild(endOfLineIndex); if (child->getStyle().display() == YGDisplayNone || @@ -1408,7 +1408,7 @@ static void resolveFlexibleLength( static void YGJustifyMainAxis( yoga::Node* const node, CollectFlexItemsRowValues& collectedFlexItemsValues, - const uint32_t startOfLineIndex, + const size_t startOfLineIndex, const YGFlexDirection mainAxis, const YGFlexDirection crossAxis, const YGMeasureMode measureModeMainDim, @@ -1456,8 +1456,7 @@ static void YGJustifyMainAxis( } int numberOfAutoMarginsOnCurrentLine = 0; - for (uint32_t i = startOfLineIndex; - i < collectedFlexItemsValues.endOfLineIndex; + for (size_t i = startOfLineIndex; i < collectedFlexItemsValues.endOfLineIndex; i++) { auto child = node->getChild(i); if (child->getStyle().positionType() != YGPositionTypeAbsolute) { @@ -1517,8 +1516,7 @@ static void YGJustifyMainAxis( float maxAscentForCurrentLine = 0; float maxDescentForCurrentLine = 0; bool isNodeBaselineLayout = isBaselineLayout(node); - for (uint32_t i = startOfLineIndex; - i < collectedFlexItemsValues.endOfLineIndex; + for (size_t i = startOfLineIndex; i < collectedFlexItemsValues.endOfLineIndex; i++) { const auto child = node->getChild(i); const Style& childStyle = child->getStyle(); @@ -1906,11 +1904,11 @@ static void calculateLayoutImpl( // STEP 4: COLLECT FLEX ITEMS INTO FLEX LINES // Indexes of children that represent the first and last items in the line. - uint32_t startOfLineIndex = 0; - uint32_t endOfLineIndex = 0; + size_t startOfLineIndex = 0; + size_t endOfLineIndex = 0; // Number of lines. - uint32_t lineCount = 0; + size_t lineCount = 0; // Accumulated cross dimensions of all lines so far. float totalLineCrossDim = 0; @@ -2093,7 +2091,7 @@ static void calculateLayoutImpl( // STEP 7: CROSS-AXIS ALIGNMENT // We can skip child alignment if we're just measuring the container. if (performLayout) { - for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { + for (size_t i = startOfLineIndex; i < endOfLineIndex; i++) { const auto child = node->getChild(i); if (child->getStyle().display() == YGDisplayNone) { continue; @@ -2291,10 +2289,10 @@ static void calculateLayoutImpl( break; } } - uint32_t endIndex = 0; - for (uint32_t i = 0; i < lineCount; i++) { - const uint32_t startIndex = endIndex; - uint32_t ii; + size_t endIndex = 0; + for (size_t i = 0; i < lineCount; i++) { + const size_t startIndex = endIndex; + size_t ii; // compute the line's height and find the endIndex float lineHeight = 0; @@ -2537,7 +2535,7 @@ static void calculateLayoutImpl( // As we only wrapped in normal direction yet, we need to reverse the // positions on wrap-reverse. if (performLayout && node->getStyle().flexWrap() == YGWrapWrapReverse) { - for (uint32_t i = 0; i < childCount; i++) { + for (size_t i = 0; i < childCount; i++) { const auto child = node->getChild(i); if (child->getStyle().positionType() != YGPositionTypeAbsolute) { child->setLayoutPosition( @@ -2586,7 +2584,7 @@ static void calculateLayoutImpl( // Set trailing position if necessary. if (needsMainTrailingPos || needsCrossTrailingPos) { - for (uint32_t i = 0; i < childCount; i++) { + for (size_t i = 0; i < childCount; i++) { const auto child = node->getChild(i); if (child->getStyle().display() == YGDisplayNone) { continue; @@ -2710,7 +2708,7 @@ bool calculateLayoutInternal( cachedResults = &layout->cachedLayout; } else { // Try to use the measurement cache. - for (uint32_t i = 0; i < layout->nextCachedMeasurementsIndex; i++) { + for (size_t i = 0; i < layout->nextCachedMeasurementsIndex; i++) { if (canUseCachedMeasurement( widthMeasureMode, availableWidth, diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CollectFlexItemsRowValues.h b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CollectFlexItemsRowValues.h index 58a3916ac3f5b4..f3ba7e2947a55f 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CollectFlexItemsRowValues.h +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CollectFlexItemsRowValues.h @@ -39,11 +39,11 @@ namespace facebook::yoga { // and/or grow. struct CollectFlexItemsRowValues { - uint32_t itemsOnLine; + size_t itemsOnLine; float sizeConsumedOnCurrentLine; float totalFlexGrowFactors; float totalFlexShrinkScaledFactors; - uint32_t endOfLineIndex; + size_t endOfLineIndex; std::vector relativeChildren; float remainingFreeSpace; // The size of the mainDim for the row after considering size, padding, margin diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp b/packages/react-native/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp index 105e57a31522c9..0a4bda22132885 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp @@ -125,8 +125,8 @@ void roundLayoutResultsToPixelGrid( absoluteNodeTop, pointScaleFactor, false, textRounding), YGDimensionHeight); - const uint32_t childCount = YGNodeGetChildCount(node); - for (uint32_t i = 0; i < childCount; i++) { + const size_t childCount = node->getChildCount(); + for (size_t i = 0; i < childCount; i++) { roundLayoutResultsToPixelGrid( node->getChild(i), pointScaleFactor, absoluteNodeLeft, absoluteNodeTop); } diff --git a/packages/react-native/ReactCommon/yoga/yoga/config/Config.cpp b/packages/react-native/ReactCommon/yoga/yoga/config/Config.cpp index deb7b5fe4d8768..f4dea8433c0f08 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/config/Config.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/config/Config.cpp @@ -131,7 +131,7 @@ void Config::setCloneNodeCallback(std::nullptr_t) { YGNodeRef Config::cloneNode( YGNodeConstRef node, YGNodeConstRef owner, - int childIndex, + size_t childIndex, void* cloneContext) const { YGNodeRef clone = nullptr; if (cloneNodeCallback_.noContext != nullptr) { diff --git a/packages/react-native/ReactCommon/yoga/yoga/config/Config.h b/packages/react-native/ReactCommon/yoga/yoga/config/Config.h index 75bde993b61a96..d06b1bacf79a26 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/config/Config.h +++ b/packages/react-native/ReactCommon/yoga/yoga/config/Config.h @@ -34,7 +34,7 @@ using LogWithContextFn = int (*)( using CloneWithContextFn = YGNodeRef (*)( YGNodeConstRef node, YGNodeConstRef owner, - int childIndex, + size_t childIndex, void* cloneContext); #pragma pack(push) @@ -92,7 +92,7 @@ class YOGA_EXPORT Config : public ::YGConfig { YGNodeRef cloneNode( YGNodeConstRef node, YGNodeConstRef owner, - int childIndex, + size_t childIndex, void* cloneContext) const; private: diff --git a/packages/react-native/ReactCommon/yoga/yoga/debug/NodeToString.cpp b/packages/react-native/ReactCommon/yoga/yoga/debug/NodeToString.cpp index 30697dd6edc9a9..787ec976e46bee 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/debug/NodeToString.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/debug/NodeToString.cpp @@ -227,9 +227,9 @@ void nodeToString( } appendFormattedString(str, ">"); - const uint32_t childCount = static_cast(node->getChildren().size()); + const size_t childCount = node->getChildCount(); if (options & YGPrintOptionsChildren && childCount > 0) { - for (uint32_t i = 0; i < childCount; i++) { + for (size_t i = 0; i < childCount; i++) { appendFormattedString(str, "\n"); nodeToString(str, node->getChild(i), options, level + 1); } diff --git a/packages/react-native/ReactCommon/yoga/yoga/node/Node.cpp b/packages/react-native/ReactCommon/yoga/yoga/node/Node.cpp index 295f4eb9c616ad..005542dae1cfaf 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/node/Node.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/node/Node.cpp @@ -484,7 +484,7 @@ YOGA_EXPORT void Node::clearChildren() { // Other Methods void Node::cloneChildrenIfNeeded(void* cloneContext) { - int i = 0; + size_t i = 0; for (Node*& child : children_) { if (child->getOwner() != this) { child = resolveRef(config_->cloneNode(child, this, i, cloneContext)); diff --git a/packages/react-native/ReactCommon/yoga/yoga/node/Node.h b/packages/react-native/ReactCommon/yoga/yoga/node/Node.h index 4e8ef24edea3f8..e99a37642561c1 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/node/Node.h +++ b/packages/react-native/ReactCommon/yoga/yoga/node/Node.h @@ -68,7 +68,7 @@ class YOGA_EXPORT Node : public ::YGNode { YGDirtiedFunc dirtied_ = nullptr; Style style_ = {}; LayoutResults layout_ = {}; - uint32_t lineIndex_ = 0; + size_t lineIndex_ = 0; Node* owner_ = nullptr; std::vector children_ = {}; Config* config_; @@ -146,7 +146,7 @@ class YOGA_EXPORT Node : public ::YGNode { const LayoutResults& getLayout() const { return layout_; } - uint32_t getLineIndex() const { return lineIndex_; } + size_t getLineIndex() const { return lineIndex_; } bool isReferenceBaseline() const { return flags_.isReferenceBaseline; } @@ -276,7 +276,7 @@ class YOGA_EXPORT Node : public ::YGNode { void setLayout(const LayoutResults& layout) { layout_ = layout; } - void setLineIndex(uint32_t lineIndex) { lineIndex_ = lineIndex; } + void setLineIndex(size_t lineIndex) { lineIndex_ = lineIndex; } void setIsReferenceBaseline(bool isReferenceBaseline) { flags_.isReferenceBaseline = isReferenceBaseline;