Format C/C++ files

Summary: Run new `format.sh`.

Reviewed By: emilsjolander

Differential Revision: D4481501

fbshipit-source-id: 5791bee9919b44282d1549029ff8e078f253ddf8
This commit is contained in:
Pascal Hartig
2017-01-31 09:28:10 -08:00
committed by Facebook Github Bot
parent 9afb65da34
commit 326ae15532
22 changed files with 138 additions and 144 deletions

View File

@@ -7,8 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
#include <yoga/Yoga.h>
struct _MeasureConstraint {
float width;
@@ -23,11 +23,12 @@ struct _MeasureConstraintList {
};
static YGSize _measure(YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
struct _MeasureConstraintList *constraintList = (struct _MeasureConstraintList *)YGNodeGetContext(node);
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
struct _MeasureConstraintList *constraintList =
(struct _MeasureConstraintList *) YGNodeGetContext(node);
struct _MeasureConstraint *constraints = constraintList->constraints;
uint32_t currentIndex = constraintList->length;
(&constraints[currentIndex])->width = width;
@@ -36,16 +37,16 @@ static YGSize _measure(YGNodeRef node,
(&constraints[currentIndex])->heightMode = heightMode;
constraintList->length = currentIndex + 1;
return YGSize {
return YGSize{
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
.height = heightMode == YGMeasureModeUndefined ? 10 : width,
};
}
TEST(YogaTest, exactly_measure_stretched_child_column) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -69,9 +70,9 @@ TEST(YogaTest, exactly_measure_stretched_child_column) {
}
TEST(YogaTest, exactly_measure_stretched_child_row) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -96,9 +97,9 @@ TEST(YogaTest, exactly_measure_stretched_child_row) {
}
TEST(YogaTest, at_most_main_axis_column) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -122,9 +123,9 @@ TEST(YogaTest, at_most_main_axis_column) {
}
TEST(YogaTest, at_most_cross_axis_column) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -149,9 +150,9 @@ TEST(YogaTest, at_most_cross_axis_column) {
}
TEST(YogaTest, at_most_main_axis_row) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -176,9 +177,9 @@ TEST(YogaTest, at_most_main_axis_row) {
}
TEST(YogaTest, at_most_cross_axis_row) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -204,9 +205,9 @@ TEST(YogaTest, at_most_cross_axis_row) {
}
TEST(YogaTest, flex_child) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -233,9 +234,9 @@ TEST(YogaTest, flex_child) {
}
TEST(YogaTest, flex_child_with_flex_basis) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -260,9 +261,9 @@ TEST(YogaTest, flex_child_with_flex_basis) {
}
TEST(YogaTest, overflow_scroll_column) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();
@@ -291,9 +292,9 @@ TEST(YogaTest, overflow_scroll_column) {
}
TEST(YogaTest, overflow_scroll_row) {
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
.length = 0,
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
};
const YGNodeRef root = YGNodeNew();