Apply clang-format update fixes

Reviewed By: igorsugak

Differential Revision: D25861849

fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
This commit is contained in:
Andres Suarez
2021-01-10 10:03:53 -08:00
committed by Facebook GitHub Bot
parent a38ec3d7a4
commit 584dfe961e
8 changed files with 57 additions and 50 deletions

View File

@@ -28,14 +28,16 @@
UIView* child2 = [UIView new]; UIView* child2 = [UIView new];
child2.backgroundColor = [UIColor greenColor]; child2.backgroundColor = [UIColor greenColor];
child2.frame = (CGRect){.size = { child2.frame = (CGRect){
.size = {
.width = 200, .width = 200,
.height = 100, .height = 100,
}}; }};
UIView* child3 = [UIView new]; UIView* child3 = [UIView new];
child3.backgroundColor = [UIColor yellowColor]; child3.backgroundColor = [UIColor yellowColor];
child3.frame = (CGRect){.size = { child3.frame = (CGRect){
.size = {
.width = 100, .width = 100,
.height = 100, .height = 100,
}}; }};

View File

@@ -23,8 +23,8 @@ static YGSize globalMeasureFunc(
Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef)); Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef));
Size size = node.callMeasureFunc(width, widthMode, height, heightMode); Size size = node.callMeasureFunc(width, widthMode, height, heightMode);
YGSize ygSize = {static_cast<float>(size.width), YGSize ygSize = {
static_cast<float>(size.height)}; static_cast<float>(size.width), static_cast<float>(size.height)};
return ygSize; return ygSize;
} }

View File

@@ -303,8 +303,8 @@ EventArgs createArgs(
}; };
EventArgs args = createArgs<E>(node, data); EventArgs args = createArgs<E>(node, data);
args.eventTestDataPtr = {new EventTestData{eventTestData}, args.eventTestDataPtr = {
deleteEventTestData}; new EventTestData{eventTestData}, deleteEventTestData};
return args; return args;
} }

View File

@@ -29,7 +29,8 @@ TEST(YogaTest, computed_layout_margin) {
} }
TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) { TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop, const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom, YGEdgeBottom,
YGEdgeStart, YGEdgeStart,
YGEdgeEnd, YGEdgeEnd,
@@ -58,7 +59,8 @@ TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
} }
TEST(YogaTest, margin_side_overrides_all) { TEST(YogaTest, margin_side_overrides_all) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop, const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom, YGEdgeBottom,
YGEdgeStart, YGEdgeStart,
YGEdgeEnd, YGEdgeEnd,

View File

@@ -29,7 +29,8 @@ TEST(YogaTest, computed_layout_padding) {
} }
TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) { TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop, const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom, YGEdgeBottom,
YGEdgeStart, YGEdgeStart,
YGEdgeEnd, YGEdgeEnd,
@@ -58,7 +59,8 @@ TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
} }
TEST(YogaTest, padding_side_overrides_all) { TEST(YogaTest, padding_side_overrides_all) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop, const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom, YGEdgeBottom,
YGEdgeStart, YGEdgeStart,
YGEdgeEnd, YGEdgeEnd,

View File

@@ -29,8 +29,8 @@ TEST(YogaTest, set_children_adds_children_to_parent) {
const std::vector<YGNodeRef> expectedChildren = {root_child0, root_child1}; const std::vector<YGNodeRef> expectedChildren = {root_child0, root_child1};
ASSERT_EQ(children, expectedChildren); ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child1)}; YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {root, root}; const std::vector<YGNodeRef> expectedOwners = {root, root};
ASSERT_EQ(owners, expectedOwners); ASSERT_EQ(owners, expectedOwners);
@@ -49,8 +49,8 @@ TEST(YogaTest, set_children_to_empty_removes_old_children) {
const std::vector<YGNodeRef> expectedChildren = {}; const std::vector<YGNodeRef> expectedChildren = {};
ASSERT_EQ(children, expectedChildren); ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child1)}; YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr}; const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
ASSERT_EQ(owners, expectedOwners); ASSERT_EQ(owners, expectedOwners);
@@ -73,8 +73,8 @@ TEST(YogaTest, set_children_replaces_non_common_children) {
const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child3}; const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child3};
ASSERT_EQ(children, expectedChildren); ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child1)}; YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr}; const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
ASSERT_EQ(owners, expectedOwners); ASSERT_EQ(owners, expectedOwners);
@@ -100,7 +100,8 @@ TEST(YogaTest, set_children_keeps_and_reorders_common_children) {
root_child2, root_child1, root_child3}; root_child2, root_child1, root_child3};
ASSERT_EQ(children, expectedChildren); ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1), YGNodeGetOwner(root_child1),
YGNodeGetOwner(root_child2), YGNodeGetOwner(root_child2),
YGNodeGetOwner(root_child3)}; YGNodeGetOwner(root_child3)};

View File

@@ -125,8 +125,8 @@ public:
data.repr &= ~PERCENT_BIT; data.repr &= ~PERCENT_BIT;
data.repr += BIAS; data.repr += BIAS;
return YGValue{data.value, return YGValue{
payload_.repr & 0x40000000 ? YGUnitPercent : YGUnitPoint}; data.value, payload_.repr & 0x40000000 ? YGUnitPercent : YGUnitPoint};
} }
bool isUndefined() const noexcept { bool isUndefined() const noexcept {

View File

@@ -3531,8 +3531,8 @@ static void YGNodelayoutImpl(
YGNodeBoundAxisWithinMinAndMax( YGNodeBoundAxisWithinMinAndMax(
node, node,
crossAxis, crossAxis,
YGFloatOptional{totalLineCrossDim + YGFloatOptional{
paddingAndBorderAxisCross}, totalLineCrossDim + paddingAndBorderAxisCross},
crossAxisownerSize) crossAxisownerSize)
.unwrap()), .unwrap()),
paddingAndBorderAxisCross), paddingAndBorderAxisCross),