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,51 +7,54 @@
* 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>
static YGSize _measureMax(YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
int *measureCount = (int *)YGNodeGetContext(node);
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
int *measureCount = (int *) YGNodeGetContext(node);
(*measureCount)++;
return YGSize {
return YGSize{
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
.height = heightMode == YGMeasureModeUndefined ? 10 : height,
};
}
static YGSize _measureMin(YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
int *measureCount = (int *)YGNodeGetContext(node);
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
int *measureCount = (int *) YGNodeGetContext(node);
*measureCount = *measureCount + 1;
return YGSize {
.width = widthMode == YGMeasureModeUndefined || (widthMode == YGMeasureModeAtMost && width > 10) ? 10 : width,
.height = heightMode == YGMeasureModeUndefined || (heightMode == YGMeasureModeAtMost && height > 10) ? 10 : height,
return YGSize{
.width =
widthMode == YGMeasureModeUndefined || (widthMode == YGMeasureModeAtMost && width > 10)
? 10
: width,
.height =
heightMode == YGMeasureModeUndefined || (heightMode == YGMeasureModeAtMost && height > 10)
? 10
: height,
};
}
static YGSize _measure_84_49(YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
int *measureCount = (int*) YGNodeGetContext(node);
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
int *measureCount = (int *) YGNodeGetContext(node);
if (measureCount) {
(*measureCount)++;
}
return YGSize {
.width = 84.f,
.height = 49.f,
return YGSize{
.width = 84.f, .height = 49.f,
};
}
@@ -155,19 +158,19 @@ TEST(YogaTest, remeasure_with_already_measured_value_smaller_but_still_float_equ
YGNodeStyleSetWidth(root, 288.f);
YGNodeStyleSetHeight(root, 288.f);
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetPadding(root_child0, YGEdgeAll, 2.88f);
YGNodeStyleSetFlexDirection(root_child0, YGFlexDirectionRow);
YGNodeInsertChild(root, root_child0, 0);
const YGNodeRef root_child0_child0 = YGNodeNew();
YGNodeSetContext(root_child0_child0, &measureCount);
YGNodeSetMeasureFunc(root_child0_child0, _measure_84_49);
YGNodeInsertChild(root_child0, root_child0_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
YGNodeFreeRecursive(root);
ASSERT_EQ(1, measureCount);