Skip to content

Commit

Permalink
Apply clang-format update fixes
Browse files Browse the repository at this point in the history
Reviewed By: igorsugak

Differential Revision: D25861849

fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
  • Loading branch information
zertosh authored and facebook-github-bot committed Jan 10, 2021
1 parent a38ec3d commit 584dfe9
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 50 deletions.
18 changes: 10 additions & 8 deletions YogaKit/YogaKitSample/YogaKitSample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@ - (void)viewDidLoad {

UIView* child2 = [UIView new];
child2.backgroundColor = [UIColor greenColor];
child2.frame = (CGRect){.size = {
.width = 200,
.height = 100,
}};
child2.frame = (CGRect){
.size = {
.width = 200,
.height = 100,
}};

UIView* child3 = [UIView new];
child3.backgroundColor = [UIColor yellowColor];
child3.frame = (CGRect){.size = {
.width = 100,
.height = 100,
}};
child3.frame = (CGRect){
.size = {
.width = 100,
.height = 100,
}};

[child2 addSubview:child3];
[root addSubview:child1];
Expand Down
4 changes: 2 additions & 2 deletions javascript/sources/Node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ static YGSize globalMeasureFunc(
Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef));

Size size = node.callMeasureFunc(width, widthMode, height, heightMode);
YGSize ygSize = {static_cast<float>(size.width),
static_cast<float>(size.height)};
YGSize ygSize = {
static_cast<float>(size.width), static_cast<float>(size.height)};

return ygSize;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/EventsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ EventArgs createArgs(
};

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

Expand Down
26 changes: 14 additions & 12 deletions tests/YGComputedMarginTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ TEST(YogaTest, computed_layout_margin) {
}

TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};
const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};

for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
for (const auto& edge : edges) {
Expand All @@ -58,12 +59,13 @@ TEST(YogaTest, margin_side_overrides_horizontal_and_vertical) {
}

TEST(YogaTest, margin_side_overrides_all) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};
const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};

for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
for (const auto& edge : edges) {
Expand Down
26 changes: 14 additions & 12 deletions tests/YGComputedPaddingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ TEST(YogaTest, computed_layout_padding) {
}

TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};
const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};

for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
for (const auto& edge : edges) {
Expand All @@ -58,12 +59,13 @@ TEST(YogaTest, padding_side_overrides_horizontal_and_vertical) {
}

TEST(YogaTest, padding_side_overrides_all) {
const std::array<YGEdge, 6> edges = {{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};
const std::array<YGEdge, 6> edges = {
{YGEdgeTop,
YGEdgeBottom,
YGEdgeStart,
YGEdgeEnd,
YGEdgeLeft,
YGEdgeRight}};

for (float edgeValue = 0; edgeValue < 2; ++edgeValue) {
for (const auto& edge : edges) {
Expand Down
21 changes: 11 additions & 10 deletions tests/YGTreeMutationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ TEST(YogaTest, set_children_adds_children_to_parent) {
const std::vector<YGNodeRef> expectedChildren = {root_child0, root_child1};
ASSERT_EQ(children, expectedChildren);

const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {root, root};
ASSERT_EQ(owners, expectedOwners);

Expand All @@ -49,8 +49,8 @@ TEST(YogaTest, set_children_to_empty_removes_old_children) {
const std::vector<YGNodeRef> expectedChildren = {};
ASSERT_EQ(children, expectedChildren);

const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
ASSERT_EQ(owners, expectedOwners);

Expand All @@ -73,8 +73,8 @@ TEST(YogaTest, set_children_replaces_non_common_children) {
const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child3};
ASSERT_EQ(children, expectedChildren);

const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
ASSERT_EQ(owners, expectedOwners);

Expand All @@ -100,10 +100,11 @@ TEST(YogaTest, set_children_keeps_and_reorders_common_children) {
root_child2, root_child1, root_child3};
ASSERT_EQ(children, expectedChildren);

const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1),
YGNodeGetOwner(root_child2),
YGNodeGetOwner(root_child3)};
const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1),
YGNodeGetOwner(root_child2),
YGNodeGetOwner(root_child3)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, root, root, root};
ASSERT_EQ(owners, expectedOwners);

Expand Down
4 changes: 2 additions & 2 deletions yoga/CompactValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class YOGA_EXPORT CompactValue {
data.repr &= ~PERCENT_BIT;
data.repr += BIAS;

return YGValue{data.value,
payload_.repr & 0x40000000 ? YGUnitPercent : YGUnitPoint};
return YGValue{
data.value, payload_.repr & 0x40000000 ? YGUnitPercent : YGUnitPoint};
}

bool isUndefined() const noexcept {
Expand Down
4 changes: 2 additions & 2 deletions yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3531,8 +3531,8 @@ static void YGNodelayoutImpl(
YGNodeBoundAxisWithinMinAndMax(
node,
crossAxis,
YGFloatOptional{totalLineCrossDim +
paddingAndBorderAxisCross},
YGFloatOptional{
totalLineCrossDim + paddingAndBorderAxisCross},
crossAxisownerSize)
.unwrap()),
paddingAndBorderAxisCross),
Expand Down

0 comments on commit 584dfe9

Please sign in to comment.