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.
*/
#import <UIKit/UIKit.h>
#import "YGLayout.h"
#import <UIKit/UIKit.h>
@interface UIView (Yoga)

View File

@@ -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;
@@ -92,7 +93,8 @@
- (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;
@@ -102,7 +104,8 @@
@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;

View File

@@ -13,4 +13,3 @@
@property (strong, nonatomic) UIWindow *window;
@end

View File

@@ -10,6 +10,4 @@
@interface ViewController : UIViewController
@end

View File

@@ -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:

View File

@@ -20,6 +20,4 @@
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here

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>
static YGSize _measure(YGNodeRef node,
float width,

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>
TEST(YogaTest, computed_layout_margin) {
const YGNodeRef root = YGNodeNew();

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>
TEST(YogaTest, computed_layout_padding) {
const YGNodeRef root = YGNodeNew();

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>
TEST(YogaTest, assert_default_values) {
const YGNodeRef root = YGNodeNew();

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>
TEST(YogaTest, dirty_propagation) {
const YGNodeRef root = YGNodeNew();

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>
TEST(YogaTest, start_overrides) {
const YGNodeRef root = YGNodeNew();

View File

@@ -7,15 +7,14 @@
* 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);
(*measureCount)++;
@@ -30,12 +29,17 @@ static YGSize _measureMin(YGNodeRef node,
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,
.width =
widthMode == YGMeasureModeUndefined || (widthMode == YGMeasureModeAtMost && width > 10)
? 10
: width,
.height =
heightMode == YGMeasureModeUndefined || (heightMode == YGMeasureModeAtMost && height > 10)
? 10
: height,
};
}
@@ -50,8 +54,7 @@ static YGSize _measure_84_49(YGNodeRef node,
}
return YGSize{
.width = 84.f,
.height = 49.f,
.width = 84.f, .height = 49.f,
};
}

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;
@@ -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;

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>
static YGSize _measure(YGNodeRef node,
float width,
@@ -21,8 +21,7 @@ static YGSize _measure(YGNodeRef node,
}
return YGSize{
.width = 10,
.height = 10,
.width = 10, .height = 10,
};
}

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>
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

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>
TEST(YogaTest, dont_cache_computed_flex_basis_between_layouts) {
YGSetExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis, true);

View File

@@ -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,
};
}

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>
TEST(YogaTest, copy_style_same) {
const YGNodeRef node0 = YGNodeNew();