Format C/C++ files
Summary: Run new `format.sh`. Reviewed By: emilsjolander Differential Revision: D4481501 fbshipit-source-id: 5791bee9919b44282d1549029ff8e078f253ddf8
This commit is contained in:
committed by
Facebook Github Bot
parent
9afb65da34
commit
326ae15532
@@ -7,8 +7,8 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YGLayout.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIView (Yoga)
|
||||
|
||||
|
@@ -18,7 +18,8 @@
|
||||
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
||||
|
||||
/**
|
||||
The property that decides during layout/sizing whether or not styling properties should be applied. Defaults to NO.
|
||||
The property that decides during layout/sizing whether or not styling properties should be applied.
|
||||
Defaults to NO.
|
||||
*/
|
||||
@property (nonatomic, readwrite, assign, setter=setEnabled:) BOOL isEnabled;
|
||||
|
||||
@@ -84,7 +85,7 @@
|
||||
/**
|
||||
Get the resolved direction of this node. This won't be YGDirectionInherit
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) YGDirection resolvedDirection;
|
||||
@property (nonatomic, readonly, assign) YGDirection resolvedDirection;
|
||||
|
||||
/**
|
||||
Perform a layout calculation and update the frames of the views in the hierarchy with the results
|
||||
@@ -92,19 +93,21 @@
|
||||
- (void)applyLayout NS_SWIFT_NAME(applyLayout());
|
||||
|
||||
/**
|
||||
Returns the size of the view if no constraints were given. This could equivalent to calling [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||
Returns the size of the view if no constraints were given. This could equivalent to calling [self
|
||||
sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
||||
@property (nonatomic, readonly, assign) CGSize intrinsicSize;
|
||||
|
||||
/**
|
||||
Returns the number of children that are using Flexbox.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) NSUInteger numberOfChildren;
|
||||
@property (nonatomic, readonly, assign) NSUInteger numberOfChildren;
|
||||
|
||||
/**
|
||||
Return a BOOL indiciating whether or not we this node contains any subviews that are included in Yoga's layout.
|
||||
Return a BOOL indiciating whether or not we this node contains any subviews that are included in
|
||||
Yoga's layout.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) BOOL isLeaf;
|
||||
@property (nonatomic, readonly, assign) BOOL isLeaf;
|
||||
|
||||
/**
|
||||
Mark that a view's layout needs to be recalculated. Only works for leaf views.
|
||||
|
@@ -13,4 +13,3 @@
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -10,6 +10,4 @@
|
||||
|
||||
@interface ViewController : UIViewController
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -10,13 +10,8 @@
|
||||
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||
#include "stdafx.h"
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
|
@@ -20,6 +20,4 @@
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
@@ -7,15 +7,15 @@
|
||||
* 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 _measure(YGNodeRef node,
|
||||
float width,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
return YGSize {
|
||||
return YGSize{
|
||||
.width = widthMode == YGMeasureModeExactly ? width : 50,
|
||||
.height = heightMode == YGMeasureModeExactly ? height : 50,
|
||||
};
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, computed_layout_margin) {
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, computed_layout_padding) {
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, assert_default_values) {
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, dirty_propagation) {
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, start_overrides) {
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
|
@@ -7,19 +7,18 @@
|
||||
* 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);
|
||||
int *measureCount = (int *) YGNodeGetContext(node);
|
||||
(*measureCount)++;
|
||||
|
||||
return YGSize {
|
||||
return YGSize{
|
||||
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
|
||||
.height = heightMode == YGMeasureModeUndefined ? 10 : height,
|
||||
};
|
||||
@@ -30,12 +29,17 @@ static YGSize _measureMin(YGNodeRef node,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
|
||||
int *measureCount = (int *)YGNodeGetContext(node);
|
||||
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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,14 +48,13 @@ static YGSize _measure_84_49(YGNodeRef node,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
int *measureCount = (int*) YGNodeGetContext(node);
|
||||
int *measureCount = (int *) YGNodeGetContext(node);
|
||||
if (measureCount) {
|
||||
(*measureCount)++;
|
||||
}
|
||||
|
||||
return YGSize {
|
||||
.width = 84.f,
|
||||
.height = 49.f,
|
||||
return YGSize{
|
||||
.width = 84.f, .height = 49.f,
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
@@ -27,7 +27,8 @@ static YGSize _measure(YGNodeRef node,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
struct _MeasureConstraintList *constraintList = (struct _MeasureConstraintList *)YGNodeGetContext(node);
|
||||
struct _MeasureConstraintList *constraintList =
|
||||
(struct _MeasureConstraintList *) YGNodeGetContext(node);
|
||||
struct _MeasureConstraint *constraints = constraintList->constraints;
|
||||
uint32_t currentIndex = constraintList->length;
|
||||
(&constraints[currentIndex])->width = width;
|
||||
@@ -36,14 +37,14 @@ 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 {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -69,7 +70,7 @@ TEST(YogaTest, exactly_measure_stretched_child_column) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, exactly_measure_stretched_child_row) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -96,7 +97,7 @@ TEST(YogaTest, exactly_measure_stretched_child_row) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, at_most_main_axis_column) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -122,7 +123,7 @@ TEST(YogaTest, at_most_main_axis_column) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, at_most_cross_axis_column) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -149,7 +150,7 @@ TEST(YogaTest, at_most_cross_axis_column) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, at_most_main_axis_row) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -176,7 +177,7 @@ TEST(YogaTest, at_most_main_axis_row) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, at_most_cross_axis_row) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -204,7 +205,7 @@ TEST(YogaTest, at_most_cross_axis_row) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, flex_child) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -233,7 +234,7 @@ TEST(YogaTest, flex_child) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, flex_child_with_flex_basis) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -260,7 +261,7 @@ TEST(YogaTest, flex_child_with_flex_basis) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, overflow_scroll_column) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
@@ -291,7 +292,7 @@ TEST(YogaTest, overflow_scroll_column) {
|
||||
}
|
||||
|
||||
TEST(YogaTest, overflow_scroll_row) {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList {
|
||||
struct _MeasureConstraintList constraintList = _MeasureConstraintList{
|
||||
.length = 0,
|
||||
.constraints = (struct _MeasureConstraint *) malloc(10 * sizeof(struct _MeasureConstraint)),
|
||||
};
|
||||
|
@@ -7,22 +7,21 @@
|
||||
* 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 _measure(YGNodeRef node,
|
||||
float width,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
int *measureCount = (int*) YGNodeGetContext(node);
|
||||
int *measureCount = (int *) YGNodeGetContext(node);
|
||||
if (measureCount) {
|
||||
(*measureCount)++;
|
||||
}
|
||||
|
||||
return YGSize {
|
||||
.width = 10,
|
||||
.height = 10,
|
||||
return YGSize{
|
||||
.width = 10, .height = 10,
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -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>
|
||||
|
||||
extern int32_t gNodeInstanceCount;
|
||||
|
||||
@@ -66,12 +66,14 @@ TEST(YogaTest, memory_func_test_funcs) {
|
||||
TEST(YogaTest, memory_func_assert_zero_nodes) {
|
||||
gNodeInstanceCount = 0; // Reset YGNode instance count for memory func test
|
||||
const YGNodeRef root = YGNodeNew();
|
||||
ASSERT_DEATH(YGSetMemoryFuncs(&testMalloc, &testCalloc, &testRealloc, &testFree), "Cannot set memory functions: all node must be freed first");
|
||||
ASSERT_DEATH(YGSetMemoryFuncs(&testMalloc, &testCalloc, &testRealloc, &testFree),
|
||||
"Cannot set memory functions: all node must be freed first");
|
||||
YGNodeFreeRecursive(root);
|
||||
}
|
||||
|
||||
TEST(YogaTest, memory_func_assert_all_non_null) {
|
||||
gNodeInstanceCount = 0; // Reset YGNode instance count for memory func test
|
||||
ASSERT_DEATH(YGSetMemoryFuncs(NULL, &testCalloc, &testRealloc, &testFree), "Cannot set memory functions: functions must be all NULL or Non-NULL");
|
||||
ASSERT_DEATH(YGSetMemoryFuncs(NULL, &testCalloc, &testRealloc, &testFree),
|
||||
"Cannot set memory functions: functions must be all NULL or Non-NULL");
|
||||
}
|
||||
#endif
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, dont_cache_computed_flex_basis_between_layouts) {
|
||||
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis, true);
|
||||
|
@@ -7,18 +7,16 @@
|
||||
* 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 _measureFloor(YGNodeRef node,
|
||||
float width,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
|
||||
return YGSize{
|
||||
width = 10.2f,
|
||||
height = 10.2f,
|
||||
width = 10.2f, height = 10.2f,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,10 +25,8 @@ static YGSize _measureCeil(YGNodeRef node,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
|
||||
return YGSize{
|
||||
width = 10.5,
|
||||
height = 10.5,
|
||||
width = 10.5, height = 10.5,
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -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>
|
||||
|
||||
TEST(YogaTest, copy_style_same) {
|
||||
const YGNodeRef node0 = YGNodeNew();
|
||||
|
Reference in New Issue
Block a user